Fix pagination bug in auto-publish-pr.yaml listFiles() call
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, javascript
Research direction
Start in .github/workflows/auto-publish-pr.yaml at the detect-changes step around line 182, and inspect the pulls.listFiles() call plus the checks around lines 189-190. Update the workflow to handle all changed files, then run /publish on a PR with more than 30 changed files. Done means non-metadata changes trigger the OCI build and the skip message appears only for metadata-only changes.
Written by the indexing model from the issue text.
Description
What happened
PR #3644 updated the backstage workspace (36 files changed). The /publish workflow's detect-changes step at line 182 of auto-publish-pr.yaml calls github.rest.pulls.listFiles() without pagination or a per_page parameter. GitHub's REST API returns at most 30 items per page by default. Since this PR had 36 files — and the 34 metadata/*.yaml files sort alphabetically before plugins-list.yaml and source.json — the two non-metadata files landed on page 2 and were never fetched. The step concluded "only metadata files changed" and skipped the OCI build entirely. Without pr_3644__* OCI images, all 13 E2E tests failed. Maintainers ran /publish 5+ times over ~18 hours before the CI diagnosis agent identified the root cause. The PR was ultimately merged with failing checks, relying on the diagnosis that the failure was a pre-existing infrastructure bug.
What could go better
The listFiles() call should paginate to handle PRs with more than 30 files. This is a latent bug that has likely existed since the workflow was written but only surfaced now because the backstage workspace update exceeded 30 files. Any workspace update touching 31+ files (metadata + source files) will silently skip the OCI build. The CI diagnosis agent (comment) independently confirmed this diagnosis with high confidence, citing the specific line number and explaining the alphabetical sort order that causes plugins-list.yaml and source.json to be on the truncated page. Confidence: high — the bug is confirmed by code inspection, the CI diagnosis agent's analysis, and the observed behavior ("build skipped" message on a PR that clearly changed non-metadata files).
Proposed change
In .github/workflows/auto-publish-pr.yaml, replace the unpaginated listFiles() call (line 182) with GitHub's pagination helper:
Before:
const prFiles = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
After:
const prFiles = await github.paginate(github.rest.pulls.listFiles, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
per_page: 100,
});
Also update the references on lines 189-190 from prFiles.data.length / prFiles.data.every(...) to prFiles.length / prFiles.every(...), since github.paginate() returns the array directly rather than wrapping it in a .data property.
Validation criteria
- After the fix, run
/publishon a PR with >30 changed files (e.g., abackstageworkspace update). The workflow should detect non-metadata files and proceed with the OCI build instead of skipping it. - The "build skipped (only metadata files changed)" message should only appear on PRs that genuinely only modify
metadata/*.yamlfiles. - The next 3 workspace updates that touch >30 files should complete
/publishsuccessfully on the first attempt without the pagination-related skip.
Generated by retro agent from https://github.com/redhat-developer/rhdh-plugin-export-overlays/pull/3644
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 72
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 133
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from redhat-developer/rhdh-plugin-export-overlays
-
documentation non-workspace-changes ready-for-triage ready-to-code
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3815 · 3 comments ·
-
documentation non-workspace-changes ready-for-triage ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
redhat-developer/rhdh-plugin-export-overlays#3810 · 3 comments ·
-
Add AGENTS.md review guidance: Prettier/ESLint/TypeScript violations in e2e-tests are CI-blocking Opendocumentation ready-for-triage ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3792 · 3 comments ·
-
e2e-failure ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3789 · 1 comment ·
-
e2e-failure ready-to-code
Difficulty 1/5 Under an hour Newbie friendliness 88/100
redhat-developer/rhdh-plugin-export-overlays#3788 · 1 comment ·
All issues in redhat-developer/rhdh-plugin-export-overlays
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100