fix(labels): ensurePullRequestLabel misses labels beyond first page - #161
Closed
glorysr1209-png wants to merge 10 commits into
Closed
fix(labels): ensurePullRequestLabel misses labels beyond first page#161glorysr1209-png wants to merge 10 commits into
glorysr1209-png wants to merge 10 commits into
Conversation
JSONbored
requested changes
Jun 1, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@glorysr1209-png The direct label lookup is a good API-level fix, but the branch currently breaks webhook accounting.
A few notes:
- Switching to
GET /labels/{name}avoids the first-page-only repository-label lookup problem. - CI now fails because the queue webhook test expected
labelsCreated: 1and receivedlabelsCreated: 0. - That means the missing-label creation path is no longer reflected correctly in the visible queue stats.
Required changes:
- Preserve direct lookup for existing labels.
- Preserve missing-label creation and
labelsCreatedaccounting when the label does not exist. - Keep both cases covered in tests.
Validation expected:
npm run test:coverage
This was referenced Jun 2, 2026
JSONbored
self-requested a review
June 3, 2026 22:14
JSONbored
requested changes
Jun 3, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@glorysr1209-png this is still blocked by CI.
A few notes:
- Direct label lookup by name is a reasonable fix for first-page pagination misses.
- Current validate fails in
test/unit/queue.test.tsbecauselabelsCreatedis0where the test expects1. - The body needs current validation/safety evidence.
Required changes:
- Fix the label-create/lookup behavior or update the test only if the expected behavior has intentionally changed.
- Update the PR body to the current template.
Validation expected:
- Focused label tests
- Full validate pipeline
Owner
|
This is now stale/have been awaiting changes for a few days with no response. Please feel free to try again based on current codebase status if interested. |
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.
Summary
Closes #160.
Look up repository labels by name instead of scanning only the first labels page.
Changes
GET /repos/{owner}/{repo}/labels/{name}with 404 → create when allowed.Test plan
npm test -- test/unit/github-labels.test.ts