@@ -21,37 +21,22 @@ pip install -r requirements.txt
2121
22221 . add your details such as organization_name, workflow_name in ` config.yaml ` file:
2323
24-
2524organization_name: "Ansible Networking"
2625workflow_name: "tests.yml"
27- repo_config: "repo_config.json"
2826timedelta: 14
2927
30-
31- 2 . update the ` repo_config.json ` file with your repos:
32-
33-
34- {
35- "ansible-collections": {
36- "ci_and_bug_repos": [
37- "cisco.nxos",
38- "cisco.ios"
39- ] ,
40- "bug_specific_repos": [
41- "ansible.scm"
42- ]
43- }
44- }
45-
46-
47- 3 . Create a ` .env ` file in the root of your directory and add these details:
48-
28+ 2 . Create a ` .env ` file in the root of your directory and add these details:
4929
50305131EMAIL_PASSWORD=your_email_password
5232MAINTAINERS=
[ {"name": "Your Name", "email": "
[email protected] "}
] 5333#GITHUB_TOKEN=your_github_token (optional - enter your github token here to make authenticated requests or comment this line to make unauthenticated API requests)
54-
34+ REPO_CONFIG = {
35+ <organization >: {
36+ "ci_and_bug_repos": [ <list of repositories >] ,
37+ "bug_specific_repos": [ <list of repositories >]
38+ }
39+ }
5540
5641## Usage
5742
@@ -61,52 +46,105 @@ MAINTAINERS=[{"name": "Your Name", "email": "
[email protected] "}]
6146
6247 triager --bugs -c config.yaml --log --send-email
6348
64-
65492 . Run the CI report:
6650
6751 triager --ci -c config.yaml --log --send-email
6852
69-
7053### Docker Usage
7154
72551 . Build the Docker image:
7356
74- docker-compose build
75-
57+ sudo docker-compose build
7658
77592 . Run the bug scrub:
7860
79- docker-compose run triager --bugs -c config.yaml --log --send-email
80-
61+ sudo docker-compose run triager
8162
82633 . Run the CI report:
8364
84- docker-compose run triager --ci -c config.yaml --log --send-email
85-
65+ sudo docker-compose run ci_report
8666
8767### GitHub Actions
8868
89- 1 . Store your secrets (EMAIL_SENDER, EMAIL_PASSWORD, MAINTAINERS, GITHUB_TOKEN) in GitHub Actions secrets.
90-
91- To securely store sensitive information like email passwords and recipients, we'll use GitHub Secrets:
92- a) Go to your GitHub repository.
93- b) Click on "Settings" tab.
94- c) In the left sidebar, click on "Secrets and variables", then "Actions".
95- d) Click on "New repository secret".
96- e) Add the following secrets:
97-
98- Name: EMAIL_SENDER (Your tools email address from which you want to send emails)
99- Name: EMAIL_PASSWORD (Your tools email password)
100- MAINTAINERS: A JSON string containing the maintainers information.
101-
102- For example:
103-
104- 105- EMAIL_PASSWORD=your-email-password
106- MAINTAINERS=
[ {"name": "John Doe", "email": "
[email protected] "}, {"name": "Jane Doe", "email": "
[email protected] "}
] 107-
69+ This tool uses GitHub Actions for automated reporting. To set up the workflows:
70+
71+ 1 . Store your secrets in GitHub Actions:
72+ a) Go to your GitHub repository
73+ b) Click on "Settings" tab
74+ c) In the left sidebar, click on "Secrets and variables", then "Actions"
75+ d) Click on "New repository secret"
76+ e) Add the following secrets:
77+
78+ - ` EMAIL_SENDER ` : Your tool's email address for sending reports
79+ - ` EMAIL_PASSWORD ` : Your tool's email password
80+ - ` MAINTAINERS ` : A JSON string containing the maintainers' information
81+ - ` REPO_CONFIG ` : A JSON string containing the repository configuration
82+
83+ 2 . The following workflows are available in ` .github/workflows/ ` :
84+
85+ - ` bug_triager_workflow.yml ` : Runs weekly bug triage
86+ - ` ci_workflow.yml ` : Runs daily CI status report
87+
88+ ### Workflow Details
89+
90+ #### Bug Triage Workflow
91+
92+ This workflow runs every Wednesday at 2:30 PM IST (9:00 AM UTC) and can also be triggered manually.
93+
94+ ``` yaml
95+ name : Bug Triage Workflow
96+
97+ on :
98+ schedule :
99+ - cron : ' 0 9 * * 3'
100+ workflow_dispatch :
101+
102+ jobs :
103+ run-bug-triage :
104+ runs-on : ubuntu-latest
105+ steps :
106+ - uses : actions/checkout@v2
107+ - uses : actions/setup-python@v2
108+ with :
109+ python-version : ' 3.x'
110+ - run : pip install -r requirements.txt
111+ - run : python -m triager --bugs -c example-config.yaml --log --send-email
112+ env :
113+ EMAIL_SENDER : ${{ secrets.EMAIL_SENDER }}
114+ EMAIL_PASSWORD : ${{ secrets.EMAIL_PASSWORD }}
115+ GITHUB_TOKEN : ${{ github.token }}
116+ MAINTAINERS : ${{ secrets.MAINTAINERS }}
117+ REPO_CONFIG : ${{ secrets.REPO_CONFIG }}
118+
119+ # ### CI Report Workflow
120+
121+ This workflow runs daily at 12:00 PM IST (6:30 AM UTC) and can also be triggered manually.
122+
123+ ' '' ' yaml
124+ name : Nightly CI Report Workflow
125+
126+ on :
127+ schedule :
128+ - cron : ' 30 6 * * *'
129+ workflow_dispatch :
130+
131+ jobs :
132+ run-ci-report :
133+ runs-on : ubuntu-latest
134+ steps :
135+ - uses : actions/checkout@v2
136+ - uses : actions/setup-python@v2
137+ with :
138+ python-version : ' 3.x'
139+ - run : pip install -r requirements.txt
140+ - run : python -m triager --ci -c example-config.yaml --log --send-email
141+ env :
142+ EMAIL_SENDER : ${{ secrets.EMAIL_SENDER }}
143+ EMAIL_PASSWORD : ${{ secrets.EMAIL_PASSWORD }}
144+ GITHUB_TOKEN : ${{ github.token }}
145+ MAINTAINERS : ${{ secrets.MAINTAINERS }}
146+ REPO_CONFIG : ${{ secrets.REPO_CONFIG }}
108147
109- 2 . Use the provided workflow files in ` .github/workflows/ ` to set up automated runs.
110148
111149# # Options
112150
@@ -120,6 +158,30 @@ Options | Usage
120158' --debug' |Bumps logging level to DEBUG
121159' --send-email' |Send the triaged table as an email to the list of maintainers
122160
161+ # # Pre-commit Hooks
162+
163+ This tool uses pre-commit hooks to ensure code quality. The hooks perform the following checks :
164+
165+ - Check for merge conflicts
166+ - Verify symlinks
167+ - Detect debug statements
168+ - Fix end of files
169+ - Remove trailing whitespace
170+ - Add trailing commas
171+ - Format code with Prettier
172+ - Sort import statements with isort
173+ - Format Python code with Black
174+ - Lint Python code with Flake8
175+
176+ To use pre-commit :
177+
178+ 1. Install pre-commit : ` pip install pre-commit`
179+ 2. Install the git hook scripts : ` pre-commit install`
180+ 3. (Optional) Run against all files : ` pre-commit run --all-files`
181+
182+ Pre-commit will now run automatically on `git commit`. You can also run it manually on staged files with `pre-commit run`.
183+
184+
123185# # Notes
124186- An example config file (example-config.yaml) has been placed in this repository for reference.
125187- Tested with Python 3.11
@@ -130,3 +192,4 @@ Options | Usage
130192GNU General Public License v3.0 or later.
131193
132194See [LICENSE](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text.
195+ ```
0 commit comments