Skip to content

Commit a1bfec0

Browse files
fix: CP-1086 Specify latest timestamp (vs nil) when retrieving latest ingredient revision
1 parent 1a88547 commit a1bfec0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/runners/mcp/projecterrors/projecterrors.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,13 @@ func (runner *ProjectErrorsRunner) Run(params *Params) error {
110110
func CheckDependencyFixes(auth *authentication.Auth, failedArtifacts []*buildplan.Artifact) (map[strfmt.UUID]bool, error) {
111111
fixed := make(map[strfmt.UUID]bool)
112112
for _, artifact := range failedArtifacts {
113+
latest, err := model.FetchLatestRevisionTimeStamp(auth)
114+
if err != nil {
115+
return nil, fmt.Errorf("Failed to fetch latest timestamp: %w", err)
116+
}
113117
// TODO: Query multiple artifacts at once to reduce API calls, improving performance.
114118
latestRevision, err := model.GetIngredientByNameAndVersion(
115-
artifact.Ingredients[0].Namespace, artifact.Name(), artifact.Version(), nil, auth)
119+
artifact.Ingredients[0].Namespace, artifact.Name(), artifact.Version(), &latest, auth)
116120
if err != nil {
117121
return nil, fmt.Errorf("error searching ingredient: %w", err)
118122
}

0 commit comments

Comments
 (0)