-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
chore: progress reporter #10717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rafaeltonholo
merged 3 commits into
thunderbird:main
from
wmontwe:chore-progress-reporter
Mar 23, 2026
Merged
chore: progress reporter #10717
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| name: PR - Request report labels | ||
|
|
||
| # Warning, this job is running on pull_request_target and therefore has access to issue content. | ||
| # Don't add any steps that act on external code. | ||
| on: | ||
| pull_request_target: | ||
| types: [ opened, reopened, synchronize, labeled, unlabeled ] | ||
| branches: | ||
| - main | ||
| - beta | ||
| - release | ||
|
|
||
| permissions: | ||
| contents: none | ||
|
|
||
| jobs: | ||
| require-report-label: | ||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Validate report label | ||
| id: validate | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| labels_json='${{ toJson(github.event.pull_request.labels) }}' | ||
|
|
||
| echo "Current labels:" | ||
| echo "$labels_json" | jq -r '.[].name' | ||
|
|
||
| include_count="$(jq '[.[] | select(.name == "report: include")] | length' <<< "$labels_json")" | ||
| exclude_count="$(jq '[.[] | select(.name == "report: exclude")] | length' <<< "$labels_json")" | ||
| highlight_count="$(jq '[.[] | select(.name == "report: highlight")] | length' <<< "$labels_json")" | ||
|
|
||
| total_count=$((include_count + exclude_count + highlight_count)) | ||
|
|
||
| if [ "$total_count" -eq 0 ]; then | ||
| echo "valid=false" >> "$GITHUB_OUTPUT" | ||
| echo "message=Missing report label. Set exactly one of: \`report: include\`, \`report: exclude\` OR \`report: highlight\`." >> "$GITHUB_OUTPUT" | ||
| elif [ "$total_count" -gt 1 ]; then | ||
| echo "valid=false" >> "$GITHUB_OUTPUT" | ||
| echo "message=Only one report label is allowed: \`report: include\`, \`report: exclude\` OR \`report: highlight\`." >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "valid=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Comment on PR (only on error) | ||
| if: steps.validate.outputs.valid == 'false' | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| MESSAGE: ${{ steps.validate.outputs.message }} | ||
| run: | | ||
| gh pr comment "$PR_NUMBER" \ | ||
| --repo "${{ github.repository }}" \ | ||
| --body "$MESSAGE" | ||
|
|
||
| - name: Fail if invalid | ||
| if: steps.validate.outputs.valid == 'false' | ||
| env: | ||
| MESSAGE: ${{ steps.validate.outputs.message }} | ||
| run: | | ||
| echo "::error::$MESSAGE" | ||
| exit 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Merged PR Report | ||
|
|
||
| Generate a monthly report of pull requests merged into the `main`, `beta`, and `release` branches of `thunderbird/thunderbird-android`. | ||
|
|
||
| The script `scripts/merged-pr-report.sh` produces: | ||
|
|
||
| - A Markdown report for review | ||
| - A CSV report for spreadsheet import or further processing | ||
|
|
||
| ## What it reports | ||
|
|
||
| For each merged pull request, the report includes: | ||
|
|
||
| - Target branch (`main`, `beta`, `release`) | ||
| - PR number | ||
| - Merge date | ||
| - PR title | ||
| - Report status from GitHub labels | ||
| - First beta tag containing the merge commit | ||
| - First release tag containing the merge commit | ||
|
|
||
| The CSV report additionally includes: | ||
|
|
||
| - PR author | ||
| - Merge commit SHA | ||
| - PR URL | ||
| - Empty `Comment` column for manual notes | ||
|
|
||
| ## Report status labels | ||
|
|
||
| The script reads these labels from the PR: | ||
|
|
||
| | Label | Result | | ||
| |------|--------| | ||
| | `report: include` | Include | | ||
| | `report: exclude` | Exclude | | ||
| | `report: highlight` | Highlight | | ||
| | *(none)* | Review | | ||
|
|
||
| ## Beta and Release columns | ||
|
|
||
| For each PR merge commit, the script determines: | ||
|
|
||
| - **Beta**: first beta tag (containing `b`) that contains the merge commit (only if the commit reached the `beta` branch) | ||
| - **Release**: first production release tag (excluding `b`, including dot releases) that contains the merge commit (only if the commit reached the `release` branch) | ||
|
|
||
| Possible values: | ||
|
|
||
| - A tag (e.g. `THUNDERBIRD_115_0b1`, `THUNDERBIRD_115_1_0`) | ||
| - `Not released yet` (commit reached the branch but is not yet tagged) | ||
| - `-` (commit not present in that branch history) | ||
|
|
||
| ## How it works | ||
|
|
||
| The script: | ||
|
|
||
| 1. Validates input (`YEAR`, `MONTH`) | ||
| 2. Computes the monthly date range | ||
| 3. Creates a temporary git repository | ||
| 4. Fetches: | ||
| - `main`, `beta`, `release` | ||
| - all tags | ||
| 5. Queries GitHub for merged PRs | ||
| 6. Maps report labels to status | ||
| 7. Resolves beta/release versions via git ancestry and tags | ||
| 8. Writes Markdown and CSV outputs | ||
|
|
||
| To improve performance, version lookups are cached per merge commit SHA. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| ./scripts/merged-pr-report.sh YEAR MONTH [TARGET_DIR] [--skip-excluded] | ||
| ``` | ||
|
|
||
| Example: | ||
|
|
||
| ```bash | ||
| ./scripts/merged-pr-report.sh 2026 02 | ||
| ./scripts/merged-pr-report.sh 2026 02 ./reports | ||
| ./scripts/merged-pr-report.sh 2026 02 . --skip-excluded | ||
| ``` | ||
|
|
||
| Arguments: | ||
|
|
||
| - `YEAR`: Four-digit year (e.g. 2026) | ||
| - `MONTH`: Two-digit month (01-12) | ||
| - `TARGET_DIR`: (Optional) Target directory for reports (default: current directory) | ||
| - `--skip-excluded`: (Optional) If set, PRs with `report: exclude` label are omitted from the report | ||
|
|
||
| ## Requirements | ||
|
|
||
| - `git` | ||
| - `gh` (GitHub CLI) | ||
| - `jq` | ||
| - macOS / BSD `date` (uses `date -j`) | ||
|
|
||
| Authenticate GitHub CLI: | ||
|
|
||
| ```bash | ||
| gh auth login |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.