fix(review): derive four hardcoded gittensory literals from their config (#4615) - #4663
Merged
Conversation
…fig (#4615) Small, independent hardcoding cleanups found by the review-stack architecture audit: isOwnReviewThreadAuthor now derives its own-bot match from GITHUB_APP_SLUG instead of a literal "gittensory" regex, matching every other self-authorship check in the codebase; isProtectedAutomationAuthor gains an additive PROTECTED_AUTOCLOSE_AUTHORS_EXTRA env override for a self-hoster running a different automation stack; the Orb OAuth landing page's dashboard link now follows PUBLIC_SITE_ORIGIN (falling back to the public dashboard), mirroring maintainerControlPanelUrl one file-family over; and the OAuth returnTo allowlist drops a redundant hardcoded cloud origin entry that was dead weight once a self-hoster sets their own PUBLIC_SITE_ORIGIN.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4663 +/- ##
=======================================
Coverage 94.12% 94.13%
=======================================
Files 434 434
Lines 38546 38554 +8
Branches 14050 14053 +3
=======================================
+ Hits 36283 36291 +8
Misses 1604 1604
Partials 659 659
🚀 New features to boost your workflow:
|
5 tasks
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
isOwnReviewThreadAuthor(src/github/backfill.ts) now derives its own-bot match fromenv.GITHUB_APP_SLUGinstead of a hardcodedgittensoryregex — matching every other self-authorship check in the codebase (self-authored.ts,pr-actions.ts,comments.ts,processors.ts), so a self-hoster who renames their App still recognizes its own review-thread comments.isProtectedAutomationAuthor(src/settings/agent-actions.ts) gains an additivePROTECTED_AUTOCLOSE_AUTHORS_EXTRAenv override so a self-hoster running a different automation stack (mergify[bot], snyk-bot, ...) can extend the built-in allowlist without forking the code.src/orb/oauth.ts) now followsenv.PUBLIC_SITE_ORIGIN, falling back to the public gittensory dashboard — mirroringmaintainerControlPanelUrlone file-family over (github/footer.ts). The Orb App's centrally-hosted key-broker design is unchanged; only this post-OAuth "open the dashboard" link becomes configurable.normalizeReturnTo's OAuthreturnToallowlist (src/auth/github-oauth.ts) drops the redundant hardcodedhttps://gittensory.aethereal.deventry —siteOriginalready equals that value wheneverPUBLIC_SITE_ORIGINis unset, so the literal was only ever adding a bonus accepted origin for a self-hoster who had set their own.packages/gittensory-engine/src/signals/local-branch.ts, thegittensory_not_registeredself-referential advisory finding) is deferred: the issue's cited path doesn't match currentmain— that code actually lives atsrc/signals/local-branch.tsand is not part of what's bundled into any published npm package today (the separately-maintainedpackages/gittensory-mcp/lib/local-branch.jsis a different, smaller file with no such literal). The issue itself frames this item as the lowest-priority, no-config-path judgment call; given the path mismatch and no functional win from deduplicating the literal today, it's left as-is.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Fixes #4615
Validation
git diff --checknpm run actionlintnpm run typecheckvitest run --coverageon the four changed suites (test/unit/backfill.test.ts,test/unit/agent-actions.test.ts,test/unit/auth.test.ts,test/integration/orb-oauth.test.ts) scoped tosrc/github/backfill.ts,src/settings/agent-actions.ts,src/auth/github-oauth.ts,src/orb/oauth.ts— 540 tests passing, no uncovered lines on any changed diff line.npm run test:coverage(full unsharded)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/github,src/settings,src/orb,src/auth; noapps/gittensory-ui/**,packages/gittensory-mcp/**,test/workers/**, orwrangler.jsoncpaths are touched, so the UI/MCP/workers/full-coverage jobs are left to CI's own (path-filtered) run rather than re-run locally here —db:migrations:check,db:schema-drift:check,cf-typegen:check, andselfhost:env-reference:checkwere also run locally and are clean/unaffected.Safety
Notes
mainimmediately before pushing (picked up the concurrently-merged Make trusted-scanner-bot allowlist configurable #4614TRUSTED_SCANNER_BOT_LOGINSchange in the same file/function neighborhood; resolved cleanly, both changes coexist).