add better tests for the github permissions#131
Merged
derekmisler merged 1 commit intodocker:mainfrom Apr 15, 2026
Merged
Conversation
Signed-off-by: Derek Misler <derek.misler@docker.com>
derekmisler
commented
Apr 15, 2026
Contributor
Author
There was a problem hiding this comment.
I just reordered these steps in a logical way
derekmisler
commented
Apr 15, 2026
Contributor
Author
There was a problem hiding this comment.
i just renamed this one
derekmisler
commented
Apr 15, 2026
Contributor
Author
There was a problem hiding this comment.
just renamed this one
derekmisler
commented
Apr 15, 2026
Contributor
Author
There was a problem hiding this comment.
i added a separate "integration test" job
derekmisler
commented
Apr 15, 2026
Comment on lines
+4
to
+6
| * Credentials are resolved in order: | ||
| * 1. GITHUB_APP_ID / GITHUB_APP_PRIVATE_KEY env vars (if set) | ||
| * 2. 1Password CLI (`op read`) |
Contributor
Author
There was a problem hiding this comment.
allows me to run them locally, which is nice.
derekmisler
commented
Apr 15, 2026
| issues: 'write', | ||
| pull_requests: 'write', | ||
| statuses: 'write', | ||
| variables: 'read', |
Contributor
Author
There was a problem hiding this comment.
this line was the whole reason for this PR. it's supposed to be action_variables, not variables (even though it's called "Variables" in the GitHub UI). so anyway, i'm just fetching all the permissions from GH and passing them along to this token generation step, so we won't have typos in the future.
krissetto
approved these changes
Apr 15, 2026
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.
Related Issues
Closes: https://github.com/docker/gordon/issues/390
Summary
Fixes GitHub App token generation to dynamically fetch installation permissions instead of hardcoding them, adds comprehensive test coverage for the permissions flow, and restructures CI workflows for better separation of concerns.
Permission handling (
src/app-token.ts)appOctokit.apps.getInstallation()— the token now always reflects what the org has actually granted, so permissions never drift out of sync with the App's settings.Test restructuring
lint-actions.yml— lint, typecheck, and unit tests are consolidated intotest.ymltest-e2e.yml— E2E tests (prompt sanitization, output extraction, job summary, security, exploits, pirate agent, invalid agent) run as a separate workflowvitest.integration.config.ts+pnpm test:integration— integration tests (real GitHub App API calls) are isolated from unit testsapp-token.test.ts— proper mocks for the new installation-permission flow, plus a test that verifies permissions are passed through tocreateAppAuthapp-token.integration.test.ts— live tests that verify App identity resolution, installation permission fetching, and token generation against the real API (credentials via env vars or 1Password CLI)Release workflow (
release.yml)publish-agent→update-self-refs→update-consumers→notifyfor a logical dependency chainnotifynow waits for all post-release jobs and is skipped on pre-releaseAgent model upgrade (
review-pr/agents/pr-review.yaml)sonnetmodel updated fromclaude-sonnet-4-5→claude-sonnet-4-6with 64k max tokenshaikuwithsonnet-thinking(claude-sonnet-4-6 + adaptive/high thinking budget)drafteragent switched tosonnet-thinkingfor better bug hypothesis generationTooling
scripts/debug-permissions.tsfor locally inspecting GitHub App and installation permissionsTip
Comment
/reviewto trigger the PR Reviewer agent for automated feedback.Comment
/describeto generate a PR description.