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

state import with SBOMs should still update the commit. #3418

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Jul 29, 2024

BugDX-2977 Nightly failure: CycloneDX and SPDX SBOM imports

We expect the solve to fail, but we should still update the commit so the user can see what was added, even if the runtime is no longer viable.

Note: these tests were passing prior to the runtime refactor landing and the removal of constants.DisableRuntime in favor of the async runtime config option. The local commit was still being updated despite the runtime failing to solve. Now this is no longer the case, so this PR is trying to work around that.

We expect the solve to fail, but we should still update the commit so the user can see what was added, even if the runtime is no longer viable.
@mitchell-as mitchell-as requested a review from Naatan July 29, 2024 17:19
@mitchell-as mitchell-as marked this pull request as ready for review July 29, 2024 17:19
Comment on lines 157 to 161
if strings.Contains(verr, "non-existent namespace: private/") {
if err := localcommit.Set(proj.Dir(), stagedCommitId.String()); err != nil {
return locale.WrapError(err, "err_package_update_commit_id")
}
return errImportSbomSolve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too specific. We should not have awareness of sboms on the state tool side, and definitely should not be string matching errors from the API to localize them here.

I think we should just make this the mechanic for import; we always update the commit regardless of whether the builder errored out. And we forward the API error, which should already be helpful enough on its own.

@mitchell-as mitchell-as requested a review from Naatan July 29, 2024 17:51
@mitchell-as mitchell-as merged commit 27cbf09 into version/0-46-0-RC1 Jul 29, 2024
7 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-2977 branch July 29, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants