Title: Build-time check: DB enum contains all RBAC scopes · Issue #19846 · coder/coder · GitHub
Open Graph Title: Build-time check: DB enum contains all RBAC scopes · Issue #19846 · coder/coder
X Title: Build-time check: DB enum contains all RBAC scopes · Issue #19846 · coder/coder
Description: Description Add a build-time script that compiles the list of all available
Open Graph Description: Description Add a build-time script that compiles the list of all available
X Description: Description Add a build-time script that compiles the list of all available <resource>:<action> mappings from policy.RBACPermissions and verifies each exists in the api_key_scope enum i...
Opengraph URL: https://github.com/coder/coder/issues/19846
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Build-time check: DB enum contains all RBAC scopes","articleBody":"Description\n\n- Add a build-time script that compiles the list of all available `\u003cresource>:\u003caction>` mappings from `policy.RBACPermissions` and verifies each exists in the `api_key_scope` enum in `coderd/database/dump.sql`.\n- If all are present, exit 0. If any are missing, exit 1 and print a clear message:\n - Which scopes are missing.\n - Instruct to add a DB migration to extend the `api_key_scope` enum with those values.\n - Remind to decide whether each new scope is public (exposed in the catalog) or internal-only.\n- Implement immediately after DB migrations are in place, so CI fails fast when RBAC evolves.\n\nKey files/areas\n\n- `coderd/rbac/policy/policy.go` (source for `\u003cresource>:\u003caction>` list via `RBACPermissions`).\n- `coderd/database/dump.sql` (authoritative enum definition used by sqlc and migrations).\n- New script/tool (e.g., `tools/check-scopes/` Go cmd or `scripts/check_scopes.go`).\n- CI/Makefile integration (e.g., `make check-scopes` and include in `make lint` or PR checks).\n\nAcceptance criteria\n\n- Running the check locally and in CI passes when enum includes all current RBAC `\u003cresource>:\u003caction>` values.\n- When RBACPermissions gains a new action or resource, the check fails with actionable output until a migration adds the enum value and a decision is made regarding public catalog exposure.\n- Document how to run/fix in `CONTRIBUTING.md` or a short `README` in the tool directory.","author":{"url":"https://github.com/ThomasK33","@type":"Person","name":"ThomasK33"},"datePublished":"2025-09-17T13:59:41Z","url":"https://github.com/coder/coder/issues/19846"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b109146d-c957-06af-b1a9-589b77b01e1f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB72:1AE20C:22C6E82:2BFDEC7:6B017739 |
| html-safe-nonce | 601b7251070a462b8057199c699e29252399b983fdb463f6af198f140dc9a8db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjcyOjFBRTIwQzoyMkM2RTgyOjJCRkRFQzc6NkIwMTc3MzkiLCJ2aXNpdG9yX2lkIjoiNDc3MTAwMDc4ODMyMTQwMDYzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 675534d3626c16e77737e9e78169173f24e7624598bfa791dd92a3a0096615bb |
| hovercard-subject-tag | issue:3426443059 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/19846/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a927b4fbafed589f8d8b1f942ffaf414d7f0fb6363da30d666b5b2fd34d6482b/coder/coder/issues/19846 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a927b4fbafed589f8d8b1f942ffaf414d7f0fb6363da30d666b5b2fd34d6482b/coder/coder/issues/19846 |
| og:image:alt | Description Add a build-time script that compiles the list of all available |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ThomasK33 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width