Repository navigation
refactor(github): one github session per identity (#767) - #1160
Merged
Merged
Conversation
10 tasks
Merged
dan-petty
added a commit
that referenced
this pull request
Oct 4, 2026
* chore(release): open the v0.2.26 cycle (#1106) * feat(release): production service image for scheduled jobs and webhook handlers (#1152) * feat(release): production service image for scheduled jobs and webhook handlers (#753) * fix(ci): add --retry-all-errors to smoke test healthz curl probe * feat(roadmap): agent filing quota specification and pure quota engine (#1153) (#1155) * refactor(ci): ci installs nothing on the runner, and live bubblewrap tests skip (#832) (#1156) * refactor(ci): github ci runs the gate through devops ci (#843) (#1157) * refactor(ci): github ci runs the gate through devops ci (#843) * test(fastmcp): relax in-process latency ceiling to prevent runner flakiness (#843) * feat(telemetry): enhance grafana dashboards for ai spend, cli telemetry, gpus, and sre services (#1158) (#1159) * refactor(github): one github session per identity (#767) (#1160) * feat(roadmap): roadmap intake files and refines candidates through the model and the board (#742) (#1163) * feat(ci): select tests from on-demand coverage reverse index (#406) (#1162) - Add --build-index option to devops ci coverage to generate a per-worktree coverage index (coverage_index.json) using COVERAGE_CORE=ctrace and --cov-context=test. - Build the index atomically after clean passing runs, aborting if files mutate during execution. - Collapse contexts in SQL and memoize source file path normalization. - Select covering tests in devops ci test from the reverse coverage index, reconciling worktree drift against recorded blob hashes. - Fall back per source to text-based selection when missing from index. - Force full test run when trigger files (conftest.py, pyproject.toml, uv.lock, .python-version) change, exiting 1 with --no-fallback. - Map non-test helper modules under tests/ to importing tests, never passing the helper module directly to pytest. - Update documentation and changelog fragment changelog.d/406.md. * feat(k8s): devops-cli runs in the cluster as jobs, and every cluster secret is pushed from the keyring (#741) (#1161) * fix(release): one fail-closed release path (#982) (#1164) * fix(github): github writes are paced from the request gh sends, and board reads stay within the graphql budget (#1125) (#1166) * fix(github): github writes are paced from the request gh sends, and board reads stay within the graphql budget (#1125) * test(release): the offline uv lock check names its interpreter, so it passes on a runner without Python 3.14 on PATH (#1125) * feat(cli): extend the ruff rule set to the correctness families (#420) (#1167) * feat(cli): extend the ruff rule set to the correctness families (#420) * fix(tests): move None to end of type union in test_roadmap_board_read (RUF036) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(security): network references come from url and host arguments, not inspection of every string (#431) (#1168) - Replace heuristic bare-word and domain string inspection with a strict two-element definition: a URL with a host in any scheme (urllib.parse.urlsplit) or an IP literal (ipaddress). - Eliminate heuristic constants and shims: CONST_BRANCH_PREFIXES, CONST_CODE_CONFIG_PREFIXES, CONST_COMMON_PROPERTY_SUFFIXES, CONST_TELEMETRY_CALL_NAMES, CONST_STANDARD_RECEIVER_IDENTIFIERS, CONST_EXCLUDED_FILE_MIME_TYPES. - Delete dead extraction routines, visitors, and shims in devops_cli.security.reference_extractor. - Simplify Python AST walk to directly append all string constants to literals without false-positive domain leakage. - Replace package repository asset checks with is_trusted_registry_host(host: str) -> bool matching CONST_EXCLUDED_PUBLIC_REGISTRIES. - Consolidate reference types strictly to 'url' and 'ip', eliminating legacy 'domain' reference categorization across models, extractors, and table formatters. - Add comprehensive test suite with structural tuple assertions covering DNS safety, bare word rejection, multi-scheme URLs, registry filtering, and literal extraction. * fix(k8s): pod logs reach loki once and labelled, without duplicate scraping (#548) (#1169) * feat(release): item closure summaries and automatic release cut with devops roadmap close (#743) (#1170) * feat(cli): service mode for devops serve with github webhook verification and per-repo queue (#752) (#1171) * feat(k8s): the roadmap service runs in the cluster's devops namespace, reachable from outside only on /webhooks/github (#1083) (#1172) * feat(roadmap): job scheduling, due table evaluation, and checkout management with devops roadmap run (#981) (#1173) * feat(ai): item refinement to ready with proposed design, tasks and acceptance criteria (#744) (#1177) * fix(telemetry): grafana dashboard projections, rolling averages, and panel queries (#1175) (#1176) * feat(release): v0.2.26 * fix(ci): patch debian base packages and drop unused pip from service runtime * fix(release): resolve review feedback on checkout, secret audit, service drain, dependabot, and changelog * fix(roadmap): enforce strict repository slug validation and path containment in checkout and schedule paths * fix(release): sanitize log & error details, update dependabot branch, atomic state write, and canonical instructions --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Merged
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.
Closes #767 (Part A; Part B is #983)
Summary
A process now has one GitHub identity. The token used to come from five places, so one
GitHubClientcould act as the keyring's token through PyGithub and as gh's login throughrun_gh.core/process.py): the first GitHub call runsgh auth tokenonce, with a 5 s timeout. gh appliesGH_TOKEN, thenGITHUB_TOKEN, then its stored login, so a terminal acts as the person and the service acts as the machine account whose token feat(k8s): devops-cli runs in the homelab cluster as Jobs, and every cluster Secret is pushed from the keyring, also by deploy-stack (devops k8s push-secrets, devops k8s run-job) #741's Secret sets. A found token is kept for the life of the process. A failed lookup is not kept: the next gh call looks again, and git looks again after 60 s. With no token, a gh call raisesGitHubUnauthenticatedError(GITHUB_UNAUTHENTICATED). Nothing falls back to another token.GH_TOKENset to that token and noGITHUB_TOKEN. This also covers gh calls that bypassrun_gh.gh auth, version, help) get the environment's tokens unchanged.github/session.py): holds the token,login(GET /user, read once), the identity's cache directory and the one PyGithub client.repos,review,analyze, SSH key registration anddevops ghuse it.<data dir>/cache/<16 hex of the token's SHA-256>/, so one identity's cached reads never reach another. No path or log line holds a token or a login.github.tokenoption and its keyring entry,DEVOPS_CLI_GITHUB_TOKEN,config init's PAT prompt,_inject_gh_credentials, and the unused GraphQL client with its models, queries, token bucket and ETag cache.devops config audit-keysstill flags a plaintext token left undergithub:. Everydevops ghcommand reports the unauthenticated error and exits 1, without a traceback.Decisions to note
git commitseeGH_TOKEN. gh's credential helper would keep the token out of git's environment. But the helper reads gh's login when git asks for credentials, so agh auth loginduring a run would switch git's identity while gh keeps the pinned one, which is the split this item removes. No common command pays for the lookup:devops --help,version,config showandci --helpnever rungh auth token.gh auth tokenprints anyGH_TOKENit is given, so the lookup succeeds and GitHub's 401 to the first call is reported as a rate-limit refresh failure. Classifying a 401 as unauthenticated belongs to refactor(github): the github session owns transport, ledger, error classes and link pagination #983's error classes. The task file's third person check states what prints.Upgrade step
Run
gh auth login, thenkeyring del devops-cli github_tokenand revoke that token.Tests
tests/test_github_session.py(new) covers one identity across PyGithub, gh and the quota refresh; no fallback; the per-identity cache; and that PyGithub is built only by the session.tests/test_subprocess_env_boundary.pycovers the pin, thegh authexemption (14 cases), retries after a failed lookup, and git without a login.gh auth token.Pending a person
Three checks in the task file, run from a terminal logged in to gh:
devops gh issues listprints the open issues.devops gh milestones listprints the milestones.GH_TOKEN, the command exits 1 with the 401 message.