Skip to content

Commit

Permalink
Merge pull request #3449 from ActiveState/DX-3008
Browse files Browse the repository at this point in the history
Fix SBOM nightly failures
  • Loading branch information
MDrakos authored Aug 16, 2024
2 parents a5861d9 + 80a3671 commit d36ba8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions internal/runners/packages/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,20 @@ func (i *Import) Run(params *ImportRunParams) (rerr error) {
Description: msg,
Script: bs,
})
// Always update the local commit ID even if the commit fails to build
if stagedCommit != nil && stagedCommit.Commit != nil && stagedCommit.Commit.CommitID != "" {
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
solveSpinner.Stop(locale.T("progress_fail"))
return locale.WrapError(err, "err_package_update_commit_id")
}
pg.Stop(locale.T("progress_success"))
pg = nil
}
if err != nil {
solveSpinner.Stop(locale.T("progress_fail"))
return locale.WrapError(err, "err_commit_changeset", "Could not commit import changes")
}

pg.Stop(locale.T("progress_success"))
pg = nil

if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
solveSpinner.Stop(locale.T("progress_fail"))
return locale.WrapError(err, "err_package_update_commit_id")
}

// Output change summary.
previousCommit, err := bp.FetchCommit(localCommitId, proj.Owner(), proj.Name(), nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/model/buildplanner/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (b *BuildPlanner) StageCommit(params StageCommitParams) (*Commit, error) {
}

if response.IsErrorResponse(resp.Commit.Build.Type) {
return nil, response.ProcessBuildError(resp.Commit.Build, "Could not process error response from stage commit")
return &Commit{resp.Commit, nil, nil}, response.ProcessBuildError(resp.Commit.Build, "Could not process error response from stage commit")
}

// The BuildPlanner will return a build plan with a status of
Expand Down

0 comments on commit d36ba8a

Please sign in to comment.