Skip to content

feat: add comment summary template for activity report highlights#2

Merged
mmcky merged 9 commits intomainfrom
feat/comment-summary-template
Feb 23, 2026
Merged

feat: add comment summary template for activity report highlights#2
mmcky merged 9 commits intomainfrom
feat/comment-summary-template

Conversation

@mmcky
Copy link
Contributor

@mmcky mmcky commented Feb 23, 2026

Comment Summary Template & Release Tracking

Adds the ability to auto-generate an editable highlights template alongside the activity report, now including release tracking. This addresses the workflow gap identified in QuantEcon/meta#280 — where maintainers write a hand-curated comment summarizing key work, but currently have to manually find and list all the merged PRs and releases.

What it does

When --summary-template is enabled, the script collects merged PR details (title, URL, author, labels) during the existing processing loop — no additional API calls required — and generates a comment-template.md file with:

  1. Placeholder summary — Editable topic bullets for high-level themes
  2. Releases table — All non-draft releases published in the period, sorted newest-first (omitted if none)
  3. Merged PRs grouped by repository — Every merged PR with title, URL, labels (in brackets), and author
  4. Contributor acknowledgement — Template section for thanks

Release tracking

The PR also adds a Releases column to the main report table and a consolidated releases table in the comment template:

  • Fetches /repos/{org}/{repo}/releases for each active repo (one API call per repo)
  • Filters to non-draft releases with published_at within the date range
  • Main report: New Releases column between Merged PRs and Commits, included in totals row
  • Comment template: Releases table at the top with Repository, Release (name/tag with link), Date columns
  • Works for both organization repos and external tracked repos
  • Cross-platform date formatting (GNU/Linux and BSD/macOS)

Debug output

All debug messages are now gated behind the --debug CLI flag (or debug: 'true' action input). Output is silent by default for a clean user experience.

How labels help

If PRs have labels (e.g., maintenance, infrastructure, priority: high), they appear in brackets:

  - Major refactor for responsiveness https://...pull/335 [infrastructure, priority: high] (@mmcky)

This makes it much easier to reorganize the flat per-repo list into thematic sections. The value of labels here motivates the labels standardization work in QuantEcon/meta#178.

Usage

CLI:

./generate-report.sh --token=ghp_xxxxx --summary-template
./generate-report.sh --token=ghp_xxxxx --summary-template --summary-template-file=highlights.md
./generate-report.sh --token=ghp_xxxxx --summary-template --debug

GitHub Action:

- uses: QuantEcon/action-weekly-report@v2
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    summary-template: 'true'
    debug: 'true'  # optional — enables verbose output

Changes

  • generate-report.sh — Added --summary-template, --summary-template-file, and --debug flags; collects merged PR details (title, URL, author, labels) during existing PR fetch; generates grouped template file; fetches releases per repo and adds to report table and comment template; all debug output gated behind debug() function
  • action.yml — New summary-template, summary-template-file, and debug inputs; new comment-template output
  • README.md — Updated features, CLI examples, options, inputs/outputs tables, example workflow
  • CHANGELOG.md — Added unreleased entries for comment template, release tracking, releases column, and debug flag
  • docs/comment-summary-template.md — Full feature documentation with examples, workflow guide, and security note on safe output handling
  • docs/README.md — Added to documentation index
  • .gitignore — Added comment-template.md and .tmp/

Includes

Related

  • QuantEcon/meta#280 — Activity report with hand-written highlights comment (the workflow this feature supports)
  • QuantEcon/meta#178 — Labels standardization (makes this feature more effective)

- New --summary-template flag and summary-template action input
- Collects merged PR titles, URLs, authors, and labels during processing
- Generates comment-template.md with PRs grouped by repository
- Includes placeholder sections for human-written thematic summaries
- Labels displayed in brackets to aid categorization
- New comment-template action output for downstream workflow steps
- Works with both org repos and external repositories
- Added docs/comment-summary-template.md with usage guide
Update example workflow in README and feature docs to show the full
3-step flow: generate report + template, create issue, then post the
template as the first comment using peter-evans/create-or-update-comment.
- Extract unique non-bot authors from merged PR data
- Format as 'thanks @user1, @user2, and @user3...' acknowledgement
- Filter out [bot] accounts and Copilot from contributor list
- Use markdown link format [PR Title](url) for clean GitHub rendering
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comment summary template feature that auto-generates an editable markdown template containing merged PR details from the activity report period. This addresses the workflow gap where maintainers manually write highlights comments but currently have to manually find and list all merged PRs (as described in QuantEcon/meta#280).

Changes:

  • Adds --summary-template and --summary-template-file CLI flags and corresponding GitHub Action inputs to enable template generation
  • Collects merged PR metadata (title, URL, author, labels) during existing report processing without additional API calls
  • Generates comment-template.md with placeholder topic sections, grouped PRs by repository, and contributor acknowledgements
  • Adds comprehensive documentation in docs/comment-summary-template.md with usage examples and workflow guides

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
generate-report.sh Adds CLI argument parsing for summary template flags; collects PR details during existing API calls; generates template with grouped PRs and contributors; adds template content to GITHUB_OUTPUT
action.yml Defines new summary-template and summary-template-file inputs with defaults; adds comment-template output; passes new inputs as environment variables
docs/comment-summary-template.md New comprehensive documentation covering feature background, usage (CLI and Action), output format, label benefits, workflows (automated and manual), and configuration options
docs/README.md Adds comment summary template to documentation index with feature highlights
README.md Updates features list, CLI examples, options table, inputs/outputs tables, and example workflow to include summary template functionality
CHANGELOG.md Adds unreleased entry documenting the new feature with all inputs, outputs, and documentation reference
.gitignore Adds comment-template.md and .tmp/ to prevent generated files from being committed

* feat: add release tracking to comment summary template

- Fetch releases published in the report date range via GitHub API
- Display releases with 📦 emoji at top of each repo section, before PRs
- Include release name, tag, and link to GitHub release page
- Works for both organization repos and external tracked repos
- Update docs and CHANGELOG with release tracking details
- Auto-detect contributors and use markdown links (carried from template branch)

* refactor: use single releases table at top of template (Option A)

- Replace per-repo inline release bullets with a single consolidated table
- Table columns: Repository, Release (name/tag with link), Date
- Sorted by publication date (newest first)
- Releases section omitted entirely when no releases in the period
- PR listings per repo remain unchanged below the table
- Update docs example and CHANGELOG

* feat: add Releases count column to report table

- Fetch releases unconditionally (not just when summary-template enabled)
- Add Releases column between Merged PRs and Commits in report table
- Release count links to repo's releases page when > 0
- Include in totals row and Details section
- Add to external repos table and totals
- Include in summary string output

* fix: address Copilot review feedback

- Add rate_limited_repos/failed_repos error handling for releases API call
- Use cross-platform date formatting (GNU first, BSD fallback)
- Remove unused all_template_repos dead code block
- Add CHANGELOG entry for Releases column in main report table
Use env: variable and action with: input instead of direct ${{ }}
interpolation in run: blocks to prevent shell injection from
PR-derived content (titles, labels, author names).
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

- Add --debug CLI flag and debug action input (default: false)
- Add debug() function that only prints when DEBUG_MODE=true
- Replace all 26 'echo DEBUG:' calls with debug() function
- Update README, action.yml, and CHANGELOG
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

- Restructure all api_call assignments to if-guard pattern so set -e
  doesn't abort the script on API failures (both org and external repos)
- Use non-zero-padded day format in releases table (%-d GNU, %e BSD)
- Fix comment saying '> 1' to match format_metric() behavior of '> 0'
- Soften docs wording from 'all merged PRs' to 'merged PRs'
- Document 100-item-per-page API limit in comment template docs
@mmcky mmcky merged commit 25bd331 into main Feb 23, 2026
3 checks passed
@mmcky mmcky deleted the feat/comment-summary-template branch February 23, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants