Skip to content

[NCL-9447] Define tracking-service API#331

Open
pkocandr wants to merge 4 commits into
project-ncl:masterfrom
pkocandr:master
Open

[NCL-9447] Define tracking-service API#331
pkocandr wants to merge 4 commits into
project-ncl:masterfrom
pkocandr:master

Conversation

@pkocandr
Copy link
Copy Markdown
Contributor

No description provided.

@pkocandr pkocandr requested review from michalovjan and rnc March 21, 2026 01:16
@pkocandr pkocandr force-pushed the master branch 6 times, most recently from be226e2 to cc0d561 Compare March 25, 2026 13:00
Copy link
Copy Markdown
Contributor

@rnc rnc left a comment

Choose a reason for hiding this comment

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

Looks great. A few questions and one tiny comment :-)

Comment thread api/src/main/java/org/jboss/pnc/api/trackingservice/dto/TrackedEntry.java Outdated

private String project;

private String name;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we clarify how the artifact repositories will be laid out - for instance would it be

<project-key [ i.e. deployment e.g. pnc, pnc-devel, etc ]>-<buildType [maven | npm | etc]>-<repoType [ hosted | group(virtual) ]-build-<id>

Maybe repoType isn't required?
Should build type be included?

e.g.
pnc-maven-build-1234

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to see which one variant is going to be better when we deploy Artifactory. A lot of worker are deployed per repository prefix so we will want to have the prefix capture correct repos.

F.e. pnc-prod-build-* would be a better prefix imo than pnc-prod-maven-build-* cause we would have to specify all package types seperately so that tracking worker is deployed correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the layout should not be defined in this API but rather in the implementation in repository driver.
But to answer the question, I would also prefer including buildType and put in repoType only in case of a collision, e.g. pnc-maven-build-1234 being the hosted repo for uploads while pnc-maven-group-build-1234 is the group for dependency downloads (or pnc-maven-build-group-1234?). But as Jan said it might be needed to optimize it based on Artifactory's capabilities.

* The identifier of the repository where the artifact is located.
*/
@EqualsAndHashCode.Include
private final RepositoryId repoId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question - does the artifact need to record the type of the repository e.g. maven, npm, etc? Or should that be part of repository? (if needed at all)...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AccessChannel is the field that gives you information about the type of repository the artifact comes from. That field is a part of TrackedEntry class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! This is definitely a valid concern. Package type (as it was called in Indy rather than build type) is missing here. I was thinking where to put it and the best place is probably in TrackedArtifact. Another option was RepositoryId where it seems more logical, but RepositoryId is intended to be used also elsewhere, e.g. in batchDelete operation which should end up in repository driver, where the package type is irrelevant. It needs to be available in Track*Request, so TrackedEntry is not the right place. It would be the case if we could easily identify the packageType without sending it in every tracking request which I think is not possible.
Also as Jan mentioned AccessChannel - that can be probably removed, because if it is an NPM or Maven artifact, it is always accessed natively, while generic http downloads are always accessed via proxy. This was introduced when we had only Maven support in Indy. Now it's kind of duplicating the information from packageType.
Does this suggestion sound ok?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Package type added below. Access channel has been removed from both TrackedEntry and TrackDownloadRequest.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the PackageType again since we concluded in a separate discussion, that Repo Driver can pull repository metadata from Artifactory and not rely on what is being sent to Tracking Service.

Petr Kočandrle added 4 commits May 19, 2026 14:49
Repository driver needs this information to put it into purl and also into
the RepositoryType in TargetRepository. But it can pull the information form
Artifactory directly.
@github-actions
Copy link
Copy Markdown
Contributor

Mend Scan Results

Status: ✅ No findings detected

SCA scan output



Identified 9 dependencies

Detected 0 vulnerabilities (0 Critical, 0 High, 0 Medium, 0 Low)





No Policy violations were detected

Project 'pnc-api' was updated, for more information, visit the Mend platform: https://ibmets.whitesourcesoftware.com/app/orgs/Enterprise%20Applications/applications/summary?project=07917c83-9619-4871-9e82-d1dd1ddfbe1a
Or the Core UI: https://ibmets.whitesourcesoftware.com/Wss/WSS.html#!project;token=9611b83fab7a483da04b8f761b57186be1997f871e4a4ce0ae83b15133851107

Mend AI scan succeeded.

Support Token: 2e2a6c8ecae6845f3994f5b36d03e65421779195091120
SAST scan output
*no findings*

Full logs and artifacts

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