From 6a4ea584f57e76c405e8804c6ef1887e7d4358aa Mon Sep 17 00:00:00 2001 From: James Maes Date: Thu, 15 Oct 2026 01:27:45 -0500 Subject: [PATCH] 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-collaboration.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 --- CHANGELOG.md | 2 ++ pom.xml | 2 ++ .../CollaborationQBitProducer.java | 33 ++++++++++++++++++- .../resources/qbit-collaboration.properties | 1 + .../CollaborationTablesGuardrailTest.java | 2 +- .../collaboration/CollaborationTest.java | 2 +- 6 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/qbit-collaboration.properties diff --git a/CHANGELOG.md b/CHANGELOG.md index 508b3ac..ff50b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ All notable changes are documented here, following [Keep a Changelog](https://ke ### Fixed +- QBit metadata reports the Maven artifact version from a filtered resource, including release versions. + - Timeline audit summaries read "Edited by Alice Morgan: Title, Total" or "Created by Alice Morgan" instead of "Record was Edited"; detail rows are unchanged. - The demo server chooses its user per browser session (`?user=bob`, remembered in a cookie) instead of once per JVM, and sends the person's name to the frontend so it no longer shows Anonymous. - The share recipient search and mention candidates no longer offer the caller to themself. diff --git a/pom.xml b/pom.xml index 7fa52b4..4797772 100644 --- a/pom.xml +++ b/pom.xml @@ -120,6 +120,7 @@ true help/*.yaml + qbit-collaboration.properties @@ -127,6 +128,7 @@ false help/*.yaml + qbit-collaboration.properties diff --git a/src/main/java/com/kingsrook/qbits/collaboration/CollaborationQBitProducer.java b/src/main/java/com/kingsrook/qbits/collaboration/CollaborationQBitProducer.java index ca2790c..d78ac37 100644 --- a/src/main/java/com/kingsrook/qbits/collaboration/CollaborationQBitProducer.java +++ b/src/main/java/com/kingsrook/qbits/collaboration/CollaborationQBitProducer.java @@ -22,6 +22,9 @@ package com.kingsrook.qbits.collaboration; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; import com.kingsrook.qbits.collaboration.app.CollaborationHome; import com.kingsrook.qbits.collaboration.attachments.DeleteAttachmentsProcess; import com.kingsrook.qbits.collaboration.model.CollaborationTables; @@ -44,13 +47,41 @@ public class CollaborationQBitProducer implements QBitMetaDataProducer { assertThat(bundle.getId()).isEqualTo("qbit-collaboration"); - assertThat(bundle.getVersion()).as("the help bundle carries the artifact version").isEqualTo(System.getProperty("qbit.artifactVersion")); + assertThat(bundle.getVersion()).as("the help bundle carries the artifact version").isEqualTo(System.getProperty("qbit.artifactVersion")).isEqualTo(CollaborationQBitProducer.VERSION); assertThat(bundle.getEntries()).anyMatch(entry -> entry.getKey().equals("app:collaboration;slot:help")); }); } diff --git a/src/test/java/com/kingsrook/qbits/collaboration/CollaborationTest.java b/src/test/java/com/kingsrook/qbits/collaboration/CollaborationTest.java index a029f6b..466cf3c 100644 --- a/src/test/java/com/kingsrook/qbits/collaboration/CollaborationTest.java +++ b/src/test/java/com/kingsrook/qbits/collaboration/CollaborationTest.java @@ -146,7 +146,7 @@ class CollaborationTest assertThat(producer.isEnabled()).isTrue(); assertThat(producer.getQBitConfig()).isSameAs(config); assertThat(producer.getNamespace()).isEqualTo("collaboration"); - assertThat(producer.getQBitMetaData().getVersion()).isEqualTo("0.1.0"); + assertThat(producer.getQBitMetaData().getVersion()).isEqualTo(System.getProperty("qbit.artifactVersion")).isEqualTo(CollaborationQBitProducer.VERSION); assertThat(producer.getQBitMetaData().getArtifactId()).isEqualTo("qbit-collaboration"); assertThat(config.getDefaultBackendNameForTables()).isEqualTo("memory"); assertThat(config.getAdminApp()).isTrue(); -- 2.54.0