Compare commits

..
Author SHA1 Message Date
CircleCI 3002dd4472 Bump version to 0.1.0-RC.6 [skip ci] 2026-10-16 16:05:16 +00:00
github-actions[bot] 86efefbe6a Merge develop into release/0.1 for the next 0.1.0 RC 2026-10-16 16:02:50 +00:00
james.maes b00fb256b6 Merge pull request #17 from QRun-IO/feature/page-speed-business-home
feat(home): business-only Page Speed home; setup and run queue become admin widgets
2026-10-16 10:19:44 -05:00
james.maesandClaude Opus 5.5 a6c6c99e11 feat(home): business-only Page Speed home; provider setup and run queue become admin widgets
Replace the provider Setup card on the home with a business "not set up"
empty state (no config key names, empty once configured). Setup and Recent
Runs leave the home and become WebPerfWidgets.ADMIN, gated to
<base>.admin.hasAccess with DenyBehavior.HIDDEN, for a host Admin area.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:12:51 -05:00
james.maes 0b8b9f8214 Merge pull request #16 from QRun-IO/ci/release-rc-secrets-inherit
ci(release-rc): pass secrets so the shared workflow can sign the RC tag
2026-10-16 08:05:25 -05:00
james.maesandClaude Opus 5.5 483c3d48b3 ci(release-rc): pass secrets to the shared workflow so it can sign the RC tag
QRun-IO/.github#2 adds a tag-and-release job that signs vX with the
QRUN_TAG_SIGNING_KEY secret after Maven Central confirms the artifact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:20:28 -05:00
james.maes 6e6deca794 Merge pull request #15 from QRun-IO/fix/producer-version-from-build
fix: qbit metadata version comes from the build
2026-10-15 01:42:58 -05:00
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
CircleCI ea9a7b916d Bump version to 0.1.0-RC.5 [skip ci] 2026-10-15 02:44:36 +00:00
james.maesandClaude Opus 5.5 30f7adfa10 Merge develop into release/0.1 for 0.1.0-RC.5 (#13 help bundle)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 21:41:29 -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
CircleCI cfce62b3ed Bump version to 0.1.0-RC.4 [skip ci] 2026-10-14 23:25:29 +00:00
james.maesandClaude Opus 5.5 89b4102833 Merge develop into release/0.1 for 0.1.0-RC.4 (#11 indexes and FKs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:22:24 -05:00
CircleCI 805d2e336f Bump version to 0.1.0-RC.3 [skip ci] 2026-10-14 22:34:27 +00:00
james.maesandClaude Opus 5.5 7d5582266d Merge develop into release/0.1 for 0.1.0-RC.3 (#12 setup card, seeds, help)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:31:43 -05:00
CircleCI 51b8608896 Bump version to 0.1.0-RC.2 [skip ci] 2026-10-14 16:08:01 +00:00
james.maesandClaude Opus 5.5 1521906bca Merge develop into release/0.1 for 0.1.0-RC.2 (#9 #10)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 11:04:15 -05:00
CircleCI 1cd3c0e883 Bump version to 0.1.0-RC.1 [skip ci] 2026-10-13 01:16:11 +00:00
12 changed files with 206 additions and 10 deletions

No files matched your search

+1
View File
@@ -21,5 +21,6 @@ jobs:
release-rc:
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release:rc'))
uses: QRun-IO/.github/.github/workflows/qbit-release-rc.yml@main
secrets: inherit
with:
dry_run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}
+4
View File
@@ -4,7 +4,11 @@ All notable changes to this project are documented here. The format follows Keep
## [0.1.0] - Unreleased
### Changed
- The Performance home is business-only. The provider Setup readout and Recent Runs left the home's widget list (`WebPerfWidgets.HOME`); they are `WebPerfWidgets.ADMIN` (`Setup`, `RecentRuns`), gated to `<base>.admin.hasAccess` and hidden when denied, for a host to place on its Admin area. A new `NotConfigured` widget leads the home: while no Google API key is set it says "Page speed testing is not set up. Ask an admin to add a Google PageSpeed API key." (no config key names), and renders nothing once configured.
### 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.
+4
View File
@@ -1,5 +1,9 @@
# Upgrading
## Business-only home; admin widgets (unreleased)
No DDL change. The Setup and Recent Runs widgets are no longer on the Performance home. They are still registered (`webPerformanceSetup`, `webPerformanceRecentRuns`), gated to `web_performance.admin.hasAccess` and hidden without it; add `WebPerfWidgets.ADMIN` (qualified with `config.qualify`) to your Admin app's widgets to keep them. The home gains a `webPerformanceNotConfigured` widget that shows only while no Google API key is set.
## Table help, Setup card and `reportRetentionDays` (unreleased)
No DDL change, no new changeset and no host include change. The qbit now fills empty `help` slots on its app and tables (help a host set is kept) and adds a Setup widget to the Performance home. `reportRetentionDays` (default 0, keep forever) is now enforced: set it above 0 only if you want Lighthouse Reports older than that many days deleted.
+29 -1
View File
@@ -18,7 +18,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<properties>
<revision>0.1.0-SNAPSHOT</revision>
<revision>0.1.0-RC.6</revision>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<jacoco.version>0.8.15</jacoco.version>
@@ -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.
**
@@ -50,6 +50,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldType;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QAppSection;
import com.kingsrook.qqq.backend.core.model.metadata.layout.QIcon;
import com.kingsrook.qqq.backend.core.model.metadata.permissions.DenyBehavior;
import com.kingsrook.qqq.backend.core.model.metadata.permissions.PermissionLevel;
import com.kingsrook.qqq.backend.core.model.metadata.permissions.QPermissionRules;
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValue;
@@ -129,13 +130,15 @@ public final class WebPerfMetaData
{
qInstance.addProcess(process);
}
addWidget(qInstance, WebPerfWidgets.SETUP, "Setup", WidgetType.HTML, WebPerfWidgets.Setup.class);
addWidget(qInstance, WebPerfWidgets.NOT_CONFIGURED, "Page Speed Setup", WidgetType.HTML, WebPerfWidgets.NotConfigured.class);
qInstance.getWidget(config.qualify(WebPerfWidgets.NOT_CONFIGURED)).setIsCard(false);
addAdminWidget(qInstance, WebPerfWidgets.SETUP, "Page Speed Setup (Admin)", WebPerfWidgets.Setup.class);
addWidget(qInstance, WebPerfWidgets.SITE_SCORES, "Site Scores", WidgetType.HTML, WebPerfWidgets.SiteScores.class);
addWidget(qInstance, WebPerfWidgets.TREND, "Performance Trend", WidgetType.LINE_CHART, WebPerfWidgets.Trend.class);
addWidget(qInstance, WebPerfWidgets.SLOWEST_PAGES, "Slowest Pages", WidgetType.HTML, WebPerfWidgets.SlowestPages.class);
addWidget(qInstance, WebPerfWidgets.OPPORTUNITIES, "Top Opportunities", WidgetType.HTML, WebPerfWidgets.TopOpportunities.class);
addWidget(qInstance, WebPerfWidgets.FIELD_STATUS, "Google Field Data", WidgetType.HTML, WebPerfWidgets.FieldDataStatus.class);
addWidget(qInstance, WebPerfWidgets.RECENT_RUNS, "Recent Runs", WidgetType.HTML, WebPerfWidgets.RecentRuns.class);
addAdminWidget(qInstance, WebPerfWidgets.RECENT_RUNS, "Recent Runs", WebPerfWidgets.RecentRuns.class);
addWidget(qInstance, WebPerfWidgets.RECORD_PANEL, "Performance", WidgetType.HTML, WebPerfWidgets.RecordPanel.class);
List<String> panelTables = new ArrayList<>(config.getContentTables());
@@ -258,6 +261,20 @@ public final class WebPerfMetaData
/*******************************************************************************
** A system widget for a host's Admin area (WebPerfWidgets.ADMIN): gated to
** "<base>.admin.hasAccess" and HIDDEN, never a locked shell, when denied.
*******************************************************************************/
private void addAdminWidget(QInstance qInstance, String name, String label, Class<? extends AbstractWidgetRenderer> renderer)
{
addWidget(qInstance, name, label, WidgetType.HTML, renderer);
qInstance.getWidget(config.qualify(name)).setPermissionRules(new QPermissionRules().withLevel(PermissionLevel.HAS_ACCESS_PERMISSION)
.withPermissionBaseName(config.getPermissionBaseName() + ".admin")
.withDenyBehavior(DenyBehavior.HIDDEN));
}
/*******************************************************************************
** The Performance app: its one home (the widgets) and the data tables.
** No process is in its nav.
@@ -59,6 +59,7 @@ import com.kingsrook.qqq.backend.core.model.dashboard.widgets.RawHTML;
public final class WebPerfWidgets
{
public static final String SETUP = "Setup";
public static final String NOT_CONFIGURED = "NotConfigured";
public static final String SITE_SCORES = "SiteScores";
public static final String TREND = "Trend";
public static final String SLOWEST_PAGES = "SlowestPages";
@@ -67,8 +68,18 @@ public final class WebPerfWidgets
public static final String FIELD_STATUS = "FieldDataStatus";
public static final String RECORD_PANEL = "RecordPanel";
/** The home widgets, in order. */
public static final List<String> HOME = List.of(SETUP, SITE_SCORES, TREND, SLOWEST_PAGES, OPPORTUNITIES, FIELD_STATUS, RECENT_RUNS);
/** The business home's widgets, in order. No provider or run-queue detail (standard A-0). */
public static final List<String> HOME = List.of(NOT_CONFIGURED, SITE_SCORES, TREND, SLOWEST_PAGES, OPPORTUNITIES, FIELD_STATUS);
/**
* The system widgets (provider setup readout, run queue). Not on the home: a host places them on its
* Admin area. Each is gated to "&lt;base&gt;.admin.hasAccess" and hidden (not shown locked) without it.
*/
public static final List<String> ADMIN = List.of(SETUP, RECENT_RUNS);
/** The business empty state shown on the home while no Google API key is set. */
public static final String NOT_CONFIGURED_TITLE = "Page speed testing is not set up";
public static final String NOT_CONFIGURED_BODY = "Ask an admin to add a Google PageSpeed API key.";
static final int TREND_WEEKS = 26;
@@ -416,6 +427,29 @@ public final class WebPerfWidgets
/*******************************************************************************
** Not Configured: the home's business empty state. Shown only while lab tests
** cannot run because no Google API key is set; says who can fix it and names
** no configuration key. Renders nothing once the provider is configured.
*******************************************************************************/
public static class NotConfigured extends AbstractWidgetRenderer
{
/*******************************************************************************
** Render.
*******************************************************************************/
@Override
public RenderWidgetOutput render(RenderWidgetInput input) throws QException
{
if(runtime(input).labRunner() != null)
{
return (html(""));
}
return (html("<div style=\"font-weight:600\">" + Html.escape(NOT_CONFIGURED_TITLE) + "</div>" + Html.muted(NOT_CONFIGURED_BODY)));
}
}
/*******************************************************************************
** Setup: what is configured (pages, lab runner, budgets, field data) and
** the next step for each (WebPerfSetupStatus).
@@ -1,11 +1,11 @@
bundle: qbit-web-performance
version: 0.1.0-SNAPSHOT
version: ${project.version}
layer: QBIT
entries:
- key: app:webPerformance;slot:help
summary: Page speed tests, Google field data, budgets and regressions for your site.
content: |
Use the Setup card to see what is configured and what to do next. Sync your pages, configure a lab runner and review your budgets. The dashboard shows site scores, trends, slow pages, opportunities, field data and recent runs.
Sync your pages and review your budgets, then run tests. The dashboard shows site scores, trends, slow pages, opportunities and field data. If page speed testing is not set up, it says so and tells you to ask an admin.
Run **{{label:webPerformanceTestPageSpeed}}** for selected pages or **{{label:webPerformanceRunSiteAudit}}** for all enabled pages. Mobile and desktop are separate runs by default. Your host controls the enabled features, device strategies, daily run limit and scheduler. Without a configured runner, lab tests wait in the queue.
@@ -623,7 +623,9 @@ entries:
content: |
The scheduled check records observations in **{{label:web_performance_change_event}}**. Repeated observations update the existing event instead of creating duplicates.
- key: widget:webPerformanceSetup;slot:label
summary: Check your tested pages, lab runner, budgets and field-data setup, with the next step for each.
summary: Admin only. Check your tested pages, lab runner, budgets and field-data setup, with the next step for each.
- key: widget:webPerformanceNotConfigured;slot:label
summary: Says when page speed testing is not set up and who can fix it.
- key: possibleValueSource:web_performance_target;slot:help
summary: Choose a tested page.
- key: possibleValueSource:web_performance_lab_run;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"))
@@ -86,6 +86,71 @@ class WebPerfP1Test
/*******************************************************************************
** The business home has no provider setup readout and no run-queue widget;
** those are the admin-placeable list.
*******************************************************************************/
@Test
void testHomeIsBusinessOnly()
{
List<String> home = qInstance.getApp(config.getAppName()).getWidgets();
assertThat(home).doesNotContain(config.qualify(WebPerfWidgets.SETUP), config.qualify(WebPerfWidgets.RECENT_RUNS));
assertThat(WebPerfWidgets.HOME).doesNotContain(WebPerfWidgets.SETUP, WebPerfWidgets.RECENT_RUNS);
assertThat(WebPerfWidgets.ADMIN).containsExactly(WebPerfWidgets.SETUP, WebPerfWidgets.RECENT_RUNS);
assertThat(home).contains(config.qualify(WebPerfWidgets.SITE_SCORES), config.qualify(WebPerfWidgets.TREND), config.qualify(WebPerfWidgets.SLOWEST_PAGES),
config.qualify(WebPerfWidgets.OPPORTUNITIES), config.qualify(WebPerfWidgets.FIELD_STATUS));
for(String name : WebPerfWidgets.ADMIN)
{
assertThat(qInstance.getWidget(config.qualify(name))).as(name + " is still defined for a host to place").isNotNull();
}
}
/*******************************************************************************
** Unconfigured: a business empty state naming no config key. Configured:
** nothing at all.
*******************************************************************************/
@Test
void testNotConfiguredEmptyState() throws Exception
{
assertThat(html(WebPerfWidgets.NOT_CONFIGURED, Map.of())).as("configured shows nothing").isEmpty();
config.withLabRunner(null).withCruxClient(null);
String card = html(WebPerfWidgets.NOT_CONFIGURED, Map.of());
assertThat(card).contains("Page speed testing is not set up").contains("Ask an admin to add a Google PageSpeed API key.");
assertThat(card).doesNotContain("googleApiKey").doesNotContain("qbit config").doesNotContain("environment variable");
}
/*******************************************************************************
** The admin widgets render for an admin, and are hidden (permission denied
** under enforcement) for a session without the admin permission.
*******************************************************************************/
@Test
void testAdminWidgetsAdminOnly() throws Exception
{
for(String name : WebPerfWidgets.ADMIN)
{
assertThat(html(name, Map.of())).as(name + " for an admin").isNotEmpty();
}
WebPerfTestSupport.login(qInstance, "web_performance.read", "web_performance.write", "web_performance.view.hasAccess");
for(String name : WebPerfWidgets.ADMIN)
{
assertThat(qInstance.getWidget(config.qualify(name)).getPermissionRules().getDenyBehavior()).isEqualTo(com.kingsrook.qqq.backend.core.model.metadata.permissions.DenyBehavior.HIDDEN);
RenderWidgetInput input = new RenderWidgetInput().withWidgetMetaData(qInstance.getWidget(config.qualify(name)));
input.setPermissionEnforcement(com.kingsrook.qqq.backend.core.actions.permissions.PermissionEnforcement.ENFORCE);
org.junit.jupiter.api.Assertions.assertThrows(com.kingsrook.qqq.backend.core.exceptions.QPermissionDeniedException.class,
() -> new RenderWidgetAction().execute(input), name + " must not render without admin");
assertThat(com.kingsrook.qqq.backend.core.actions.permissions.PermissionsHelper.hasWidgetPermission(input, config.qualify(name))).isFalse();
}
assertThat(html(WebPerfWidgets.SITE_SCORES, Map.of())).as("business widgets still render").isNotEmpty();
}
/*******************************************************************************
** An instance with a content table "page", the QBit wired to it, and the
** local Google stand-in.
@@ -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"))