Skip to content

Commit 55b8e0e

Browse files
committed
Rename datastore methods: update_tuf_* → tuf_*
1 parent ad7103e commit 55b8e0e

File tree

8 files changed

+18
-23
lines changed

8 files changed

+18
-23
lines changed

nexus/db-queries/src/db/datastore/deployment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,7 @@ mod tests {
22432243
const SYSTEM_HASH: ArtifactHash = ArtifactHash([3; 32]);
22442244

22452245
datastore
2246-
.update_tuf_repo_insert(
2246+
.tuf_repo_insert(
22472247
opctx,
22482248
&TufRepoDescription {
22492249
repo: TufRepoMeta {

nexus/db-queries/src/db/datastore/target_release.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ mod test {
210210
.parse()
211211
.expect("SHA256('')");
212212
let repo = datastore
213-
.update_tuf_repo_insert(
213+
.tuf_repo_insert(
214214
opctx,
215215
&TufRepoDescription {
216216
repo: TufRepoMeta {

nexus/db-queries/src/db/datastore/update.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl DataStore {
7676
/// `TufRepoDescription` if one was already found. (This is not an upsert,
7777
/// because if we know about an existing repo but with different contents,
7878
/// we reject that.)
79-
pub async fn update_tuf_repo_insert(
79+
pub async fn tuf_repo_insert(
8080
&self,
8181
opctx: &OpContext,
8282
description: &external::TufRepoDescription,
@@ -108,7 +108,7 @@ impl DataStore {
108108
}
109109

110110
/// Returns a TUF repo description.
111-
pub async fn update_tuf_repo_get_by_id(
111+
pub async fn tuf_repo_get_by_id(
112112
&self,
113113
opctx: &OpContext,
114114
repo_id: TypedUuid<TufRepoKind>,
@@ -141,7 +141,7 @@ impl DataStore {
141141
}
142142

143143
/// Returns the TUF repo description corresponding to this system version.
144-
pub async fn update_tuf_repo_get_by_version(
144+
pub async fn tuf_repo_get_by_version(
145145
&self,
146146
opctx: &OpContext,
147147
system_version: SemverVersion,
@@ -174,7 +174,7 @@ impl DataStore {
174174
}
175175

176176
/// Returns the list of all TUF repo artifacts known to the system.
177-
pub async fn update_tuf_artifact_list(
177+
pub async fn tuf_list_repos(
178178
&self,
179179
opctx: &OpContext,
180180
generation: Generation,
@@ -194,7 +194,7 @@ impl DataStore {
194194
}
195195

196196
/// Returns the current TUF repo generation number.
197-
pub async fn update_tuf_generation_get(
197+
pub async fn tuf_get_generation(
198198
&self,
199199
opctx: &OpContext,
200200
) -> LookupResult<Generation> {

nexus/reconfigurator/preparation/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl PlanningInputFromDb<'_> {
156156
None => None,
157157
Some(repo_id) => Some(
158158
datastore
159-
.update_tuf_repo_get_by_id(opctx, repo_id.into())
159+
.tuf_repo_get_by_id(opctx, repo_id.into())
160160
.await
161161
.internal_context("fetching target release repo")?
162162
.into_external(),
@@ -175,7 +175,7 @@ impl PlanningInputFromDb<'_> {
175175
None => None,
176176
Some(repo_id) => Some(
177177
datastore
178-
.update_tuf_repo_get_by_id(opctx, repo_id.into())
178+
.tuf_repo_get_by_id(opctx, repo_id.into())
179179
.await
180180
.internal_context("fetching target release repo")?
181181
.into_external(),

nexus/src/app/background/tasks/tuf_artifact_replication.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,18 +590,13 @@ impl ArtifactReplication {
590590
&self,
591591
opctx: &OpContext,
592592
) -> Result<(ArtifactConfig, Inventory)> {
593-
let generation =
594-
self.datastore.update_tuf_generation_get(opctx).await?;
593+
let generation = self.datastore.tuf_get_generation(opctx).await?;
595594
let mut inventory = Inventory::default();
596595
let mut paginator = Paginator::new(SQL_BATCH_SIZE);
597596
while let Some(p) = paginator.next() {
598597
let batch = self
599598
.datastore
600-
.update_tuf_artifact_list(
601-
opctx,
602-
generation,
603-
&p.current_pagparams(),
604-
)
599+
.tuf_list_repos(opctx, generation, &p.current_pagparams())
605600
.await?;
606601
paginator = p.found_batch(&batch, &|a| a.id.into_untyped_uuid());
607602
for artifact in batch {

nexus/src/app/update.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl super::Nexus {
4343
// Now store the artifacts in the database.
4444
let response = self
4545
.db_datastore
46-
.update_tuf_repo_insert(opctx, artifacts_with_plan.description())
46+
.tuf_repo_insert(opctx, artifacts_with_plan.description())
4747
.await
4848
.map_err(HttpError::from)?;
4949

@@ -88,7 +88,7 @@ impl super::Nexus {
8888

8989
let tuf_repo_description = self
9090
.db_datastore
91-
.update_tuf_repo_get_by_version(opctx, system_version.into())
91+
.tuf_repo_get_by_version(opctx, system_version.into())
9292
.await
9393
.map_err(HttpError::from)?;
9494

nexus/src/external_api/http_entrypoints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6575,7 +6575,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
65756575
// Fetch the TUF repo metadata and update the target release.
65766576
let tuf_repo_id = nexus
65776577
.datastore()
6578-
.update_tuf_repo_get_by_version(&opctx, system_version.into())
6578+
.tuf_repo_get_by_version(&opctx, system_version.into())
65796579
.await?
65806580
.repo
65816581
.id;

nexus/tests/integration_tests/updates.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async fn test_repo_upload() -> Result<()> {
114114
let opctx =
115115
OpContext::for_tests(cptestctx.logctx.log.new(o!()), datastore.clone());
116116
assert_eq!(
117-
datastore.update_tuf_generation_get(&opctx).await.unwrap(),
117+
datastore.tuf_get_generation(&opctx).await.unwrap(),
118118
1u32.into()
119119
);
120120

@@ -162,7 +162,7 @@ async fn test_repo_upload() -> Result<()> {
162162
}));
163163
// The generation number should now be 2.
164164
assert_eq!(
165-
datastore.update_tuf_generation_get(&opctx).await.unwrap(),
165+
datastore.tuf_get_generation(&opctx).await.unwrap(),
166166
2u32.into()
167167
);
168168

@@ -215,7 +215,7 @@ async fn test_repo_upload() -> Result<()> {
215215

216216
// We didn't insert a new repo, so the generation number should still be 2.
217217
assert_eq!(
218-
datastore.update_tuf_generation_get(&opctx).await.unwrap(),
218+
datastore.tuf_get_generation(&opctx).await.unwrap(),
219219
2u32.into()
220220
);
221221

@@ -361,7 +361,7 @@ async fn test_repo_upload() -> Result<()> {
361361
}
362362
// No artifacts changed, so the generation number should still be 2...
363363
assert_eq!(
364-
datastore.update_tuf_generation_get(&opctx).await.unwrap(),
364+
datastore.tuf_get_generation(&opctx).await.unwrap(),
365365
2u32.into()
366366
);
367367
// ... and the task should have nothing to do and should immediately

0 commit comments

Comments
 (0)