feat: detach tokens from extension versions - #2065
Open
cstamas wants to merge 1 commit into
Open
Conversation
As future plans may want us to delete tokens, instead accumulate them and flag as deactivated. Summary: - Added V1_72__ExtensionVersion_PublishedBy.sql migration: new published_by_id column (FK → user_data), backfilled from published_with_id, and changed the published_with_id FK to ON DELETE SET NULL. - Added publishedBy field to ExtensionVersion (mirroring the removedBy precedent), fixed a pre-existing bug where displayName was silently excluded from equals(). - Repointed every read path (isVerified in LocalRegistryService/RelevanceService, toExtensionJson, OrphanNamespaceMigration) from getPublishedWith().getUser() to getPublishedBy(). - Redesigned PublisherComplianceChecker to iterate by publisher instead of by token, so it stays correct once tokens are deleted. - Renamed/added/deleted JPA repository methods so no query joins through personal_access_token anymore. - Rewrote ~12 raw jOOQ joins across ExtensionVersionJooqRepository and AdminStatisticCalculationsRepository to join user_data directly via published_by_id. - Applied the migration through real Flyway (via a temporary git stash of the Java changes) and regenerated jOOQ code. - Updated all affected test fixtures and mocks. - Verified: 841 unit tests + 922 integration tests (Testcontainers Postgres) all pass, and a manual SQL check confirms deleting a personal_access_token row no longer errors and correctly nulls published_with_id while leaving published_by_id intact. Note: Known follow-up (out of scope): FixTargetPlatformsJobRequestHandler still republishes using the original token and would NPE if that token were ever deleted — this is a pre-existing gap in the publish pipeline's identity model, not introduced by this change.
autumnfound
approved these changes
Aug 12, 2026
autumnfound
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Covers data migration, new field, and looks to cover all cases where the PAT was used in joins. We also have the index I'd expect for the field to keep the lookups zippy!
cstamas
marked this pull request as ready for review
August 14, 2026 12:13
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.
As future plans may want us to delete tokens, instead accumulate them and flag as deactivated.
Summary:
Note: Known follow-up (out of scope): FixTargetPlatformsJobRequestHandler still republishes using the original token and would NPE if that token were ever deleted — this is a pre-existing gap in the publish pipeline's identity model, not introduced by this change.