Skip to content

ci: fix metrics scope mismatch, report payload limits, and header formatting - #2262

Open
bhuvan-somisetty wants to merge 1 commit into
flatcar:mainfrom
bhuvan-somisetty:fix-ci-metrics-pipeline
Open

ci: fix metrics scope mismatch, report payload limits, and header formatting#2262
bhuvan-somisetty wants to merge 1 commit into
flatcar:mainfrom
bhuvan-somisetty:fix-ci-metrics-pipeline

Conversation

@bhuvan-somisetty

@bhuvan-somisetty bhuvan-somisetty commented Aug 1, 2026

Copy link
Copy Markdown

Why

Fixes #2261.

The monthly community metrics workflow (.github/workflows/issue-pr-contrib-metrics.yaml) suffered from four related systemic issues:

  1. Issue and PR metrics queries used un-scoped org:flatcar queries, resulting in temporary vendor/upstream forks (flatcar/systemd, flatcar/gentoo, etc.) polluting stats and violating the repository exclusion policy enforced in step 1 (contributors@v1).
  2. Unbounded concatenation of markdown tables exceeded GitHub's 65,536-character body limit on active months, causing peter-evans/create-issue-from-file@v5 and create-or-update-comment@v4 to fail with HTTP 422 Unprocessable Entity (body is too long).
  3. Copy-pasted header text (See comment below for Pull Request Metrics) inside comment_report.md caused the PR comment to self-referentially instruct readers to look below for PR metrics.
  4. Brittle date -d "last month" and date -d "yesterday" month-arithmetic caused non-contiguous or invalid query intervals when executed near month boundaries.

What changed

  • Scope Unification: Appended -is:fork -is:archived to all issue-metrics search queries (All open Issues, New issues created, Issues closed, All open PRs, New PRs created, PRs closed) to exclude temporary forks and mirrors.
  • Payload Safety Bound: Added byte-length checking and truncation in step Assemble full report to cap summary_report.md and comment_report.md under 60,000 characters, preventing API HTTP 422 failures.
  • Template Header Cleanup: Replaced misleading self-referential header text in comment_report.md with proper section introduction.
  • Deterministic Date Bounds: Updated default start/end date calculations to compute exact previous-month start and end dates using first-of-month and end-of-month date arithmetic (date -d "$(date +%Y-%m-01) -1 month" and date -d "$(date +%Y-%m-01) -1 day").

Notes

  • All changes are isolated to .github/workflows/issue-pr-contrib-metrics.yaml.
  • Verified bash syntax and date calculation arithmetic across month-end boundaries.
  • Contains DCO sign-off: Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>.

Signed-off-by: bhuvan-somisetty somisettybhuvan5@gmail.com

…matting

Fix four related defects in .github/workflows/issue-pr-contrib-metrics.yaml:
1. Exclude temporary upstream/vendor forks and archived repositories from issue and PR metric queries by appending -is:fork -is:archived to SEARCH_QUERY filters.
2. Add size validation and truncation in Assemble full report to enforce a 60,000-character payload bound on summary_report.md and comment_report.md, preventing HTTP 422 API errors on high-activity months.
3. Fix self-referential header text in comment_report.md.
4. Calculate start_date and end_date using deterministic first-of-month and end-of-month date arithmetic.

Fixes flatcar#2261

Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
@bhuvan-somisetty

Copy link
Copy Markdown
Author

Hi @John15321 @t-lo @dongsupark @tormath1 @chewi,

Could you please take a look at this PR when you get a chance? It resolves issue #2261 by fixing the CI metrics workflow scope queries, adding payload size bounds to prevent API errors on active months, fixing the comment report header, and hardening month date calculations.

Thanks!

@LexiNadolski

Copy link
Copy Markdown
Contributor

@bhuvan-somisetty do not tag multiple maintainers for reviews. If you persist we will have to evaluate your access. Thank you. Look at the linux foundation standards of excellence and abide by them.

@bhuvan-somisetty

Copy link
Copy Markdown
Author

My bad, will not repeat again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 📝 Needs Triage

Development

Successfully merging this pull request may close these issues.

ci: fix metrics scope mismatch, report body truncation overflow, and malformed outputs in community report workflow

4 participants