Skip to content

Commit

Permalink
warn more places instead of failing
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <[email protected]>
  • Loading branch information
imjasonh committed Oct 22, 2024
1 parent 59e4337 commit 1e70b77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 45 deletions.
40 changes: 0 additions & 40 deletions examples/go-bump.yaml

This file was deleted.

12 changes: 7 additions & 5 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,12 @@ func (b *Build) IsBuildLess() bool {

// getBuildConfigPURL determines the package URL for the melange config file
// itself.
func (b Build) getBuildConfigPURL() (*purl.PackageURL, error) {
func (b Build) getBuildConfigPURL(ctx context.Context) (*purl.PackageURL, error) {
namespace, name, found := strings.Cut(strings.TrimPrefix(b.ConfigFileRepositoryURL, "https://github.com/"), "/")
if !found {
return nil, fmt.Errorf("extracting namespace and name from %s", b.ConfigFileRepositoryURL)
clog.FromContext(ctx).Warnf("unable to extract namespace and name from %q", b.ConfigFileRepositoryURL)
namespace = "unknown"
name = "unknown"git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / Build melange and add to artifact cache

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / build

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / Build melange and add to artifact cache

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / build examples (mbedtls.yaml)

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / build examples (minimal.yaml)

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / test

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / build examples (git-checkout.yaml)

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / build examples (gnu-hello.yaml)

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / build examples (sshfs.yaml)

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / bootstrap package

expected ';', found git

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected name git at end of statement) (typecheck)

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / lint

syntax error: unexpected name git at end of statement (typecheck)

Check failure on line 537 in pkg/build/build.go

View workflow job for this annotation

GitHub Actions / lint

expected ';', found git (typecheck)
}

u := &purl.PackageURL{
Expand Down Expand Up @@ -754,7 +756,7 @@ func (b *Build) BuildPackage(ctx context.Context) error {
return !result
})

if err := b.addSBOMPackageForBuildConfigFile(); err != nil {
if err := b.addSBOMPackageForBuildConfigFile(ctx); err != nil {
return fmt.Errorf("adding SBOM package for build config file: %w", err)
}

Expand Down Expand Up @@ -1022,8 +1024,8 @@ func (b Build) writeSBOM(pkgName string, doc *spdx.Document) error {
return nil
}

func (b *Build) addSBOMPackageForBuildConfigFile() error {
buildConfigPURL, err := b.getBuildConfigPURL()
func (b *Build) addSBOMPackageForBuildConfigFile(ctx context.Context) error {
buildConfigPURL, err := b.getBuildConfigPURL(ctx)
if err != nil {
return fmt.Errorf("getting PURL for build config: %w", err)
}
Expand Down

0 comments on commit 1e70b77

Please sign in to comment.