Skip to content

Commit f25d8e3

Browse files
Merge pull request #3722 from ActiveState/samueld/CP-1086
fix: CP-1086 Specify latest timestamp (vs nil) when retrieving latest ingredient revision
2 parents 3a41998 + 9f3e36e commit f25d8e3

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
@@ -109,10 +109,14 @@ func (runner *ProjectErrorsRunner) Run(params *Params) error {
109109
// If found, assume the issue is resolved so that a new build could be retried.
110110
func CheckDependencyFixes(auth *authentication.Auth, failedArtifacts []*buildplan.Artifact) (map[strfmt.UUID]bool, error) {
111111
fixed := make(map[strfmt.UUID]bool)
112+
latest, err := model.FetchLatestRevisionTimeStamp(auth)
113+
if err != nil {
114+
return nil, fmt.Errorf("Failed to fetch latest timestamp: %w", err)
115+
}
112116
for _, artifact := range failedArtifacts {
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)