Skip to content

fix: remove inert project-level GitHub identity override endpoints/UI (keep DB store) - #936

Closed
sabbour wants to merge 2 commits into
devfrom
fix/remove-project-github-identity-full
Closed

fix: remove inert project-level GitHub identity override endpoints/UI (keep DB store)#936
sabbour wants to merge 2 commits into
devfrom
fix/remove-project-github-identity-full

Conversation

@sabbour

@sabbour sabbour commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

PR 2 from Link's investigation of PR #934: removes the now-inert project-level GitHub identity
override endpoints, service, and frontend calls left behind after #934 removed the runtime
override behavior from CallerTokenScopeProvider/ProjectAuthorization.

Scope update (2026-08-25): a design decision is in progress to repurpose the
project_github_identity_overrides table as a "workflow Copilot owner" store — GitHub App
installation tokens have no Copilot entitlements, so automation runs (scheduled/webhook) still
need a human user's Copilot-entitled token for inference. Per that decision, this PR no longer
deletes
the DB table, the ProjectGitHubIdentityOverrideRecord entity, the
ProjectGitHubIdentityOverrideStore, or its DI registration — those are kept intact for future
reuse. Only the inert HTTP endpoints/service and the dead frontend API calls/types are removed.

Backend

  • Deleted Auth/ProjectGitHubIdentityService.cs and Endpoints/ProjectGitHubIdentityEndpoints.cs.
  • Removed the ProjectGitHubIdentityService DI registration and the
    MapProjectGitHubIdentityEndpoints() call from Program.cs.
    ProjectGitHubIdentityOverrideStore's DI registration is kept.
  • Removed the overrideStore.RemoveOverridesForLinkedLoginAsync(...) call and DI injection from
    LinkedGitHubAccountService.cs (that cleanup was tied to the removed per-request override path).
  • Removed the now-dead UpdateProjectGitHubIdentityRequest/ProjectGitHubIdentityResponse DTOs
    (they only existed to serve the deleted endpoints).
  • Updated docs/reference/api.md to drop the removed endpoint rows.
  • Kept intact: Auth/ProjectGitHubIdentityOverrideStore.cs,
    apps/Agentweaver.Api.Data/Memory/ProjectGitHubIdentityOverrideRecord.cs, the DbSet/model
    config in MemoryDbContext.cs, and the project_github_identity_overrides table (no migration
    to drop it in this PR).

Frontend

  • GitHubSignIn.tsx: the "switch account" UI is unchanged. handleSwitch now unconditionally
    calls setDefaultLinkedGitHubAccount(login) instead of branching on a project-level override;
    removed projectIdentity state and the getProjectGitHubIdentity fetch; currentAccount now
    derives only from linkedAccounts.find(a => a.is_default).
  • ProjectSettingsPage.tsx: removed the "GitHub identity for this project" section,
    handleSaveGitHubIdentityOverride, and related state/effects. General access/role UI is
    unchanged.
  • api/client.ts / api/types.ts: removed getProjectGitHubIdentity,
    setProjectGitHubIdentityOverride, and the ProjectGitHubIdentity type (unused after the above).

Tests

  • LinkedGitHubAccountsApiTests.cs: removed tests exercising the deleted
    /api/projects/{id}/github-identity endpoints (5 tests). Endpoint-independent tests
    (LinkCallback_..., AccessibleRepos_..., UnlinkDefaultAccount_...) are untouched.
  • client.test.ts, GitHubSignIn.test.tsx, ProjectSettingsPage.test.tsx: updated to match the
    frontend changes above; GitHubSignIn.test.tsx now asserts setDefaultLinkedGitHubAccount is
    called when switching accounts.

Verification

  • dotnet build on Agentweaver.Api, Agentweaver.Tests, Agentweaver.Api.Migrations.Postgres — 0 errors.
  • dotnet test --filter "FullyQualifiedName~LinkedGitHubAccountsApiTests|FullyQualifiedName~CallerTokenScopeProviderTests" — 6/6 passed.
  • npm --prefix apps/web run lint — clean.
  • npx vitest run on the 3 affected frontend test files — 27/27 passed.

Changeset

.changeset/remove-project-github-identity-override.md (patch), updated to reflect the reduced scope.

Not merged — awaiting review, per instructions.

Copilot AI added 2 commits August 25, 2026 22:05
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7762866f-fa88-4087-b5df-17f482d36ec0
…endpoints/UI

Design decision: GitHub App installation tokens have no Copilot entitlements, so
automation runs (scheduled/webhook) still need a human user's Copilot-entitled
token. The project_github_identity_overrides table, ProjectGitHubIdentityOverrideRecord
entity, and ProjectGitHubIdentityOverrideStore are kept intact for a future
repurposing as a 'workflow Copilot owner' store, instead of being deleted.

Still removed: the inert ProjectGitHubIdentityService, the GET/PUT
/api/projects/{id}/github-identity endpoints and their DI/mapping, and the dead
frontend getProjectGitHubIdentity/setProjectGitHubIdentityOverride API calls and
types. GitHubSignIn's switch-account UI is unchanged and already used the
per-user default identity API unconditionally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7762866f-fa88-4087-b5df-17f482d36ec0
@sabbour sabbour changed the title fix: remove project-level GitHub identity override (endpoints, DB, UI) fix: remove inert project-level GitHub identity override endpoints/UI (keep DB store) Aug 26, 2026
@sabbour
sabbour marked this pull request as draft August 27, 2026 18:19
@sabbour

sabbour commented Aug 28, 2026

Copy link
Copy Markdown
Owner Author

Closing as superseded by the Fleet cutover. #946 removes the relevant Project Settings controls, and #951 will remove the remaining legacy identity path.

@sabbour sabbour closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants