Skip to content

Add scope support for trusted checksums#1543

Merged
cstamas merged 1 commit into
apache:masterfrom
cstamas:tc-scopes
Aug 12, 2025
Merged

Add scope support for trusted checksums#1543
cstamas merged 1 commit into
apache:masterfrom
cstamas:tc-scopes

Conversation

@cstamas
Copy link
Copy Markdown
Member

@cstamas cstamas commented Aug 11, 2025

Currently TC operated on all resolved artifacts, but this may not be what user wants. Add scope support with two values for now: "all" (as before, everything resolved is validated) or "project" (only project dependencies are validated).

Currently TC operated on all resolved artifacts, but this may
not be what user wants. Add scope support with two values
for now: "all" (as before, everything resolved is validated)
or "project" (only project dependencies are validated).
@cstamas cstamas self-assigned this Aug 11, 2025
@cstamas cstamas added the enhancement New feature or request label Aug 11, 2025
@cstamas cstamas marked this pull request as ready for review August 11, 2025 12:06
@cstamas cstamas added this to the 2.0.11 milestone Aug 12, 2025
@cstamas cstamas merged commit 50587df into apache:master Aug 12, 2025
8 checks passed
@cstamas cstamas deleted the tc-scopes branch August 12, 2025 10:32
return artifactResult.isResolved();
} else if (PROJECT_SCOPE.equals(scope)) {
return artifactResult.isResolved()
&& artifactResult.getRequest().getRequestContext().startsWith("project");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where request context is set ... or by who?
Are we sure that all project artifacts have such value?

What when some of resolving is triggered by plugin?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Context is set by core:

Later on, kicks in the "context refiner":

public final class JavaDependencyContextRefiner implements DependencyGraphTransformer {
that refines context from "project" to something like "project/test".

All in all, only one thing is sure:

  • core sets "project" and "plugin" context, and this is 100% true for project dependencies ("project"), and build plugins ("plugin"). Now, if anyone does ad-hoc collect request, that anyway out of scope.

Hence the "all" (as before, context is totally neglected) and "project" scopes, as that manages project dependencies (a plugin doing ad-hoc lookup is not project dependency).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants