Skip to content

Persist or resolve the legacy project-access-token bot user ID to a registered GitLab role for ADR 0107 #9063

Open

Description

@fullsend-ai-triage

Context

Part of ADR 0107 bot authorization for GitLab events (parent tracking issue #8329; original scope in #9059). GitLab events are authorized by actor identity. The recorded account IDs in FULLSEND_GITLAB_ROLE_ROTATION (managed_user_id / supplied_user_id, state types in internal/repos) cover service-account roles. The legacy project-access-token fallback has a bot user that is not recorded there, so its events cannot be resolved to a registered role by exact numeric user ID.

What should happen

  • Persist the legacy project-access-token bot's numeric user ID in administrator-controlled installation state, or provide a deterministic trusted way to resolve it to the registered credential role. Do not use repository files, harness files or event/MR content as the source.
  • Where no canonical role is defined for a reused credential, treat the credential as ambiguous. Record that explicitly so the resolver (sibling issue) denies it.
  • Keep the stored data free of secret values, consistent with the existing rotation-state conventions.
  • Preserve the existing install, rotation and uninstall behavior, including exclusions-only handling of supplied accounts.

Acceptance

  • Tests show the legacy bot ID is recorded or resolvable after install and rotation, that ambiguous reuse is flagged, and that uninstall and cleanup behavior is unchanged.
  • Update docs/contributing/gitlab-role-credentials.md and the operations reference for any new state.

Relationships

Blocks the poller wiring sub-issue. Independent of the resolver sub-issue except that the resolver consumes this data.

Activity

  1. added
    ready-for-triage
    on Nov 3, 2026
  2. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage
    Author

    🤖 Finished Triage · ✅ Success · Started 9:48 AM UTC · Completed 9:50 AM UTC

    Commit: c7652ad · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.17

  3. added
    feature
    triaged
    on Nov 3, 2026
  4. fullsend-ai-triage commented on Nov 3, 2026

    @fullsend-ai-triage
    Author

    This issue is ready for implementation. It is one of three sub-issues split from #9059 under #8329, and no open PR addresses it.

    Where the work lands

    • The state type with managed_user_id / supplied_user_id is RoleState in internal/repos/gitlab_roles_rotate.go. It is the natural place for the new data.
    • The legacy fullsend-bot token handling is in internal/repos/gitlab_roles.go and gitlab_roles_cleanup.go. Legacy token creation ownership is tracked separately through created_token_ids.
    • Docs to update: docs/contributing/gitlab-role-credentials.md, plus the operations reference.

    Things to watch

    • Sources of the ID must be the forge API response at install or rotation time. Nothing from repo files, harness files or event content may be used.
    • Several destructive paths (cleanup, uninstall inventories) derive account ownership from the recorded IDs. Recording the legacy bot ID must not make it look like a managed account that cleanup may delete or revoke. Existing behavior that never retires the legacy token should stay unchanged.
    • Older state documents without the new field must still load.

    Related work

    Suggested test case

    Given a repo installed via the legacy project-access-token fallback
    When install and then rotation run
    Then rotation state records the bot's numeric user ID (no secret values)
    And a credential reused without a canonical role is flagged ambiguous
    And supplied accounts remain exclusions-only
    And uninstall/cleanup results are identical to before, with the legacy token not revoked
    And state without the new field still loads
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. self-assigned this
    on Nov 3, 2026
  6. ifireball commented on Nov 3, 2026

    @ifireball
    Member

    /fs-code

  7. fullsend-ai-coder commented on Nov 3, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 10:53 AM UTC · Completed 11:16 AM UTC

    Commit: c7652ad · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $5.61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureready-for-triagetriaged

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions