Skip to content

ci(generation-check): dynamically select fastest 3 modified packages on presubmit - #9405

Open
quirogas wants to merge 3 commits into
googleapis:mainfrom
quirogas:ci/presubmit-librarian-generate-fastest
Open

quirogas wants to merge 3 commits into
googleapis:mainfrom
quirogas:ci/presubmit-librarian-generate-fastest

Conversation

@quirogas

Copy link
Copy Markdown
Contributor

Summary

Updates .github/workflows/generation_check.yaml to catch unauthorized or accidental edits under packages/** during presubmit (pull_request) without relying on any static timing file or running librarian generate --all across all 245 libraries on every PR:

  • Adds packages/** to dorny/paths-filter and sets fetch-depth: 2 on actions/checkout so modified files in packages/ and librarian.yaml are detected on pull_request.
  • Dynamically computes candidate package weights at runtime using a MinPriorityQueue ordered by on-disk package size (totalBytes excluding node_modules/build) and API version count in librarian.yaml (score = totalBytes + apiCount * 500000).
  • Runs librarian generate <pkg> on the fastest 3 modified packages during presubmit (excluding libraries marked skip_generate: true), and fails immediately if any unconfigured directory/file under packages/ is modified or if regeneration produces a dirty git working tree.
  • Retains full librarian generate --all verification on push to main and workflow_dispatch.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@quirogas
quirogas force-pushed the ci/presubmit-librarian-generate-fastest branch from 9ccf2e3 to 77671aa Compare September 22, 2026 00:11
@quirogas quirogas self-assigned this Sep 22, 2026
@quirogas
quirogas marked this pull request as ready for review September 22, 2026 04:29
@quirogas
quirogas requested a review from a team as a code owner September 22, 2026 04:29
@github-actions
github-actions Bot requested a review from shivanee-p September 22, 2026 04:29
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.

1 participant