Skip to content

refactor: rename "coder" role to "code"#1815

Open
ggallen wants to merge 1 commit into
fullsend-ai:mainfrom
ggallen:refactor/rename-coder-to-code
Open

refactor: rename "coder" role to "code"#1815
ggallen wants to merge 1 commit into
fullsend-ai:mainfrom
ggallen:refactor/rename-coder-to-code

Conversation

@ggallen
Copy link
Copy Markdown
Contributor

@ggallen ggallen commented Jun 2, 2026

Summary

  • Renames the coder agent role to code across the entire codebase (42 files, +365/-365)
  • The role name now matches the stage name — no more code stage mapping to coder role indirection
  • All stage/role names are now consistent: triage, code, review, fix, retro, prioritize, fullsend

⚠️ BREAKING: GitHub App rename required at release time

This PR changes the role name used in ROLE_APP_IDS, Secret Manager secret names, and GitHub App slug resolution. When this is released, the following infrastructure changes must be coordinated or token minting will break:

Resource Before After
GitHub App slug fullsend-ai-coder fullsend-ai-code
GitHub App bot login fullsend-ai-coder[bot] fullsend-ai-code[bot]
ROLE_APP_IDS key {org}/coder {org}/code
Secret Manager secret fullsend-{org}--coder-app-pem fullsend-{org}--code-app-pem
Mint rolePermissions key "coder" "code"

If the GitHub App is not renamed before deploying this change, fullsend mint enroll and the code/fix stage workflows will fail because the CLI will look up fullsend-ai-code (which won't exist) and the mint will have no rolePermissions entry for coder.

Recommended deployment sequence

  1. Rename the GitHub App fullsend-ai-coderfullsend-ai-code (Settings → General → App name)
  2. Create a new Secret Manager secret fullsend-{org}--code-app-pem with the same PEM (or rename)
  3. Update the deployed mint's ROLE_APP_IDS env var: change {org}/coder keys to {org}/code
  4. Merge and release this PR
  5. Re-run fullsend mint deploy to deploy the updated mint with the new rolePermissions

What changed

Core definitions:

  • internal/config/config.goValidRoles(), DefaultAgentRoles(), PerRepoDefaultRoles()
  • internal/forge/github/types.goDefaultAgentRoles(), AgentAppConfig() switch case
  • internal/cli/mint.goroleAlias map ("fix": "code"), comments
  • internal/mint/main.gorolePermissions map key

Workflows:

  • .github/workflows/reusable-code.yml — step name + role: code
  • .github/workflows/reusable-fix.yml — step name + role: code
  • .github/workflows/reusable-dispatch.ymlSTAGE_ROLE="code"
  • .github/actions/mint-token/action.yml — description

Scaffold templates:

  • internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml
  • internal/scaffold/fullsend-repo/scripts/pre-code.shCODE_BOT_LOGIN
  • internal/scaffold/fullsend-repo/scripts/pre-code-test.sh — test data + test names

Documentation & ADRs:

  • docs/guides/infrastructure/infrastructure-reference.md — role permissions table, example request
  • docs/guides/user/customizing-agents.md — role/app mapping table
  • docs/guides/getting-started/github-setup.md — app links, --agents default
  • docs/guides/getting-started/installation.md — app set examples
  • 8 additional docs/ADR files

Embeds:

  • internal/dispatch/gcf/mintsrc/main.go.embed — synced from main.go

Tests (10 files, ~200 lines):

  • All test data updated: role strings, ROLE_APP_IDS JSON, PEM filenames, app slugs, secret names

Test plan

  • go test ./... — all unit tests pass
  • go vet ./... — clean
  • Pre-commit hooks pass (shellcheck, go vet, ADR linters, markdown link linter)
  • grep -rn '\bcoder\b' internal/ .github/ docs/ e2e/ — no remaining references (excluding Decoder/Encoder)
  • fullsend mint deploy on a test project after GitHub App rename
  • Verify code and fix stage workflows mint tokens successfully

🤖 Generated with Claude Code

The agent role was named "coder" but the corresponding stage name is
"code". This eliminates the indirection — the role name now matches the
stage name (triage, code, review, fix, retro, prioritize, fullsend).

Renames in:
- Core role definitions (config.go, types.go, mint.go roleAlias)
- Mint rolePermissions map and embed
- GitHub Actions workflows (reusable-code, reusable-fix, reusable-dispatch)
- Scaffold templates (dispatch.yml, pre-code.sh, pre-code-test.sh)
- Documentation and ADRs
- All test files (~200 lines across 10 files)
- Agent icon filename (coder.png → code.png)

Signed-off-by: Greg Allen <gallen@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Greg Allen <gallen@redhat.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Site preview

Preview: https://18735838-site.fullsend-ai.workers.dev

Commit: 407a0eddd5b55e8726a3a3ab252d12e68b0606ef

@fullsend-ai-review
Copy link
Copy Markdown

Review

Findings

High

  • [incomplete-rename] hack/setup-new-e2e-org.sh:13 — The ROLES array still contains coder instead of code. This script provisions e2e test orgs and will create apps/enroll with the old role name, causing mismatches with the updated codebase.
    Remediation: Change ROLES=(fullsend triage coder review retro prioritize) to ROLES=(fullsend triage code review retro prioritize).

  • [incomplete-rename] web/admin/src/lib/layers/orgConfigParse.ts:16 — The VALID_ROLES set hard-codes "coder" and error messages on lines 185 and 190 reference coder. After this PR, the admin web UI will reject "code" as an invalid role while still accepting the old "coder" name — the opposite of the intended behavior.
    Remediation: Update the VALID_ROLES set and error messages to use "code" instead of "coder".

  • [incomplete-rename] skills/mint-enroll/SKILL.md — Contains ~15 references to coder throughout (role tables, environment variable examples, PEM handling logic, fix→coder aliasing). This skill guides the fullsend mint enroll process and will produce incorrect instructions after the rename.
    Remediation: Update all coder references to code throughout the file.

  • [protected-path] .github/actions/mint-token/action.yml, .github/workflows/reusable-code.yml, .github/workflows/reusable-dispatch.yml, .github/workflows/reusable-fix.yml — These files are under .github/ (a protected path). The PR has no linked issue. Human approval is required for all protected-path changes regardless of context.

Medium

  • [breaking-api] internal/mint/main.go:775, internal/config/config.go:58 — The role rename is a breaking change with no backward compatibility code. The mint's rolePermissions map, Secret Manager secret naming (fullsend-{org}--coder-app-pemfullsend-{org}--code-app-pem), and ROLE_APP_IDS env var keys all change without fallback logic. While the PR documents a deployment sequence, there is no code-level migration support (e.g., accepting both "coder" and "code" during a transition window). Any timing mismatch between the code deploy and infrastructure updates will cause 403 errors.
    See also: [incomplete-rename] findings at web/admin/ and skills/mint-enroll/.

  • [misleading-label] PR title uses refactor: prefix, but this is a breaking change affecting GitHub App names, token minting, and all existing installations. Per AGENTS.md, GoReleaser parses commit prefixes to build release notes — refactor implies no user-facing impact and will not flag this as a breaking change in release notes.
    Remediation: Use feat!: rename "coder" role to "code" or add a BREAKING CHANGE: footer per Conventional Commits spec.

Low

  • [incomplete-rename] web/admin/src/lib/layers/secrets.test.ts:22-23 — Test references to "coder" role in secretNameForRole and variableNameForRole calls not updated.

  • [missing-authorization] No linked issue for a breaking change that affects all existing deployments. The decision to rename should be traceable to an issue documenting the rationale and migration strategy.

Copy link
Copy Markdown

@fullsend-ai-review fullsend-ai-review Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

Comment thread internal/mint/main.go
var rolePermissions = map[string]map[string]string{
"triage": {"contents": "read", "issues": "write", "metadata": "read"},
"coder": {"contents": "write", "pull_requests": "write", "issues": "write", "checks": "read", "metadata": "read"},
"code": {"contents": "write", "pull_requests": "write", "issues": "write", "checks": "read", "metadata": "read"},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] breaking-api

The role rename is a breaking change with no backward compatibility code. The mint rolePermissions map, Secret Manager secret naming, and ROLE_APP_IDS env var keys all change without fallback logic. Any timing mismatch between code deploy and infrastructure updates will cause 403 errors.

Copy link
Copy Markdown
Contributor

@rh-hemartin rh-hemartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM remember to coordinate with knows which are the infrastructure changes and how to do them.

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.

3 participants