Repository navigation
Defer --attach credential checks to the server - #14805
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 664e416d-0c36-420b-a93c-dbfd8ff83769
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused behavior change is consistently applied across callers, with regression coverage for empty permissions and retained validation checks, and no unresolved blocking findings.
No open issues 🎉
What changed in this PR
This PR follows #14804 by letting the upload endpoint decide whether credentials can attach files, including GitHub App installation tokens with no GraphQL viewerPermission.
Changes:
- Removes token-type checks and allows empty permissions while retaining host, repository ID, and known insufficient-permission checks.
- Updates issue, pull request, and artifact callers, removing configuration dependencies used only for token checks.
- Adjusts tests and documentation for server-side credential validation.
| File | Description |
|---|---|
| skills/gh/SKILL.md | Documents endpoint-controlled GitHub App support. |
| pkg/cmd/pr/shared/commentable.go | Removes token lookup from shared comment uploads. |
| pkg/cmd/pr/shared/commentable_test.go | Covers empty permissions and upload host selection. |
| pkg/cmd/pr/edit/edit.go | Updates uploader construction and removes unused configuration wiring. |
| pkg/cmd/pr/edit/edit_test.go | Updates permission and host regression cases. |
| pkg/cmd/pr/create/create.go | Removes attachment token preflight checks. |
| pkg/cmd/pr/create/create_test.go | Removes token fixtures and obsolete rejection coverage. |
| pkg/cmd/pr/comment/comment.go | Removes attachment-only configuration wiring. |
| pkg/cmd/pr/comment/comment_test.go | Removes the obsolete configuration assertion. |
| pkg/cmd/issue/edit/edit.go | Updates uploader construction and removes unused configuration wiring. |
| pkg/cmd/issue/edit/edit_test.go | Removes token fixtures while retaining host coverage. |
| pkg/cmd/issue/create/create.go | Removes attachment token lookup and configuration wiring. |
| pkg/cmd/issue/create/create_test.go | Removes attachment token configuration fixtures. |
| pkg/cmd/issue/comment/comment.go | Removes attachment-only configuration wiring. |
| pkg/cmd/issue/comment/comment_test.go | Removes the obsolete configuration assertion. |
| pkg/cmd/issue/artifact/shared/shared.go | Simplifies the shared uploader helper signature. |
| pkg/cmd/issue/artifact/shared/shared_test.go | Updates helper tests for the simplified signature. |
| pkg/cmd/issue/artifact/edit/edit.go | Removes configuration plumbing from artifact uploads. |
| pkg/cmd/issue/artifact/edit/edit_test.go | Removes obsolete token checks and fixtures. |
| pkg/cmd/issue/artifact/create/create.go | Uses the simplified artifact uploader helper. |
| pkg/cmd/issue/artifact/create/create_test.go | Removes obsolete token checks and fixtures. |
| internal/config/config.go | Adds a comment noting ActiveTokenType is unused. |
| internal/attachments/doc.go | Updates preflight guidance and the constructor example. |
| internal/attachments/client.go | Removes token allowlisting and permits empty permissions. |
| internal/attachments/client_test.go | Updates constructor coverage and retains validation cases. |
Review effort: Balanced
tidy-dev
approved these changes
Oct 23, 2026
1 task
This was referenced Oct 24, 2026
well-prado
added a commit
to obi-ai-bot/oby
that referenced
this pull request
Oct 24, 2026
…iewer; no merge without a check (#853, #854) Review of #1393: - Approvals come from GET …/pulls/{n}/reviews, every page: gh's latestReviews has no commit for an approval (cli/cli#14805). Each reviewer's latest review that counts; a comment or a pending review never hides a change request. - An approval counts only from OWNER, MEMBER or COLLABORATOR, never a bot or the author, and as the workflow's `review` says: `reviewer` needs Oby's reviewer account itself (and needs you while it's signed out), `teammate` and `person` anyone but it. An unknown author stops it. - `checks: none` is gone: nothing merges without a check that passed on the head. - With `merge` or `rebase`, a commit that closes an issue needs you. - merge() builds home/tmp/merge-<job id> itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
well-prado
added a commit
to obi-ai-bot/oby
that referenced
this pull request
Oct 24, 2026
…iewer; no merge without a check (#853, #854) Review of #1393: - Approvals come from GET …/pulls/{n}/reviews, every page: gh's latestReviews has no commit for an approval (cli/cli#14805). Each reviewer's latest review that counts; a comment or a pending review never hides a change request. - An approval counts only from OWNER, MEMBER or COLLABORATOR, never a bot or the author, and as the workflow's `review` says: `reviewer` needs Oby's reviewer account itself (and needs you while it's signed out), `teammate` and `person` anyone but it. An unknown author stops it. - `checks: none` is gone: nothing merges without a check that passed on the head. - With `merge` or `rebase`, a commit that closes an issue needs you. - merge() builds home/tmp/merge-<job id> itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
well-prado
added a commit
to obi-ai-bot/oby
that referenced
this pull request
Oct 24, 2026
…iewer; no merge without a check (#853, #854) Review of #1393: - Approvals come from GET …/pulls/{n}/reviews, every page: gh's latestReviews has no commit for an approval (cli/cli#14805). Each reviewer's latest review that counts; a comment or a pending review never hides a change request. - An approval counts only from OWNER, MEMBER or COLLABORATOR, never a bot or the author, and as the workflow's `review` says: `reviewer` needs Oby's reviewer account itself (and needs you while it's signed out), `teammate` and `person` anyone but it. An unknown author stops it. - `checks: none` is gone: nothing merges without a check that passed on the head. - With `merge` or `rebase`, a commit that closes an issue needs you. - merge() builds home/tmp/merge-<job id> itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
well-prado
added a commit
to obi-ai-bot/oby
that referenced
this pull request
Oct 24, 2026
…kflow, typed (#853, #854) (#1393) * feat(obid): a merge engine that follows each repository's learned workflow, typed (#853, #854) merge.rs, ported from Engine/Checks.swift: `ready` says whether a job's pull request may merge by its repository's workflow, or why not (needs the owner only where Oby can't go on by itself); `merge` reads it again, checks every rule, writes Oby's own squash words, scans them, merges at the head it checked and deletes only the job's own oby/ branch; `wanted_approval` says whose approval it waits on, for the reviewer account (X1) and a teammate's Oby (X5). Never into main, master or trunk; the default branch only when the workflow names it. memory.rs: a typed `workflow` memory ({base, method, rebaseFirst, review, checks}), saved only by the owner's Remember on its own "Can I remember that?" (`ask_workflow`), read back with `memory::workflow`. Free text never drives a merge. github.rs: the follower's gh pr view also asks for the head's checks, mergeable, mergeStateStatus, the latest reviews and the author (`view_merging`, `Merging`). job.rs: mergeError, mergeNeedsYou and mergedBy come from the job. Nothing calls the merge yet: the follower's wiring comes next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(obid): approvals from the REST API, matched to the workflow's reviewer; no merge without a check (#853, #854) Review of #1393: - Approvals come from GET …/pulls/{n}/reviews, every page: gh's latestReviews has no commit for an approval (cli/cli#14805). Each reviewer's latest review that counts; a comment or a pending review never hides a change request. - An approval counts only from OWNER, MEMBER or COLLABORATOR, never a bot or the author, and as the workflow's `review` says: `reviewer` needs Oby's reviewer account itself (and needs you while it's signed out), `teammate` and `person` anyone but it. An unknown author stops it. - `checks: none` is gone: nothing merges without a check that passed on the head. - With `merge` or `rebase`, a commit that closes an issue needs you. - merge() builds home/tmp/merge-<job id> itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(obid): a reviewer account Oby ever used never passes for a teammate; unknown reviewers merge nothing (#853, #854) Review of #1393, round 2: - Every reviewer login Oby uses is kept for good in home/github/reviewers.json (0600): `merge::note_reviewer`, for keep_reviewer to call on sign-in, and `merge::reviewers`, which notes the one signed in now. For `teammate` and `person`, an approval from any of them never counts, signed in or not. - `ready` takes the reviewers or none: when they can't be read, nothing merges, whoever approved it. - The reviews are read again right before the PUT, so a change request made during the scan stops it. - The commits are read on every page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(obid): a reviewer is recorded when it signs in, and a merge or rebase past 250 commits waits for you (#853, #854) Review of #1393, round 3: - github_login's keep_reviewer keeps the reviewer's login for good (merge::note_reviewer) before its login is kept, and a login it can't record keeps nothing: a reviewer that approves and signs out before any merge runs is still known, so its approval never passes for a teammate's. - GitHub lists at most 250 commits of a pull request: past that, a merge or rebase method can't be checked for closing keywords, so it needs the owner; a squash goes ahead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 task
9 tasks
1 task
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.
Follows #14804
Description
Before it uploads anything,
--attachchecks the token type and refuses an emptyviewerPermission. GraphQL returns noviewerPermissionfor GitHub App installation tokens, so those tokens still stop here even though their token type is now allowed.This drops the token check and lets an empty permission through, so the upload endpoint decides. A known
READorTRIAGEpermission still fails before anything uploads.How did you test this change?
Not tested. Exercising the new path needs an installation token from a GitHub App the upload endpoint accepts.
Key points
ghreports the endpoint's 404 asattaching files requires write access to the repository.unsupported authentication typeandcould not determine your permission on the repository to attach fileserrors are gone.Configoptions that only fed the token check are removed.ActiveTokenTypestays, but is currently unused.Notes for reviewers
Start with
NewUploader. The rest is call-site and test cleanup.Authorship and follow-up
Who wrote this:
Who answers review comments: