feat: add PENDING subResult status and pending-repositories output#204
Merged
Conversation
Repos with an open sync PR already up-to-date (pr-up-to-date) are now reported as pending instead of changed. Adds a new pending-repositories output, separate 🔄 Pending row in the job summary, and redistributes those repos out of changed-repositories (mixed repos with real changes still count as changed). Resolves #183 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new “pending merge” classification for repositories that only have an already-up-to-date sync PR (syncStatus === 'pr-up-to-date'), so they no longer inflate the changed-repositories count. It adds a new pending-repositories output, updates the job summary to display pending counts/rows, and documents the new semantics (including the new subResults[].status: 'pending' value).
Changes:
- Added
SubResultStatus.PENDINGand centralized PR-sync status mapping viastatusForSync()to emitpendingonly forpr-up-to-date. - Added
pending-repositoriesoutput and updated the job summary to show Pending counts and a “🔄 Pending” status row. - Updated README/action metadata and added tests covering pure-pending, mixed (changed+pending), and baseline pending=0 scenarios.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Adds PENDING sub-result status, pending repo classification/counting, new output, and summary/table updates. |
README.md |
Documents the new pending-repositories output and the updated semantics (including subResults[].status: 'pending'). |
action.yml |
Adds the pending-repositories output and updates output descriptions to match new behavior. |
__tests__/index.test.js |
Adds run-level tests to validate pending classification, mixed classification precedence, and pending output baseline. |
package.json |
Bumps version to 2.10.0 for the behavior/output change. |
package-lock.json |
Updates lockfile version field to align with the package.json bump. |
badges/coverage.svg |
Updates coverage badge value after test changes. |
Copilot's findings
- Files reviewed: 5/7 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
📦 Draft Release CreatedA draft release v2.10.0 has been created for this PR. Next Steps
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #183
Why
Repositories whose only "change" was an open sync PR already up-to-date (
pr-up-to-date) were being counted underchanged-repositories, which is misleading because nothing was actioned on that run — the PR just needs merging. This made the summary read "4 repos changed" when 3 of them were actually idle from previous runs.What changed
SubResultStatus.PENDING('pending') emitted only when a sync helper returnssyncStatus === 'pr-up-to-date'. Everything else (commits pushed, PRs created/updated, stale PRs closed, dry-runwould-*) staysCHANGED.pending-repositoriesoutput and a🔄 Pendingrow in the job summary table and header counts.changed-repositoriesintopending-repositories. Mixed repos (real CHANGE + pr-up-to-date) still count as changed — bucket priority mirrors the existing failure-count logic Wuodan suggested:changed > pending > unchanged, withwarningas an independent overlay.Invariant:
updated-repositories === changed + pending + unchanged.Notes for reviewers
statusForSync()helper so the rule stays in one place. Autolinks/environments don't go through PRs, so they're unaffected.resultsJSON now includes'pending'insubResults[].status— called out in the README. Consumers filtering bystatus === 'changed'won't see pr-up-to-date entries anymore (intentional).2.9.6→2.10.0. Treated as a minor bump per the issue thread: thechanged-repositoriesredistribution is the bug fix that motivated the change, andpending-repositoriesis purely additive.Tests
npm run allpasses (lint, 405 tests, coverage, ncc bundle). Added three new run-level tests covering: pure-pending classification +🔄 Pendingrow, mixed-repo stays Changed,pending-repositories: '0'baseline.