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

feat: Add new data structures for an abstract representation of projects/findings #75

Merged
merged 11 commits into from
Aug 1, 2023

Conversation

tarkatronic
Copy link
Contributor

@tarkatronic tarkatronic commented Jul 20, 2023

Fixes #47

This is my first stab at a proposed data structure for data sources to represent their findings, grouped by project. I believe it would end up being used something like this (very much not valid code):

// scan.go
// ...
projects := NewProjectCollection()
for _, ds := range datasources {
    ds.CollectFindings(projects)
}

// github.go (GitHub datasource)
// ... call the GraphQL API ...
for _, repo := range result.repositories {
    project := projects.GetProject(repo.Name)
    for _, vuln := range repo.VulnerabilityAlerts {
        finding := project.GetFinding(vuln.SecurityAdvisory.Identifiers)
        if finding.Description == "" {
            finding.Description = vuln.SecurityAdvisory.Summary
        }
    }
}

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #75 (934a1b4) into main (bfce6fe) will increase coverage by 4.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
+ Coverage   52.06%   56.22%   +4.15%     
==========================================
  Files          13       14       +1     
  Lines         580      635      +55     
==========================================
+ Hits          302      357      +55     
  Misses        272      272              
  Partials        6        6              
Flag Coverage Δ
unittests 56.22% <100.00%> (+4.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
querying/project.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tarkatronic tarkatronic marked this pull request as ready for review July 21, 2023 15:53
@tarkatronic tarkatronic requested a review from a team as a code owner July 21, 2023 15:53
@tarkatronic tarkatronic added this to the Version 1.0 milestone Jul 21, 2023
querying/ecosystems.go Outdated Show resolved Hide resolved
querying/project.go Outdated Show resolved Hide resolved
querying/project.go Show resolved Hide resolved
@tarkatronic tarkatronic merged commit 4ccefe9 into main Aug 1, 2023
30 checks passed
@tarkatronic tarkatronic deleted the feat/data-source-abstraction branch August 1, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Normalize the data pulled from the data source(s)
3 participants