Skip to content

Commit f194866

Browse files
Initial Version to Monitor Github workflows using the automation app (#4)
* Monitor Github workflows Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com> * Improve wording and add license-hearder-checker Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> --------- Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com> Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 4366d27 commit f194866

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2604
-132
lines changed

.eslintrc.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* The OpenSearch Contributors require contributions made to
6+
* this file be licensed under the Apache-2.0 license or a
7+
* compatible open source license.
8+
*/
9+
110
module.exports = {
211
env: {
312
browser: false,
@@ -26,8 +35,8 @@ module.exports = {
2635
'import/prefer-default-export': 'off',
2736
'max-classes-per-file': 'off',
2837
'no-new': 'off',
29-
"no-console": "off",
30-
"no-underscore-dangle": 'off',
38+
'no-console': 'off',
39+
'no-underscore-dangle': 'off',
3140
'max-len': ['error', { code: 160, ignoreComments: true }],
3241
},
3342
};

.github/workflows/build.yml .github/workflows/build-test.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: build app
2+
name: build-test
33

44
on: [push, pull_request]
55

@@ -27,3 +27,5 @@ jobs:
2727
run: echo "Please run 'npm run format' before commiting the code!"
2828
- name: Run build
2929
run: npm run build
30+
- name: Run Test
31+
run: npm test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: License Header Checker
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
license-header-checker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Add License Header
12+
run: npx @kt3k/license-checker

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ npm-debug.log
66
coverage
77
bin
88
temp/*
9+
10+
# Intellij files
11+
.idea/*
12+
13+
.DS_Store

.licenserc.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"**/*.*": [" Copyright OpenSearch Contributors", " SPDX-License-Identifier: Apache-2.0"],
3+
"ignore": [
4+
".prettierrc",
5+
".md",
6+
".flake8",
7+
".yml",
8+
".yaml",
9+
".bat",
10+
".json",
11+
".txt",
12+
".config",
13+
".swp",
14+
"tests/tests_test_workflow/test_integ_workflow/integ_test/data/artifacts/",
15+
"tests/tests_sign_workflow/data/signature/",
16+
"tests/tests_assemble_workflow/data/artifacts/",
17+
".png",
18+
"settings.gradle",
19+
".git",
20+
".lychee.excludes",
21+
".whitesource",
22+
".shellcheckrc",
23+
".lock",
24+
".gradle",
25+
".cert",
26+
".key",
27+
".jar",
28+
".gz",
29+
".toml",
30+
".ini",
31+
"gradle/wrapper"
32+
]
33+
}

ADMINS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Admins
22

3-
| Admin | GitHub ID | Affiliation |
4-
| --------------- | --------------------------------------- | ----------- |
5-
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon |
3+
| Admin | GitHub ID | Affiliation |
4+
| ------------- | --------------------------------------- | ----------- |
5+
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon |
66

77
[This document](https://github.com/opensearch-project/.github/blob/main/ADMINS.md) explains what admins do in this repo. and how they should be doing it. If you're interested in becoming a maintainer, see [MAINTAINERS](MAINTAINERS.md). If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).

CODE_OF_CONDUCT.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ This code of conduct applies to all spaces provided by the OpenSource project in
22

33
**Our open source communities endeavor to:**
44

5-
* Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
6-
* Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
7-
* Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
8-
* Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.
5+
- Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
6+
- Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
7+
- Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
8+
- Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.
99

1010
**Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:**
1111

12-
* The use of violent threats, abusive, discriminatory, or derogatory language;
13-
* Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
14-
* Posting of sexually explicit or violent content;
15-
* The use of sexualized language and unwelcome sexual attention or advances;
16-
* Public or private harassment of any kind;
17-
* Publishing private information, such as physical or electronic address, without permission;
18-
* Other conduct which could reasonably be considered inappropriate in a professional setting;
19-
* Advocating for or encouraging any of the above behaviors.
12+
- The use of violent threats, abusive, discriminatory, or derogatory language;
13+
- Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
14+
- Posting of sexually explicit or violent content;
15+
- The use of sexualized language and unwelcome sexual attention or advances;
16+
- Public or private harassment of any kind;
17+
- Publishing private information, such as physical or electronic address, without permission;
18+
- Other conduct which could reasonably be considered inappropriate in a professional setting;
19+
- Advocating for or encouraging any of the above behaviors.
2020

2121
**Enforcement and Reporting Code of Conduct Issues:**
2222

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Contributing to this Project
22

3-
OpenSearch is a community project that is built and maintained by people just like **you**.
3+
OpenSearch is a community project that is built and maintained by people just like **you**.
44
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects.

MAINTAINERS.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
88

99
## Current Maintainers
1010

11-
| Maintainer | GitHub ID | Affiliation |
12-
| ------------------ | --------------------------------------------------------- | ----------- |
13-
| Saurabh Sing | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
14-
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
15-
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
16-
| Sayali Gaikawad | [gaiksaya](https://github.com/gaiksaya) | Amazon |
11+
| Maintainer | GitHub ID | Affiliation |
12+
| --------------- | --------------------------------------------------- | ----------- |
13+
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
14+
| Peter Zhu | [peterzhuamazon](https://github.com/peterzhuamazon) | Amazon |
15+
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
16+
| Sayali Gaikawad | [gaiksaya](https://github.com/gaiksaya) | Amazon |
1717

1818
## Emeritus
1919

20-
| Maintainer | GitHub ID | Affiliation |
21-
| ------------------ | --------------------------------------------------------- | ----------- |
20+
| Maintainer | GitHub ID | Affiliation |
21+
| ---------- | --------- | ----------- |

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ The automation app utilizes the [Probot](https://probot.github.io/) framework an
1919

2020
### Service
2121

22-
A **Service** is an instance of the app that manages and manipulates specific `Resource` while performing defined `Operation`.
23-
* **Resource**: Objects or entities the service will manage or modify, such as GitHub organizations, project, repositories, issues, etc.
24-
* **Operation**: A list of `Tasks` triggered by events with the resources.
25-
* **Task**: Executed sequentially within an `Operation` to perform action, such as create comments, update labels, add issue to project, etc.
26-
* **Call**: The callstack that contains the implementation of the aformentioned task action.
22+
A `Service` is an instance of the app that manages and manipulates specific `Resource` while performing defined `Operation`.
23+
24+
- **Resource**: Objects or entities the service will manage or modify, such as GitHub organizations, project, repositories, issues, etc.
25+
- **Operation**: A list of `Tasks` triggered by events with the resources.
26+
- **Task**: Executed sequentially within an `Operation` to perform action, such as create comments, update labels, add issue to project, etc.
27+
- **Call**: The callstack that contains the implementation of the aformentioned task action.
2728

2829
### Create a Service
2930

3031
To create a service, you need two configuration files:
31-
* **Resource configuration file**: Defines the resources that the service will manage or modify (`configs/resources/sample-resource.yml`).
32-
* **Operation configuration file**: Defines the operations (tasks) that the service will execute with the resources (`configs/resources/sample-operation.yml`).
32+
33+
- **Resource configuration file**: Defines the resources that the service will manage or modify (`configs/resources/sample-resource.yml`).
34+
- **Operation configuration file**: Defines the operations (tasks) that the service will execute with the resources (`configs/resources/sample-operation.yml`).
3335

3436
### Start the Service
3537

@@ -44,6 +46,7 @@ RESOURCE_CONFIG=configs/resources/sample-resource.yml OPERATION_CONFIG=configs/o
4446
```
4547

4648
When you run the above command, the following takes place:
49+
4750
1. The app starts a `Service` instance based on the specified configurations.
4851
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.
4952
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.
@@ -63,4 +66,3 @@ This project is licensed under the [Apache v2.0 License](LICENSE).
6366
## Copyright
6467

6568
Copyright OpenSearch Contributors. See [NOTICE](NOTICE) for details.
66-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Merged PRs Monitor with CI Status
3+
4+
events:
5+
- pull_request.closed
6+
7+
tasks:
8+
- name: PR Monitor Operation
9+
call: github-merged-pulls-monitor@default
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Workflow Runs Monitor
3+
4+
events:
5+
- workflow_run.completed
6+
7+
tasks:
8+
- name: Workflow Runs Monitor Operation
9+
call: github-workflow-runs-monitor@default
10+
args:
11+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
12+
events:
13+
- 'pull_request'
14+
- 'push'
15+
- 'pull_request_target'
16+
- 'release'
17+
- 'issues'
18+
- 'check_run'
19+
- 'check_suite'
20+
- 'issue_comment'
21+
- 'schedule'
22+
- 'workflow_dispatch'

jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module.exports = {
33
roots: ['<rootDir>/test'],
44
testMatch: ['**/*.test.ts'],
55
transform: {
6-
'^.+\\.tsx?$': 'ts-jest'
7-
}
6+
'^.+\\.tsx?$': 'ts-jest',
7+
},
88
};

0 commit comments

Comments
 (0)