feat: SCALIBR e2e & Fix all the snapshot problems for ever!*#2934
Draft
another-rex wants to merge 39 commits into
Draft
feat: SCALIBR e2e & Fix all the snapshot problems for ever!*#2934another-rex wants to merge 39 commits into
another-rex wants to merge 39 commits into
Conversation
| } | ||
|
|
||
| // Delete existing directory to start clean | ||
| if err := os.RemoveAll(localDBPath); err != nil { |
| if err := os.RemoveAll(localDBPath); err != nil { | ||
| return err | ||
| } | ||
| if err := os.MkdirAll(localDBPath, 0750); err != nil { |
Comment on lines
+872
to
+901
| for _, file := range zipReader.File { | ||
| if !strings.HasSuffix(file.Name, ".json") { | ||
| continue | ||
| } | ||
|
|
||
| vulnID := strings.TrimSuffix(file.Name, ".json") | ||
| if !shouldKeepVuln(vulnID) { | ||
| continue | ||
| } | ||
|
|
||
| f, err := file.Open() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| content, err := io.ReadAll(f) | ||
| f.Close() | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| var prettyJSON bytes.Buffer | ||
| if err := json.Indent(&prettyJSON, content, "", " "); err != nil { | ||
| return err | ||
| } | ||
|
|
||
| targetFilePath := filepath.Join(localDBPath, vulnID+".json") | ||
| if err := os.WriteFile(targetFilePath, prettyJSON.Bytes(), 0644); err != nil { //nolint:gosec | ||
| return err | ||
| } | ||
| } |
| } | ||
|
|
||
| targetFilePath := filepath.Join(localDBPath, vulnID+".json") | ||
| if err := os.WriteFile(targetFilePath, prettyJSON.Bytes(), 0644); err != nil { //nolint:gosec |
| repoRoot := findRepoRoot() | ||
| localDBPath := filepath.Join(repoRoot, offlineDBRelativePath, ecosystem) | ||
|
|
||
| files, err := os.ReadDir(localDBPath) |
| } | ||
|
|
||
| filePath := filepath.Join(localDBPath, file.Name()) | ||
| content, err := os.ReadFile(filePath) |
another-rex
marked this pull request as draft
July 21, 2026 06:50
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
I'll try to split this up
With the scalibr clients PR finally merged in, we now have access to everything we need to fully migrate to use scalibr end2end.
This PR does the following:
*Not quite true, as we still download live full vulns, which has a severity field that is likely to change.