You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor getters and pass resource into call and add codecov (#11)
* Refactor getter and pass resource into call
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Fix existing tests
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* More tweaks
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Add print-to-console test
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Add tests for verify-resource and create-issue-comment call
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Add octokit test on octokitAuth utility
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Update Readme
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Update codecov
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Add codecov step
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Add codecov step
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
* Rename verifyOrgRepo to verifyResourceConfig for later extension
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
---------
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
Copy file name to clipboardexpand all lines: README.md
+22-3
Original file line number
Diff line number
Diff line change
@@ -35,22 +35,41 @@ To create a service, you need two configuration files:
35
35
36
36
### Start the Service
37
37
38
-
Once you have created the resource and operation configuration files, follow these steps to start the service:
38
+
Before starting the service, create a `.env` file to connect it to your GitHub App by copying the `.env.example` file from this repository to `.env`.
39
+
40
+
Once you have created the `.env` file, resource / operation configuration files, follow these steps to start the service:
39
41
40
42
1. Set the `RESOURCE_CONFIG` environment variable to the path of the resource configuration YAML file.
41
43
1. Set the `OPERATION_CONFIG` environment variable to the path of the operation configuration YAML file.
42
-
1. Run the service using the following command:
44
+
1. Update the `INSTALLATION_ID` variable in `.env` file. ([How to find installation id of your GitHub App](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation#using-octokitjs-to-authenticate-with-an-installation-id))
45
+
1. Update your GitHub App settings on the GitHub website by defining the app's permissions and specifying the events to monitor.
46
+
1. Run the service using the following command.
47
+
1. (First Time Only) If you have created a new `.env` file, you will be directed to `http://localhost:3000` as seen in the console message. Open this URL in your browser and follow the instructions to set up the necessary information.
**Note**: You should run `npm run start` instead in production to run prettier / eslint / jest before starting the service.
56
+
48
57
When you run the above command, the following takes place:
49
58
50
59
1. The app starts a `Service` instance based on the specified configurations.
51
60
1. Retrieves the [GitHub Context](https://probot.github.io/api/latest/classes/context.Context.html) (or any other defined context) for all the resources listed in the resource config file.
52
61
1. Registers and listens for events, executes the `Tasks` defined in the operation config. These tasks will be executed sequentially when the corresponding events occur.
53
62
63
+
64
+
#### List of Environment Variables (You can use them directly in the startup command, export them, or add them to the `.env` file):
| INSTALLATION_ID | String | '' | Installation Id of your GitHub App, must install the App to repositories before retrieving the id. | '1234567890' |
70
+
| ADDITIONAL_RESOURCE_CONTEXT | Boolean | false | Setting true will let each resource defined in RESOURCE_CONFIG to call GitHub Rest API and GraphQL for more detailed context (ex: node_id). Increase startup time. | true / false |
71
+
| SERVICE_NAME | String | 'default' | Set Service Name | 'My Service' |'
72
+
54
73
## Code of Conduct
55
74
56
75
This project has adopted [the Open Source Code of Conduct](CODE_OF_CONDUCT.md).
Copy file name to clipboardexpand all lines: src/call/github-merged-pulls-monitor.ts
+5-1
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,13 @@
11
11
// Description : Monitors the CI workflows of merged pull requests, providing metrics that give an overview of whether pull requests were merged without passing CI checks.
Copy file name to clipboardexpand all lines: src/call/github-workflow-runs-monitor.ts
+5-1
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,17 @@
13
13
// - events : The list of events to monitor and index, from https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows.
0 commit comments