Skip to content

Commit

Permalink
Use logical-version field in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrkob committed Oct 15, 2024
1 parent 2404088 commit 17e2283
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void setUp() throws Exception {
));

// create and deploy second manifest
secondManifest = new ChannelManifest(null, null, null, null,
secondManifest = new ChannelManifest(null, null, null, null, null,
List.of(new Stream("org.wildfly.core", "wildfly-controller", UPGRADE_VERSION)));
repositoryUtils.deployArtifact(new DefaultArtifact(
"org.test.channels",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<version.org.yaml.snakeyaml>2.2</version.org.yaml.snakeyaml>
<version.junit>4.13.2</version.junit>
<version.maven-shade-plugin>3.6.0</version.maven-shade-plugin>
<version.org.wildfly.channel>1.1.0.Final</version.org.wildfly.channel>
<version.org.wildfly.channel>1.2.0.Final</version.org.wildfly.channel>
<version.maven-compiler-plugin>3.10.1</version.maven-compiler-plugin>
<version.org.wildfly.galleon-pack>33.0.2.Final</version.org.wildfly.galleon-pack>
<version.info.picocli>4.7.6</version.info.picocli>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.jboss.logging.Logger;
import org.wildfly.channel.Channel;
import org.wildfly.channel.ChannelManifest;
import org.wildfly.channel.ChannelManifestMapper;
import org.wildfly.channel.MavenArtifact;
import org.wildfly.channel.MavenCoordinate;
Expand Down Expand Up @@ -84,7 +85,13 @@ public ManifestVersionRecord getCurrentVersions(List<Channel> channels) throws I
if (LOG.isDebugEnabled()) {
LOG.debugf("Manifest %s resolved in currently resolve artifacts, recording.", manifestCoord);
}
final String description = ChannelManifestMapper.from(version.getFile().toURI().toURL()).getName();
final ChannelManifest manifest = ChannelManifestMapper.from(version.getFile().toURI().toURL());
final String description;
if (manifest.getSchemaVersion().equals(ChannelManifestMapper.SCHEMA_VERSION_1_0_0)) {
description = manifest.getName();
} else {
description = manifest.getLogicalVersion();
}
record.addManifest(new ManifestVersionRecord.MavenManifest(
manifestCoord.getGroupId(),
manifestCoord.getArtifactId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class ProsperoManifestVersionResolverTest {
public void setUp() throws Exception {
manifestFile = temp.newFile("test");
Files.writeString(manifestFile.toPath(), ChannelManifestMapper.toYaml(
new ChannelManifest("test-name", "test-id", "desc", null)));
new ChannelManifest("test-name", "test-id", "test-version", "desc", null, null)));

// when the fallback resolver is called return an empty record to make the test pass
when(manifestVersionResolver.getCurrentVersions(any())).thenReturn(new ManifestVersionRecord());
Expand All @@ -86,7 +86,7 @@ public void versionResolvedDuringProvisioning() throws Exception {
.containsOnly(A_VERSION);
assertThat(currentVersions.getMavenManifests())
.map(ManifestVersionRecord.MavenManifest::getDescription)
.containsOnly("test-name");
.containsOnly("test-version");
}

@Test
Expand Down

0 comments on commit 17e2283

Please sign in to comment.