Repository navigation
feat: generate RBAC scope name constants - #19896
Merged
ThomasK33 merged 1 commit intoSep 24, 2025
Merged
Conversation
This was referenced Sep 19, 2025
Member
Author
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 19, 2025 18:48
efb80b5 to
0dadef5
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 19, 2025 18:50
1d5d9f1 to
ce47b02
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
2 times, most recently
from
September 22, 2025 13:47
0149b55 to
6de9975
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 22, 2025 13:47
ce47b02 to
37f92fe
Compare
ThomasK33
marked this pull request as ready for review
September 22, 2025 13:50
This was referenced Sep 22, 2025
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 22, 2025 15:28
6de9975 to
99afbd9
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
2 times, most recently
from
September 22, 2025 16:33
9c60b1f to
2666417
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
2 times, most recently
from
September 22, 2025 17:03
6a22bcc to
2dc79e0
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
3 times, most recently
from
September 22, 2025 17:27
3a1adbe to
9d2bcc2
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 22, 2025 17:27
2dc79e0 to
92537e5
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 22, 2025 17:42
9d2bcc2 to
ec7f46a
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
2 times, most recently
from
September 23, 2025 08:53
4810c5e to
6d04e1c
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 23, 2025 08:53
ec7f46a to
0fb96eb
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 23, 2025 20:53
6d04e1c to
49feb2d
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 23, 2025 20:54
0fb96eb to
0d6db42
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 24, 2025 08:36
0d6db42 to
e0432eb
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 24, 2025 08:36
49feb2d to
a9ec515
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 24, 2025 08:58
e0432eb to
b4b6ef1
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 24, 2025 08:58
a9ec515 to
316bcd9
Compare
ThomasK33
force-pushed
the
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
branch
from
September 24, 2025 12:51
b4b6ef1 to
cfd4f7f
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 24, 2025 12:51
316bcd9 to
2dd3612
Compare
This was referenced Sep 24, 2025
Emyrk
approved these changes
Sep 24, 2025
ThomasK33
changed the base branch from
thomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes
to
graphite-base/19896
September 24, 2025 16:06
ThomasK33
force-pushed
the
graphite-base/19896
branch
from
September 24, 2025 16:06
cfd4f7f to
acc0890
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 24, 2025 16:06
2dd3612 to
eddb2a7
Compare
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
2 times, most recently
from
September 24, 2025 16:09
ab8574e to
cffaa05
Compare
Add build-time generation of typed Go constants for all RBAC scope names to improve type safety and prevent typos when referencing scopes in code. - Add scopenames.gotmpl template for generating ScopeName constants - Extend scripts/typegen/main.go to support "scopenames" template - Generate coderd/rbac/scopes_constants_gen.go with all typed constants - Update Makefile to include generated file in build targets - Constants follow pattern Scope<Resource><Action> = "resource:action"
ThomasK33
force-pushed
the
thomask33/09-19-feat_add_scope_constants_generation
branch
from
September 24, 2025 16:27
cffaa05 to
84de60e
Compare
ThomasK33
deleted the
thomask33/09-19-feat_add_scope_constants_generation
branch
September 24, 2025 16:40
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Generate RBAC scope name constants
This PR adds a new generated file
coderd/rbac/scopes_constants_gen.gothat contains typed constants for all RBAC scope names in the formatScope<Resource><Action>. For example,ScopeWorkspaceReadfor the scope "workspace:read".These constants make it easier to reference specific scopes in code without using string literals, improving type safety and making refactoring easier.
The PR:
scripts/typegen/scopenames.gotmpl