10000 ICU-23056 Add workflow to generate commit checker report · unicode-org/icu@9cc28a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cc28a6

Browse files
committed
ICU-23056 Add workflow to generate commit checker report
See #3413
1 parent 0748442 commit 9cc28a6

File tree

2 files changed

+87
-2
lines changed

2 files changed

+87
-2
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: BRS Commit Checker Report
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
fix_version:
6+
type: string
7+
required: true
8+
description: The ICU Jira "Fix Version" semver
9+
from_git_ref:
10+
type: string
11+
required: true
12+
description: The git ref start of comparison range. Prefix branches with `origin/`.
13+
end_git_ref:
14+
type: string
15+
required: true
16+
description: The git ref end of comparison range. Must be descendant of `from_git_ref`. Prefix branches with `origin/`.
17+
# Jira user name & API token is used for processing sensitive tickets comes from Github Secrets
18+
# stored in the repository
19+
20+
jobs:
21+
commit-report:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-tags: true
27+
fetch-depth: 0
28+
# workaround for bug in checkout action. this step should be redundant.
29+
# https://github.com/actions/checkout/issues/1471
30+
# https://github.com/actions/checkout/issues/1781
31+
# https://github.com/actions/checkout/issues/701#issuecomment-1133937950
32+
- name: Fetch all tags
33+
run: |
34+
git fetch --tags origin
35+
- name: Fetch all branches
36+
run: |
37+
git fetch origin
38+
- name: Setup Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.12.8'
42+
cache: 'pipenv'
43+
cache-dependency-path: |
44+
tools/commit-checker/Pipfile
45+
tools/commit-checker/Pipfile.lock
46+
- name: Install pipenv
47+
run: |
48+
sudo pip3 install pipenv
49+
- name: Generate report
50+
env:
51+
JIRA_USERNAME: ${{ secrets.COMMIT_CHECKER_JIRA_EMAIL }}
52+
JIRA_PASSWORD: ${{ secrets.COMMIT_CHECKER_JIRA_TOKEN }}
53+
run: |
54+
pushd ./tools/commit-checker
55+
pipenv install
56+
pipenv run python3 check.py \
57+
--jira-query "project=ICU AND fixVersion=${{ inputs.fix_version }}" \
58+
--rev-range "${{ inputs.from_git_ref }}..${{ inputs.end_git_ref }}" > REPORT.md
59+
popd
60+
# https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/
61+
- name: Reproduce report as workflow job summary
62+
run: |
63+
cat ./tools/commit-checker/REPORT.md >> $GITHUB_STEP_SUMMARY
64+
echo "View the Summary page of this GHA Workflow instance to view the rendered Markdown of this report."

docs/processes/release/tasks/miscellaneous.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,34 @@ merging post RC fixes from trunk and others.
5757
Every commit being shipped in the next ICU release should be labeled with a Jira
5858
ticket that is marked as fixed with the correct fix version. Further, there
5959
should be no Jira tickets marked as fixed with the current fixVersion that do
60-
not have commits. To check this, run the following tool:
60+
not have commits.
61+
62+
### Run locally
63+
64+
To check this, run the following tool:
6165

6266
<https://github.com/unicode-org/icu/tree/main/tools/commit-checker>
6367

64-
Follow the instructions in the README file to generate the report and send it
68+
Follow the instructions in the README file to generate the report locally and send it
6569
for review.
6670

71+
### Run via CI
72+
73+
Alternatively, you can run the "BRS Commit Checker Report" workflow directly from the project page CI
74+
by:
75+
76+
1. Go to the [Actions tab](https://github.com/unicode-org/icu/actions)
77+
1. Click on the "BRS Commit Checker Report" workflow name on the left hand list of workflows
78+
1. Click the "Run workflow" dropdown.
79+
80+
The dropdown should reveal an input form in which to provide inputs
81+
82+
1. Provide the same inputs in the form as you would for a local run of the tool,
83+
as described in the tool's Readme in the instructions above.
84+
85+
The only difference from the local run instructions is that git branch names in the
86+
Actions workflow input form should be prefixed with `origin/`.
87+
6788
---
6889

6990
## Fix Mis-ticketted commits

0 commit comments

Comments
 (0)
0