refactor(controlplane): publish usercontext/entities under pkg/ - #3329
Open
jiparis wants to merge 1 commit into
Open
refactor(controlplane): publish usercontext/entities under pkg/#3329jiparis wants to merge 1 commit into
jiparis wants to merge 1 commit into
Conversation
jiparis
marked this pull request as ready for review
August 5, 2026 13:00
Contributor
Security Checks —
|
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | pr-description-required |
- |
pr-user-story-linked |
PR/MR #3329 does not reference a user story or issue in title, description, or branch 'refactor(controlplane): publish usercontext/entities under pkg/'. Expected patterns: ["[A-Z]+-[0-9]+", "#[0-9]+", "[A-Z]{2", "}-[0-9]+", "gh-[0-9]+", "\[[A-Z]+-[0-9]+\]"] |
⏭️ 3 scans not applied
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
iac-scan |
no IaC files changed |
Powered by Chainloop and Chainloop Trace
The identity context helpers (CurrentUser, CurrentAPIToken, CurrentOrg, CurrentMembership) lived under app/controlplane/internal/, yet the public app/controlplane/pkg/biz depends on them: AuditorUseCase.Dispatch resolves the audit actor from those context values. Downstream modules that embed pkg/biz therefore cannot populate the actor, and every audit entry that requires one is dropped with "failed to get actor information". Move the package to app/controlplane/pkg/usercontext/entities so it is importable by those consumers. Import-path change only, no behaviour change. Signed-off-by: Jose I. Paris <jiparis@chainloop.dev> Chainloop-Trace-Sessions: e6906bba-e9a1-468f-8d04-e3fe7ae231df Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
jiparis
force-pushed
the
jiparis/pfm-6890-publish-usercontext-entities
branch
from
August 5, 2026 13:06
43043e0 to
a937223
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The identity context helpers (
CurrentUser,CurrentAPIToken,CurrentOrg,CurrentMembership) live underapp/controlplane/internal/, yet the publicapp/controlplane/pkg/bizdepends on them:AuditorUseCase.Dispatchresolves the audit actor from those context values.Modules that embed
pkg/biztherefore cannot populate the actor — Go's internal rule blocks the import, and the context keys are unexported empty structs so they cannot be set any other way. The result is that every audit entry whoseRequiresActor()is true gets dropped withfailed to get actor information, and the rest are attributed toSYSTEM.This moves the package to
app/controlplane/pkg/usercontext/entitiesso those consumers can populate the actor. Import-path change only, no behaviour change.