Skip to content

Commit

Permalink
Fixes 4797: no repo name or uuid in last_snapshot (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
xbhouse authored Oct 18, 2024
1 parent 0200a5b commit cc27e68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/dao/repository_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,8 @@ func ModelToApiFields(repoConfig models.RepositoryConfiguration, apiRepo *api.Re
AddedCounts: repoConfig.LastSnapshot.AddedCounts,
RemovedCounts: repoConfig.LastSnapshot.RemovedCounts,
RepositoryPath: repoConfig.LastSnapshot.RepositoryPath,
RepositoryUUID: repoConfig.UUID,
RepositoryName: repoConfig.Name,
}
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/dao/repository_configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,8 @@ func (suite *RepositoryConfigSuite) TestFetch() {
assert.Equal(t, found.Name, fetched.Name)
assert.Equal(t, found.Repository.URL, fetched.URL)
assert.Equal(t, found.LastSnapshot.UUID, fetched.LastSnapshot.UUID)
assert.Equal(t, found.UUID, fetched.LastSnapshot.RepositoryUUID)
assert.Equal(t, found.Name, fetched.LastSnapshot.RepositoryName)

if config.Get().Features.Snapshots.Enabled {
assert.Equal(t, testContentPath+"/", fetched.LastSnapshot.URL)
Expand Down Expand Up @@ -1269,6 +1271,8 @@ func (suite *RepositoryConfigSuite) TestList() {
assert.Equal(t, repoConfig.Repository.URL, response.Data[0].URL)
assert.Equal(t, repoConfig.LastSnapshot.UUID, response.Data[0].LastSnapshot.UUID)
assert.Equal(t, repoConfig.LastSnapshot.RepositoryPath, response.Data[0].LastSnapshot.RepositoryPath)
assert.Equal(t, repoConfig.UUID, response.Data[0].LastSnapshot.RepositoryUUID)
assert.Equal(t, repoConfig.Name, response.Data[0].LastSnapshot.RepositoryName)
if config.Get().Features.Snapshots.Enabled {
assert.Equal(t, testContentPath+"/", response.Data[0].LastSnapshot.URL)
}
Expand Down

0 comments on commit cc27e68

Please sign in to comment.