Compare commits

...
Author SHA1 Message Date
james.maesandClaude Opus 5.5 9003d1dabe fix: the qbit metadata version comes from the build, not a hardcoded constant
The producer read a literal version, so released artifacts reported a stale
or -SNAPSHOT version. qbit-web-performance.properties (version=${project.version}) is
Maven-filtered and the producer loads it; tests assert producer == bundle ==
artifact version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 01:33:04 -05:00
james.maes c937d753df Merge pull request #14 from QRun-IO/fix/help-bundle-version
fix(help): help bundle version comes from the build, not a hardcoded SNAPSHOT
2026-10-14 22:37:20 -05:00
james.maesandClaude Opus 5.5 ffa50f6964 fix(help): the help bundle carries the artifact version (Maven-filtered) instead of a hardcoded SNAPSHOT
On release branches the bundle's version and the producer's differed, so the
bundle test that asserts they match failed, and released bundles recorded
SNAPSHOT as their provenance. help/*.yaml is now filtered:
version: ${project.version}.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:10:27 -05:00
james.maes 8e2ecb3b3f Merge pull request #13 from QRun-IO/feature/help-bundle
feat(help): qbit-web-performance help bundle via QQQ help bundles, with coverage gate
2026-10-14 20:45:30 -05:00
7 changed files with 73 additions and 3 deletions

No files matched your search

+1
View File
@@ -5,6 +5,7 @@ All notable changes to this project are documented here. The format follows Keep
## [0.1.0] - Unreleased
### Fixed
- Read the QBit metadata version from the build so release artifacts report their actual version, matching the help bundle.
- Use dropdowns for tier, scope, source, strategy, metric, comparator and severity, preserving existing stored values.
- Allow manual Tested Pages inserts with a URL. Validate absolute HTTPS URLs and fill in the site, path and Manual source automatically; validate URL edits too.
+28
View File
@@ -130,7 +130,35 @@
</dependencies>
<build>
<resources>
<!-- help bundles carry the artifact version (QQQ help bundle provenance) -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>help/*.yaml</include>
<include>qbit-web-performance.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>help/*.yaml</exclude>
<exclude>qbit-web-performance.properties</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables combine.children="append">
<qbit.artifactVersion>${project.version}</qbit.artifactVersion>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
@@ -21,8 +21,11 @@
package com.kingsrook.qbits.webperf;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import com.kingsrook.qbits.webperf.metadata.WebPerfMetaData;
import com.kingsrook.qqq.backend.core.exceptions.QException;
import com.kingsrook.qqq.backend.core.logging.QLogger;
@@ -62,13 +65,41 @@ public class WebPerfQBitProducer implements QBitMetaDataProducer<WebPerfQBitConf
public static final String GROUP_ID = "com.kingsrook.qbits";
public static final String ARTIFACT_ID = "web-performance";
public static final String VERSION = "0.1.0";
public static final String VERSION = loadVersion();
private WebPerfQBitConfig qBitConfig;
private String namespace;
/*******************************************************************************
** Read the artifact version from the Maven-filtered properties resource.
*******************************************************************************/
private static String loadVersion()
{
try(InputStream inputStream = WebPerfQBitProducer.class.getClassLoader().getResourceAsStream("qbit-web-performance.properties"))
{
if(inputStream == null)
{
throw (new IllegalStateException("Missing qbit-web-performance.properties; build with Maven to generate the artifact version"));
}
Properties properties = new Properties();
properties.load(inputStream);
String version = properties.getProperty("version");
if(version == null || version.isBlank() || version.contains("${"))
{
throw (new IllegalStateException("Missing or unfiltered version in qbit-web-performance.properties; build with Maven"));
}
return (version);
}
catch(IOException e)
{
throw (new IllegalStateException("Could not read artifact version from qbit-web-performance.properties", e));
}
}
/*******************************************************************************
** Fluent setter for the config.
**
@@ -1,5 +1,5 @@
bundle: qbit-web-performance
version: 0.1.0-SNAPSHOT
version: ${project.version}
layer: QBIT
entries:
- key: app:webPerformance;slot:help
@@ -0,0 +1 @@
version=${project.version}
@@ -45,7 +45,13 @@ class WebPerfHelpBundleTest
assertThat(qInstance.getTable("helpContent")).isNull();
assertThat(HelpBundles.of(qInstance).getBundles()).singleElement()
.satisfies(bundle -> assertThat(bundle.getId()).isEqualTo("qbit-web-performance"));
.satisfies(bundle ->
{
assertThat(bundle.getId()).isEqualTo("qbit-web-performance");
assertThat(System.getProperty("qbit.artifactVersion")).isNotBlank();
assertThat(bundle.getVersion()).isEqualTo(System.getProperty("qbit.artifactVersion"))
.isEqualTo(WebPerfQBitProducer.VERSION);
});
HelpBundleAssertions.forInstance(qInstance)
.bundles("help/qbit-web-performance.yaml")
.owning(target -> target.name().startsWith("web_performance_") || target.name().startsWith("webPerformance"))
@@ -74,6 +74,9 @@ class WebPerfQBitProducerTest
@Test
void testRegistersIntoAFreshInstance() throws Exception
{
assertThat(System.getProperty("qbit.artifactVersion")).isNotBlank();
assertThat(WebPerfQBitProducer.VERSION).isEqualTo(System.getProperty("qbit.artifactVersion"));
assertThat(new WebPerfQBitProducer().getQBitMetaData().getVersion()).isEqualTo(WebPerfQBitProducer.VERSION);
QInstance qInstance = WebPerfTestSupport.newInstance();
new WebPerfQBitProducer().withQBitConfig(WebPerfTestSupport.config()
.withUrlSource(new SitemapUrlSource("https://www.example.com/sitemap.xml"))