Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SBOM nightly failures #3449

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions internal/runners/packages/import.go
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 1 addition & 1 deletion pkg/platform/model/buildplanner/commit.go
Original file line number Diff line number Diff line change
@@ -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