-
Couldn't load subscription status.
- Fork 700
Add inline-comparison as acceptance test #106
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9233526
add inline-compare as acceptance tests
wagoodman 8b657ae
improve RPM matching with source indirection matching
wagoodman 42ee887
add comments to compare-* make targets
wagoodman e0f8d7a
clean inline-compare image test names
wagoodman 13ad4a3
bump syft version to get rpm field enhancements
wagoodman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,8 +7,10 @@ on: | |
| # ... only act on release tags | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| env: | ||
| GO_VERSION: "1.14.x" | ||
|
|
||
| jobs: | ||
| wait-for-checks: | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -32,6 +34,15 @@ jobs: | |
| checkName: "Build-Snapshot-Artifacts" | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - name: Check inline comparison test results | ||
| uses: fountainhead/[email protected] | ||
| id: inline-compare | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| # This check name is defined as the github action job name (in .github/workflows/acceptance-test.yaml) | ||
| checkName: "Inline-Compare" | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - name: Check static anaylysis, unit, and integration test results | ||
| uses: fountainhead/[email protected] | ||
| id: sa-unit-int | ||
|
|
@@ -42,10 +53,11 @@ jobs: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - name: Quality gate | ||
| if: steps.sa-unit-int.outputs.conclusion != 'success' || steps.snapshot.outputs.conclusion != 'success' | ||
| if: steps.sa-unit-int.outputs.conclusion != 'success' || steps.inline-compare.outputs.conclusion != 'success' || steps.snapshot.outputs.conclusion != 'success' | ||
| run: | | ||
| echo "Static/Unit/Integration Status : ${{ steps.sa-unit-int.outputs.conclusion }}" | ||
| echo "Build Snapshot Artifacts Status: ${{ steps.snapshot.outputs.conclusion }}" | ||
| echo "Inline Compare Status: ${{ steps.inline-compare.outputs.conclusion }}" | ||
| false | ||
|
|
||
| release: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| /dist/ | ||
| *.profile | ||
| .server | ||
| *.fingerprint | ||
| Dockerfile | ||
| /metadata.json | ||
| /listing.json | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package rpmdb | ||
|
|
||
| import ( | ||
| "strings" | ||
|
|
||
| "github.com/anchore/grype/grype/version" | ||
| "github.com/anchore/grype/grype/vulnerability" | ||
| "github.com/anchore/syft/syft/distro" | ||
| "github.com/anchore/syft/syft/pkg" | ||
| ) | ||
|
|
||
| type mockProvider struct { | ||
| data map[string]map[string][]*vulnerability.Vulnerability | ||
| } | ||
|
|
||
| func newMockProvider() *mockProvider { | ||
| pr := mockProvider{ | ||
| data: make(map[string]map[string][]*vulnerability.Vulnerability), | ||
| } | ||
| pr.stub() | ||
| return &pr | ||
| } | ||
|
|
||
| func (pr *mockProvider) stub() { | ||
| pr.data["rhel:8"] = map[string][]*vulnerability.Vulnerability{ | ||
| // direct... | ||
| "neutron-libs": { | ||
| { | ||
| Constraint: version.MustGetConstraint("<= 7.1.3-6", version.RpmFormat), | ||
| ID: "CVE-2014-fake-1", | ||
| }, | ||
| }, | ||
| // indirect... | ||
| "neutron": { | ||
| // expected... | ||
| { | ||
| Constraint: version.MustGetConstraint("< 7.1.4-5", version.RpmFormat), | ||
| ID: "CVE-2014-fake-2", | ||
| }, | ||
| { | ||
| Constraint: version.MustGetConstraint("< 8.0.2-0", version.RpmFormat), | ||
| ID: "CVE-2013-fake-3", | ||
| }, | ||
| // unexpected... | ||
| { | ||
| Constraint: version.MustGetConstraint("< 7.0.4-1", version.RpmFormat), | ||
| ID: "CVE-2013-fake-BAD", | ||
| }, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func (pr *mockProvider) GetByDistro(d distro.Distro, p *pkg.Package) ([]*vulnerability.Vulnerability, error) { | ||
| var ty = strings.ToLower(d.Type.String()) | ||
| if d.Type == distro.CentOS || d.Type == distro.RedHat { | ||
| ty = "rhel" | ||
| } | ||
|
|
||
| return pr.data[ty+":"+d.FullVersion()][p.Name], nil | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.