ICU-23056 Add workflow to generate commit checker report

See #3413
This commit is contained in:
Elango Cheran 2025-02-26 01:05:02 +00:00
parent 0748442ed6
commit 9cc28a6428
2 changed files with 87 additions and 2 deletions

View file

@ -0,0 +1,64 @@
name: BRS Commit Checker Report
on:
workflow_dispatch:
inputs:
fix_version:
type: string
required: true
description: The ICU Jira "Fix Version" semver
from_git_ref:
type: string
required: true
description: The git ref start of comparison range. Prefix branches with `origin/`.
end_git_ref:
type: string
required: true
description: The git ref end of comparison range. Must be descendant of `from_git_ref`. Prefix branches with `origin/`.
# Jira user name & API token is used for processing sensitive tickets comes from Github Secrets
# stored in the repository
jobs:
commit-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
# workaround for bug in checkout action. this step should be redundant.
# https://github.com/actions/checkout/issues/1471
# https://github.com/actions/checkout/issues/1781
# https://github.com/actions/checkout/issues/701#issuecomment-1133937950
- name: Fetch all tags
run: |
git fetch --tags origin
- name: Fetch all branches
run: |
git fetch origin
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
cache: 'pipenv'
cache-dependency-path: |
tools/commit-checker/Pipfile
tools/commit-checker/Pipfile.lock
- name: Install pipenv
run: |
sudo pip3 install pipenv
- name: Generate report
env:
JIRA_USERNAME: ${{ secrets.COMMIT_CHECKER_JIRA_EMAIL }}
JIRA_PASSWORD: ${{ secrets.COMMIT_CHECKER_JIRA_TOKEN }}
run: |
pushd ./tools/commit-checker
pipenv install
pipenv run python3 check.py \
--jira-query "project=ICU AND fixVersion=${{ inputs.fix_version }}" \
--rev-range "${{ inputs.from_git_ref }}..${{ inputs.end_git_ref }}" > REPORT.md
popd
# https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/
- name: Reproduce report as workflow job summary
run: |
cat ./tools/commit-checker/REPORT.md >> $GITHUB_STEP_SUMMARY
echo "View the Summary page of this GHA Workflow instance to view the rendered Markdown of this report."

View file

@ -57,13 +57,34 @@ merging post RC fixes from trunk and others.
Every commit being shipped in the next ICU release should be labeled with a Jira
ticket that is marked as fixed with the correct fix version. Further, there
should be no Jira tickets marked as fixed with the current fixVersion that do
not have commits. To check this, run the following tool:
not have commits.
### Run locally
To check this, run the following tool:
<https://github.com/unicode-org/icu/tree/main/tools/commit-checker>
Follow the instructions in the README file to generate the report and send it
Follow the instructions in the README file to generate the report locally and send it
for review.
### Run via CI
Alternatively, you can run the "BRS Commit Checker Report" workflow directly from the project page CI
by:
1. Go to the [Actions tab](https://github.com/unicode-org/icu/actions)
1. Click on the "BRS Commit Checker Report" workflow name on the left hand list of workflows
1. Click the "Run workflow" dropdown.
The dropdown should reveal an input form in which to provide inputs
1. Provide the same inputs in the form as you would for a local run of the tool,
as described in the tool's Readme in the instructions above.
The only difference from the local run instructions is that git branch names in the
Actions workflow input form should be prefixed with `origin/`.
---
## Fix Mis-ticketted commits