Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace TUF artifact primary key with a UUID #7340

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

iliana
Copy link
Contributor

@iliana iliana commented Jan 14, 2025

(name, version, kind) is a natural key for the tuf_artifact table: given a kind and name for an artifact, we should only ever have one copy of any particular version.

However, this natural key does not distribute well, which makes it a poor choice for a primary key in CockroachDB. It also makes pagination more difficult.

Instead of altering the schema we drop the tables and recreate them, as any potential contents would be useless to us; until #7129 lands we have no means to store the artifacts from a repository.

@iliana iliana requested a review from sunshowers January 14, 2025 17:50
Copy link
Contributor

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

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

Thanks! Just one comment.

@@ -1014,8 +1013,7 @@ authz_resource! {
authz_resource! {
name = "TufArtifact",
parent = "Fleet",
primary_key = (String, SemverVersion, String),
input_key = ArtifactId,
primary_key = { uuid_kind = TufArtifactKind },
Copy link
Contributor

Choose a reason for hiding this comment

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

awesome!

TufRepo => "tuf_repo",
TufArtifact => "tuf_artifact",
Copy link
Contributor

Choose a reason for hiding this comment

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

please sort :)

@iliana iliana force-pushed the iliana/tuf-artifact-key branch from b84aaea to 5c5c53f Compare January 14, 2025 19:51
@iliana iliana enabled auto-merge (squash) January 14, 2025 19:53
@iliana iliana merged commit 90898fb into main Jan 14, 2025
16 checks passed
@iliana iliana deleted the iliana/tuf-artifact-key branch January 14, 2025 22:45
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.

2 participants