Skip to content

Commit cc27e68

Browse files
authored
Fixes 4797: no repo name or uuid in last_snapshot (#851)
1 parent 0200a5b commit cc27e68

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/dao/repository_configs.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,8 @@ func ModelToApiFields(repoConfig models.RepositoryConfiguration, apiRepo *api.Re
11151115
AddedCounts: repoConfig.LastSnapshot.AddedCounts,
11161116
RemovedCounts: repoConfig.LastSnapshot.RemovedCounts,
11171117
RepositoryPath: repoConfig.LastSnapshot.RepositoryPath,
1118+
RepositoryUUID: repoConfig.UUID,
1119+
RepositoryName: repoConfig.Name,
11181120
}
11191121
}
11201122

pkg/dao/repository_configs_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,8 @@ func (suite *RepositoryConfigSuite) TestFetch() {
11021102
assert.Equal(t, found.Name, fetched.Name)
11031103
assert.Equal(t, found.Repository.URL, fetched.URL)
11041104
assert.Equal(t, found.LastSnapshot.UUID, fetched.LastSnapshot.UUID)
1105+
assert.Equal(t, found.UUID, fetched.LastSnapshot.RepositoryUUID)
1106+
assert.Equal(t, found.Name, fetched.LastSnapshot.RepositoryName)
11051107

11061108
if config.Get().Features.Snapshots.Enabled {
11071109
assert.Equal(t, testContentPath+"/", fetched.LastSnapshot.URL)
@@ -1269,6 +1271,8 @@ func (suite *RepositoryConfigSuite) TestList() {
12691271
assert.Equal(t, repoConfig.Repository.URL, response.Data[0].URL)
12701272
assert.Equal(t, repoConfig.LastSnapshot.UUID, response.Data[0].LastSnapshot.UUID)
12711273
assert.Equal(t, repoConfig.LastSnapshot.RepositoryPath, response.Data[0].LastSnapshot.RepositoryPath)
1274+
assert.Equal(t, repoConfig.UUID, response.Data[0].LastSnapshot.RepositoryUUID)
1275+
assert.Equal(t, repoConfig.Name, response.Data[0].LastSnapshot.RepositoryName)
12721276
if config.Get().Features.Snapshots.Enabled {
12731277
assert.Equal(t, testContentPath+"/", response.Data[0].LastSnapshot.URL)
12741278
}

0 commit comments

Comments
 (0)