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

Wire up the full ClearlyDefined definition importer from their blobst… #882

Merged

Conversation

bobmcwhirter
Copy link
Contributor

…ore.

@bobmcwhirter bobmcwhirter marked this pull request as ready for review October 2, 2024 18:35
Copy link
Contributor

@jcrossley3 jcrossley3 left a comment

Choose a reason for hiding this comment

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

I don't understand why we need both a ClearlyDefinedLoader taking a Value and a ClearlyDefinedCurationLoader taking a Curation.

I'm not familiar enough with the walker interfaces, so I'll defer to @ctron on that.

@bobmcwhirter
Copy link
Contributor Author

I don't understand why we need both a ClearlyDefinedLoader taking a Value and a ClearlyDefinedCurationLoader taking a Curation.

The Curation YAML was fairly small/easy to make a serde impl for.

The Definition JSON is more complex, and since we're just plucking a few small bits out of it, figured JsonPath was sufficient against Value.

tl;dr: lazy

Copy link
Contributor

@ctron ctron left a comment

Choose a reason for hiding this comment

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

A few small things.

}

pub async fn run(mut self) -> Result<ClearlyDefinedItemContinuation, Error> {
let changes = reqwest::get(self.changes_index_url()).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

This creates a new connection pool for each request. I think we should create and keep a client.

Same for the other calls.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix

.graph
.ingest_sbom(labels, digests, &curation.document_id(), &curation, &tx)
.await?;
println!("{:#?}", item);
Copy link
Contributor

Choose a reason for hiding this comment

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

No println please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh c'mon!

@bobmcwhirter bobmcwhirter added this pull request to the merge queue Oct 4, 2024
Merged via the queue into trustification:main with commit daef8de Oct 4, 2024
2 checks passed
@bobmcwhirter bobmcwhirter deleted the clearly-defined-blobstore branch October 4, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants