Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dd4ee72
Revert "Fix double in"
rnc Feb 13, 2026
7dc9413
Revert "Update Javadoc"
rnc Feb 13, 2026
6f20793
Revert "[NCLSUP-1016] Optimize blocklist querying"
rnc Feb 13, 2026
20fa334
Revert "Remove Whitelist"
rnc Feb 13, 2026
0b48f59
Revert "Move Version code to pnc-api and pnc-common"
rnc Feb 13, 2026
15d8863
Revert "[NCL-7877] decouple version functionality from ScopedStrategy"
rnc Feb 13, 2026
9b73056
Revert "[Alignment 2.0] implement VersionAnalyzer tests regarding Qua…
rnc Feb 13, 2026
d7334a5
Revert "[Alignment 2.0] changes after review"
rnc Feb 13, 2026
11beb92
Revert "[Alignment 2.0] rename Constraints to Strategy for consistency"
rnc Feb 13, 2026
3e51bf6
Revert "bump pnc-api to 2.5.0-SNAPSHOT"
rnc Feb 13, 2026
6b27596
Revert "[Alignment 2.0] rename Version pnc-api dto to QualifiedVersion"
rnc Feb 13, 2026
f941c6e
Revert "rollback reports-model module to Java 8"
rnc Feb 13, 2026
96057fa
Revert "remove unnecessary API change"
rnc Feb 13, 2026
952a4f3
Revert "[Alignment 2.0] use Qualifiers for Version ranking and filter…
rnc Feb 13, 2026
e35ca64
Revert "[Alignment 2.0] migrate DA to retrieve qualifier-enhanced ver…
rnc Feb 13, 2026
b0b80d0
Use released versions of PNC components
rnc Feb 16, 2026
2b599db
Reapply "Move Version code to pnc-api and pnc-common"
rnc Feb 17, 2026
5ed0959
Update PNC components
rnc Feb 17, 2026
ef8c41c
Add explicit dependency on Atlas
rnc Feb 17, 2026
6d3aafd
Exclude opentelemetry and httpcomponents
rnc Feb 18, 2026
6e0f1d0
Reapply "Remove Whitelist"
rnc Feb 18, 2026
d2c7204
Reapply "[NCLSUP-1016] Optimize blocklist querying"
rnc Feb 18, 2026
e6c7bf2
Reapply "Update Javadoc"
rnc Feb 18, 2026
a5841b1
Reapply "Fix double in"
rnc Feb 18, 2026
5ebaa8f
Add central snapshot repository
rnc Feb 23, 2026
bf36c80
Use fixed version for pnc-api. Use SLF4J format for logging
rnc Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
<artifactId>constants</artifactId>
</dependency>

<dependency>
<groupId>org.jboss.pnc</groupId>
<artifactId>pnc-common</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
50 changes: 0 additions & 50 deletions common/src/main/java/org/jboss/da/common/ScopedGAVStrategy.java

This file was deleted.

64 changes: 0 additions & 64 deletions common/src/main/java/org/jboss/da/common/ScopedStrategy.java

This file was deleted.

4 changes: 4 additions & 0 deletions communication/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.pnc</groupId>
<artifactId>pnc-common</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.pnc</groupId>
<artifactId>rest-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import org.jboss.da.common.json.LookupMode;
import org.jboss.da.communication.repository.api.RepositoryException;
import org.jboss.da.model.rest.GA;
import org.jboss.pnc.api.dependencyanalyzer.dto.QualifiedVersion;
import org.jboss.pnc.dto.requests.QValue;

import java.util.List;
import java.util.Set;

public interface PncConnector {

Expand All @@ -18,17 +15,15 @@ public interface PncConnector {
* @return list of available versions for given groupId:artifactId in repository, never {@code null}
* @throws RepositoryException When there is problem with communication.
*/
List<QualifiedVersion> getMavenVersions(GA ga, LookupMode mode, Set<QValue> qualifiers) throws RepositoryException;
List<String> getMavenVersions(GA ga, LookupMode mode) throws RepositoryException;

/**
* Finds available versions for given npm package.
*
* @param packageName Name of the npm package
* @param qualifiers
* @return list of available versions for package in repository, never {@code null}
* @throws RepositoryException When there is problem with communication.
*/
List<QualifiedVersion> getNpmVersions(String packageName, LookupMode mode, Set<QValue> qualifiers)
throws RepositoryException;
List<String> getNpmVersions(String packageName, LookupMode mode) throws RepositoryException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
import org.jboss.da.common.util.ConfigurationParseException;
import org.jboss.da.communication.repository.api.RepositoryException;
import org.jboss.da.model.rest.GA;
import org.jboss.pnc.api.dependencyanalyzer.dto.QualifiedVersion;
import org.jboss.pnc.client.ArtifactClient;
import org.jboss.pnc.client.Configuration;
import org.jboss.pnc.client.RemoteCollection;
import org.jboss.pnc.client.RemoteResourceException;
import org.jboss.pnc.common.logging.MDCUtils;
import org.jboss.pnc.dto.requests.QValue;
import org.jboss.pnc.dto.response.ArtifactInfo;
import org.jboss.pnc.enums.RepositoryType;
import org.slf4j.Logger;
Expand All @@ -23,7 +21,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
* @author <a href="mailto:pkocandr@redhat.com">Petr Kocandrle</a>
Expand All @@ -45,29 +42,16 @@ public PncConnectorImpl(org.jboss.da.common.util.Configuration configuration) {
}
}

private Collection<ArtifactInfo> getArtifacts(
String identifierPattern,
RepositoryType repoType,
LookupMode mode,
Set<QValue> qualifiers) throws RepositoryException {
private Collection<ArtifactInfo> getArtifacts(String identifierPattern, RepositoryType repoType, LookupMode mode)
throws RepositoryException {
ArtifactClient artifactClient = getArtifactClient();
RemoteCollection<ArtifactInfo> artCollection;
try {
if (qualifiers.isEmpty()) {
artCollection = artifactClient.getAllFiltered(
identifierPattern,
mode.getArtifactQualities(),
repoType,
mode.getBuildCategories(),
null);
} else {
artCollection = artifactClient.getAllFiltered(
identifierPattern,
mode.getArtifactQualities(),
repoType,
mode.getBuildCategories(),
qualifiers);
}
artCollection = artifactClient.getAllFiltered(
identifierPattern,
mode.getArtifactQualities(),
repoType,
mode.getBuildCategories());
} catch (RemoteResourceException ex) {
log.debug("Error when reading artifacts from PNC: " + ex, ex);
throw new RepositoryException("Error when reading artifacts from PNC: " + ex, ex);
Expand All @@ -76,17 +60,16 @@ private Collection<ArtifactInfo> getArtifacts(
}

@Override
public List<QualifiedVersion> getMavenVersions(GA ga, LookupMode mode, Set<QValue> qualifiers)
throws RepositoryException {
public List<String> getMavenVersions(GA ga, LookupMode mode) throws RepositoryException {
String identifierPattern = ga.getGroupId() + ':' + ga.getArtifactId() + ":pom:*";
Collection<ArtifactInfo> arts = getArtifacts(identifierPattern, RepositoryType.MAVEN, mode, qualifiers);
Collection<ArtifactInfo> arts = getArtifacts(identifierPattern, RepositoryType.MAVEN, mode);

List<QualifiedVersion> versions = new ArrayList<>(arts.size());
List<String> versions = new ArrayList<>(arts.size());
for (ArtifactInfo art : arts) {
String[] parts = art.getIdentifier().split(":");
if (parts.length == 4) {
// TODO filtering by target repository if necessary
versions.add(new QualifiedVersion(parts[3], art.getQualifiers()));
versions.add(parts[3]);
} else {
log.error("Cannot read version for artifact with identifier {}", art.getIdentifier());
}
Expand All @@ -95,17 +78,16 @@ public List<QualifiedVersion> getMavenVersions(GA ga, LookupMode mode, Set<QValu
}

@Override
public List<QualifiedVersion> getNpmVersions(String packageName, LookupMode mode, Set<QValue> qualifiers)
throws RepositoryException {
public List<String> getNpmVersions(String packageName, LookupMode mode) throws RepositoryException {
String identifierPattern = packageName + ":*";
Collection<ArtifactInfo> arts = getArtifacts(identifierPattern, RepositoryType.NPM, mode, qualifiers);
Collection<ArtifactInfo> arts = getArtifacts(identifierPattern, RepositoryType.NPM, mode);

List<QualifiedVersion> versions = new ArrayList<>(arts.size());
List<String> versions = new ArrayList<>(arts.size());
for (ArtifactInfo art : arts) {
String[] parts = art.getIdentifier().split(":");
if (parts.length == 2) {
// TODO filtering by target repository if necessary
versions.add(new QualifiedVersion(parts[1], art.getQualifiers()));
versions.add(parts[1]);
} else {
log.error("Cannot read version for artifact with identifier {}", art.getIdentifier());
}
Expand All @@ -129,8 +111,7 @@ private Configuration getClientConfig(String protocol, String host, int port) {

builder.mdcToHeadersMappings(MDCUtils.HEADER_KEY_MAPPING);

Configuration config = builder.build();
return config;
return builder.build();
}

}
35 changes: 31 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.reports.rest>1</version.reports.rest>
<version.bc.rest>1</version.bc.rest>
<version.pnc>2.5.0-SNAPSHOT</version.pnc>
<version.pnc-common>2.4.0-SNAPSHOT</version.pnc-common>
<version.pnc-api>2.5.0-SNAPSHOT</version.pnc-api>
<version.pnc>3.4.2</version.pnc>
<version.pnc-common>3.4.1-SNAPSHOT</version.pnc-common>
<version.pnc-api>3.4.2</version.pnc-api>
<atlasVersion>0.16.2</atlasVersion>
<version.galley>0.13.4</version.galley>
<version.cartographer>0.12.2</version.cartographer>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -150,6 +151,16 @@
<groupId>org.jboss.pnc</groupId>
<artifactId>pnc-common</artifactId>
<version>${version.pnc-common}</version>
<exclusions>
<exclusion>
<groupId>io.opentelemetry</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.pnc</groupId>
Expand Down Expand Up @@ -254,7 +265,11 @@
<artifactId>galley-cache-partyline</artifactId>
<version>${version.galley}</version>
</dependency>
<!-- Commonjava -->
<dependency>
<groupId>org.commonjava.maven.atlas</groupId>
<artifactId>atlas-identities</artifactId>
<version>${atlasVersion}</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
Expand Down Expand Up @@ -360,6 +375,18 @@
</dependencyManagement>

<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

<repository>
<id>MRRC GA</id>
<url>https://maven.repository.redhat.com/ga</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import org.jboss.da.listings.api.model.BlackArtifact;
import org.jboss.da.model.rest.GA;
import org.jboss.da.model.rest.GAV;
import org.jboss.pnc.api.dependencyanalyzer.dto.QualifiedVersion;

import java.util.Set;

/**
*
*
* @author Jozef Mrazek &lt;jmrazek@redhat.com&gt;
*
*/
Expand All @@ -30,7 +29,7 @@ public interface BlackArtifactService extends ArtifactService<BlackArtifact> {
/**
* Checks if list contains artifact with specific GAV. All restrictions and conversions are applied like using
* getArtifact method of specific list.
*
*
* @param gav
* @return True if list contains the artifact otherwise false.
*/
Expand All @@ -46,7 +45,7 @@ public interface BlackArtifactService extends ArtifactService<BlackArtifact> {
/**
* Checks if blacklist contains artifact with specific groupId, artifactId and version. If the version have redhat
* suffix it is removed. Then the version is converted to OSGi version and finds this version in blacklist;
*
*
* @return found artifact
*/
public Optional<BlackArtifact> getArtifact(String groupId, String artifactId, String version);
Expand All @@ -61,7 +60,7 @@ public interface BlackArtifactService extends ArtifactService<BlackArtifact> {

/**
* Remove artifact from list. Removes only exact match of artifact.
*
*
* @param groupId
* @param artifactId
* @param version
Expand Down Expand Up @@ -89,5 +88,5 @@ public interface BlackArtifactService extends ArtifactService<BlackArtifact> {
* @param version Version to check in the blocklist.
* @return True, if the GA + version is present in the blocklist.
*/
boolean isBlocklisted(Set<GAV> cache, GA ga, QualifiedVersion version);
boolean isBlocklisted(Set<GAV> cache, GA ga, String version);
}
Loading