Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into ocm-table-sort
  • Loading branch information
Zaperex committed Jan 18, 2024
2 parents 609bf9f + 43bfb77 commit 8034835
Show file tree
Hide file tree
Showing 107 changed files with 4,862 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ yarn.lock @janus-idp/maintainers-plugins
/plugins/orchestrator @janus-idp/maintainers-plugins @caponetto @jkilzi
/plugins/orchestrator-backend @janus-idp/maintainers-plugins @caponetto @jkilzi
/plugins/orchestrator-common @janus-idp/maintainers-plugins @caponetto @jkilzi
/plugins/feedback @janus-idp/maintainers-plugins @yashoswalyo @riginoommen @deshmukhmayur
/plugins/feedback-backend @janus-idp/maintainers-plugins @yashoswalyo @riginoommen @deshmukhmayur
4 changes: 4 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
# don't persist the GITHUB_TOKEN
# so that semantic-release can use use the generated token
persist-credentials: false

- name: Build all packages
uses: ./.github/actions/build
Expand Down
1 change: 1 addition & 0 deletions plugins/feedback-backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
6 changes: 6 additions & 0 deletions plugins/feedback-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## @janus-idp/backstage-plugin-feedback-backend 1.0.0 (2024-01-18)


### Features

* **#1019:** implemented feedback plugin ([#1045](https://github.com/janus-idp/backstage-plugins/issues/1045)) ([34c312e](https://github.com/janus-idp/backstage-plugins/commit/34c312e3c8522e81d04621abdcb174c0ecb25733)), closes [#1019](https://github.com/janus-idp/backstage-plugins/issues/1019)
8 changes: 8 additions & 0 deletions plugins/feedback-backend/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- yashoswalyo
- riginoommen
- deshmukhmayur
reviewers:
- yashoswalyo
- riginoommen
- deshmukhmayur
91 changes: 91 additions & 0 deletions plugins/feedback-backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Feedback Backend

This is feedback-backend plugin which provides Rest API to create feedbacks.

It is also repsonsible for creating JIRA tickets,

## Getting started

### Installation

1. Install the backend plugin.

```bash
# From your backstage root directory
yarn workspace backend add @janus-idp/backstage-plugin-feedback-backend
```

2. Then create a new file `packages/backend/src/plugins/feedback.ts` and add the following:

```ts
import { Router } from 'express';

import { createRouter } from '@janus-idp/backstage-plugin-feedback-backend';

import { PluginEnvironment } from '../types';

export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
logger: env.logger,
config: env.config,
discovery: env.discovery,
});
}
```

3. Next we wire this into overall backend router, edit `packages/backend/src/index.ts`:

```ts
import feedback from './plugins/feedback';

// ...
async function main() {
// ...
const feedbackEnv = useHotMemoize(module, () => createEnv('feedback'));
apiRouter.use('/feedback', await feedback(feedbackEnv));
}
```

4. Now add below config in your `app-config.yaml` file.

```yaml
feedback:
integrations:
jira:
# Under this object you can define multiple jira hosts
- host: ${JIRA_HOST_URL}
token: ${JIRA_TOKEN}

email:
## Email integration uses nodemailer to send emails
host: ${EMAIL_HOST}
port: ${EMAIL_PORT} # defaults to 587, if not found

## Email address of sender
from: ${EMAIL_FROM}

## [optional] Authorization using user and password
auth:
user: ${EMAIL_USER}
pass: ${EMAIL_PASS}

# boolean
secure: false

# Path to ca certificate if required by mail server
caCert: ${NODE_EXTRA_CA_CERTS}
```
### Set up frontend plugin
Follow instructions provided [feedback-plugin](../feedback/README.md)
### API reference
The API specifications file can be found at [docs/openapi3_0](./docs/openapi3_0.yaml)
### Run
1. Now run `yarn workspace @janus-idp/backstage-plugin-feedback-backedn start-backend`.
25 changes: 25 additions & 0 deletions plugins/feedback-backend/app-config.janus-idp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
feedback:
integrations:
jira:
# Under this object you can define multiple jira hosts
- host: ${JIRA_HOST_URL}
token: ${JIRA_TOKEN}

email:
## Email integration uses nodemailer to send emails
host: ${EMAIL_HOST}
port: ${EMAIL_PORT} # defaults to 587, if not found

# Email address of sender
from: ${EMAIL_FROM}

## Authorization using user and password
auth:
user: ${EMAIL_USER}
pass: ${EMAIL_PASS}

# boolean
secure: false

# Path to ca certificate if required by mail server
caCert: ${NODE_EXTRA_CA_CERTS}
71 changes: 71 additions & 0 deletions plugins/feedback-backend/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* Configuration options for the application.
*/
export interface Config {
feedback?: {
integrations: {
/**
* Configuration options for JIRA integration.
* It is an array, which can be used to set up multiple jira servers at the same time.
*/
jira?: Array<{
/**
* The hostname or URL of the JIRA organization.
*/
host: string;

/**
* The access token for authenticating with JIRA.
*/
token: string;
}>;

/**
* Configuration options for email integration.
*/
email?: {
/**
* The SMTP server's hostname or IP address.
*/
host: string;

/**
* The port number to use for the SMTP server.
*/
port: number;

/**
* Optional authentication settings for the SMTP server.
*/
auth?: {
/**
* The username to use for SMTP server authentication.
*/
user?: string;

/**
* The password to use for SMTP server authentication.
* @visibility secret
*/
pass?: string;
};

/**
* Set to `true` if you want to use SSL/TLS for the SMTP connection.
* Default is `false`.
*/
secure?: boolean;

/**
* The email address from which emails will be sent.
*/
from?: string;

/**
* Path to a custom CA certificate file.
*/
caCert?: string;
};
};
};
}
Loading

0 comments on commit 8034835

Please sign in to comment.