Skip to content

refactor(controlplane): publish usercontext/entities under pkg/ - #3329

Open
jiparis wants to merge 1 commit into
chainloop-dev:mainfrom
jiparis:jiparis/pfm-6890-publish-usercontext-entities
Open

refactor(controlplane): publish usercontext/entities under pkg/#3329
jiparis wants to merge 1 commit into
chainloop-dev:mainfrom
jiparis:jiparis/pfm-6890-publish-usercontext-entities

Conversation

@jiparis

@jiparis jiparis commented Aug 5, 2026

Copy link
Copy Markdown
Member

The identity context helpers (CurrentUser, CurrentAPIToken, CurrentOrg, CurrentMembership) live under app/controlplane/internal/, yet the public app/controlplane/pkg/biz depends on them: AuditorUseCase.Dispatch resolves the audit actor from those context values.

Modules that embed pkg/biz therefore 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 whose RequiresActor() is true gets dropped with failed to get actor information, and the rest are attributed to SYSTEM.

This moves the package to app/controlplane/pkg/usercontext/entities so those consumers can populate the actor. Import-path change only, no behaviour change.

Review in cubic

@jiparis
jiparis requested a review from a team August 5, 2026 12:58
@jiparis
jiparis marked this pull request as ready for review August 5, 2026 13:00
@chainloop-platform

chainloop-platform Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Security Checks — ⚠️ 1 failing

PR info

Status Policy Messages
✅ Passed pr-description-required -
⚠️ Failed 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

View attestation ↗


Powered by Chainloop and Chainloop Trace

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 46 files

Re-trigger cubic

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
jiparis force-pushed the jiparis/pfm-6890-publish-usercontext-entities branch from 43043e0 to a937223 Compare August 5, 2026 13:06
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.

1 participant