Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eceb2a6d59
|
||
|
|
3f8ca0ef1f | ||
|
|
e341a90df3
|
||
|
|
a7e6a40924 | ||
|
|
0222074cf9 | ||
|
|
4033590078
|
No files matched your search
+11
-57
@@ -1,60 +1,14 @@
|
||||
version: 2.1
|
||||
|
||||
setup: true
|
||||
orbs:
|
||||
qqq-orb: kingsrook/qqq-orb@0.6.9
|
||||
|
||||
commands:
|
||||
configure-package-install:
|
||||
steps:
|
||||
- run:
|
||||
name: Keep package installation unattended
|
||||
command: |
|
||||
# These build machines are discarded after the job.
|
||||
sudo install -d /etc/needrestart/conf.d
|
||||
printf '%s\n' '$nrconf{restart} = "l";' | sudo tee /etc/needrestart/conf.d/99-qqq-ci.conf >/dev/null
|
||||
|
||||
qqq-orb: kingsrook/qqq-orb@0.7.2
|
||||
workflows:
|
||||
test_only:
|
||||
jobs:
|
||||
- qqq-orb/mvn_test_only:
|
||||
pre-steps:
|
||||
- configure-package-install
|
||||
context: [qqq-maven-registry-credentials]
|
||||
filters:
|
||||
branches:
|
||||
ignore: /(develop|release\/.*)/
|
||||
|
||||
publish_snapshot:
|
||||
jobs:
|
||||
- qqq-orb/mvn_publish:
|
||||
pre-steps:
|
||||
- configure-package-install
|
||||
context: [qqq-maven-registry-credentials]
|
||||
branch_type: snapshot
|
||||
filters:
|
||||
branches:
|
||||
only: [develop]
|
||||
|
||||
publish_release_candidate:
|
||||
jobs:
|
||||
- qqq-orb/mvn_publish:
|
||||
pre-steps:
|
||||
- configure-package-install
|
||||
context: [qqq-maven-registry-credentials]
|
||||
branch_type: release_candidate
|
||||
filters:
|
||||
branches:
|
||||
only: [/release\/.*/]
|
||||
|
||||
publish_release:
|
||||
jobs:
|
||||
- qqq-orb/mvn_publish:
|
||||
pre-steps:
|
||||
- configure-package-install
|
||||
context: [qqq-maven-registry-credentials]
|
||||
branch_type: release
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: [/^v\d+\.\d+\.\d+$/]
|
||||
setup:
|
||||
jobs:
|
||||
- qqq-orb/generate_pipeline:
|
||||
orb_version: 0.7.2
|
||||
filters:
|
||||
branches:
|
||||
ignore: automation/qbit-rc-pending
|
||||
tags:
|
||||
only: /^v\d+\.\d+\.\d+$/
|
||||
@@ -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 }}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
profile: qbit
|
||||
orb_version: 0.7.2
|
||||
default_branch: develop
|
||||
java_version: '21'
|
||||
browsers: true
|
||||
api_checks: false
|
||||
docs_only: false
|
||||
release_on_main: false
|
||||
release_tag_policy: stable
|
||||
test_branch_policy: non-release
|
||||
publish:
|
||||
snapshot: true
|
||||
release_candidate: true
|
||||
release: true
|
||||
asciidoc: false
|
||||
release_completion: false
|
||||
@@ -62,6 +62,7 @@ public class ObjectStorageQBitConfig implements QBitConfig
|
||||
private String appName = "objectStorageAdmin";
|
||||
private String appLabel = "Storage";
|
||||
private String parentAppName;
|
||||
private String tablePathPrefix;
|
||||
private List<String> allowedSecretRefPatterns = new ArrayList<>(SecretRefs.DEFAULT_ALLOWED_PATTERNS);
|
||||
private Integer bulkCap = 10_000;
|
||||
private Boolean bucketScoping = true;
|
||||
@@ -425,6 +426,39 @@ public class ObjectStorageQBitConfig implements QBitConfig
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
** Getter for tablePathPrefix: the front of the links the Storage home makes to
|
||||
** tables and records. Defaults to /app, the route every QQQ frontend serves
|
||||
** tables at (/app/<tableName>).
|
||||
*******************************************************************************/
|
||||
public String getTablePathPrefix()
|
||||
{
|
||||
return (this.tablePathPrefix == null ? "/app" : this.tablePathPrefix);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
** Setter for tablePathPrefix.
|
||||
*******************************************************************************/
|
||||
public void setTablePathPrefix(String tablePathPrefix)
|
||||
{
|
||||
this.tablePathPrefix = tablePathPrefix;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
** Fluent setter for tablePathPrefix.
|
||||
*******************************************************************************/
|
||||
public ObjectStorageQBitConfig withTablePathPrefix(String tablePathPrefix)
|
||||
{
|
||||
this.tablePathPrefix = tablePathPrefix;
|
||||
return (this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************************
|
||||
** Getter for allowedSecretRefPatterns.
|
||||
*******************************************************************************/
|
||||
|
||||
@@ -106,16 +106,12 @@ public final class StorageWidgets
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** The prefix of table and record links.
|
||||
** The prefix of table and record links: /app, so a link is /app/<tableName>
|
||||
** (the frontend serves every table, in any app, at that one flat route).
|
||||
*******************************************************************************/
|
||||
public static String tablePathPrefix()
|
||||
{
|
||||
if(!ObjectStorageRuntime.isInstalled())
|
||||
{
|
||||
return ("/objectStorageAdmin");
|
||||
}
|
||||
ObjectStorageQBitConfig config = ObjectStorageRuntime.getConfig();
|
||||
return (config.getParentAppName() == null ? "/" + config.getAppName() : "/" + config.getParentAppName() + "/" + config.getAppName());
|
||||
return (ObjectStorageRuntime.isInstalled() ? ObjectStorageRuntime.getConfig().getTablePathPrefix() : "/app");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -574,4 +574,40 @@ class MinioIndexTest
|
||||
.contains("Usage trend").contains("collecting since")
|
||||
.contains("Connections").contains("Never tested");
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** Every link the home emits is a /app/<table>[...] route that the Next frontend
|
||||
** resolves, never an /<appName>/<table> path, with data and without.
|
||||
*******************************************************************************/
|
||||
@Test
|
||||
void everyHomeLinkUsesTheAppRoute() throws Exception
|
||||
{
|
||||
String prefix = com.kingsrook.qbits.objectstorage.app.StorageWidgets.tablePathPrefix();
|
||||
assertThat(prefix).isEqualTo("/app");
|
||||
java.util.List<String> hrefs = new java.util.ArrayList<>(hrefs(com.kingsrook.qbits.objectstorage.app.StorageHome.render(prefix, Instant.now())));
|
||||
|
||||
rawPut(target.indexBucket, "media/1/a.jpg", 2048);
|
||||
rawPut(target.indexBucket, "media/9/orphan.jpg", 1024);
|
||||
ObjectIndex.scan("indexed");
|
||||
ObjectIndex.headBacklog("indexed", 10);
|
||||
ReferenceScan.run("indexed");
|
||||
ObjectStorage.bucket("indexed").put(PutRequest.of("media/1/c.jpg", new byte[3]));
|
||||
hrefs.addAll(hrefs(com.kingsrook.qbits.objectstorage.app.StorageHome.render(prefix, Instant.now())));
|
||||
|
||||
assertThat(hrefs).isNotEmpty().allSatisfy(href -> assertThat(href).startsWith("/app/"));
|
||||
assertThat(hrefs).noneMatch(href -> href.contains("objectStorageAdmin"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static java.util.List<String> hrefs(String html)
|
||||
{
|
||||
java.util.List<String> hrefs = new java.util.ArrayList<>();
|
||||
java.util.regex.Matcher m = java.util.regex.Pattern.compile("href=\"([^\"]*)\"").matcher(html);
|
||||
while(m.find())
|
||||
{
|
||||
hrefs.add(m.group(1).replace("&", "&"));
|
||||
}
|
||||
return (hrefs);
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ class TablesAndConfigTest
|
||||
new com.kingsrook.qbits.objectstorage.ObjectStorageQBitProducer().withQBitConfig(config).produce(instance);
|
||||
assertThat(instance.getApp("objectStorageAdmin").getParentAppName()).isEqualTo("admin");
|
||||
assertThat(instance.getApp("admin").getChildren()).extracting(c -> c.getName()).contains("objectStorageAdmin");
|
||||
assertThat(com.kingsrook.qbits.objectstorage.app.StorageWidgets.tablePathPrefix()).isEqualTo("/admin/objectStorageAdmin");
|
||||
assertThat(com.kingsrook.qbits.objectstorage.app.StorageWidgets.tablePathPrefix()).isEqualTo("/app");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user