diff --git a/.circleci/config.yml b/.circleci/config.yml index 23c1a84..f890c28 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,12 @@ version: 2.1 setup: true orbs: - qqq-orb: kingsrook/qqq-orb@0.7.15 + qqq-orb: kingsrook/qqq-orb@0.8 workflows: setup: jobs: - qqq-orb/generate_pipeline: - orb_version: 0.7.15 + orb_version: '0.8' filters: branches: ignore: automation/qbit-rc-pending diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..ce00351 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,7 @@ +name: build +on: + push: +jobs: + maven: + uses: self:KofTwentyTwo/ci-workflows/.gitea/workflows/maven.yaml@v1 + secrets: inherit diff --git a/.qqq-ci.yml b/.qqq-ci.yml index e32feac..fa97e65 100644 --- a/.qqq-ci.yml +++ b/.qqq-ci.yml @@ -1,5 +1,5 @@ profile: qbit -orb_version: 0.7.15 +orb_version: '0.8' default_branch: develop java_version: '21' browsers: true @@ -13,3 +13,4 @@ publish: release_candidate: true release: true asciidoc: false +release_completion: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 045296e..1a79421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes are documented here, following [Keep a Changelog](https://ke ### Fixed +- Upload-job status transitions no longer use `status` as the table's record-version field. + QQQ 4.1.0-RC.26 advances a configured version field on every update (a STRING version + becomes a random UUID), which overwrote upload status. The guarded transition now re-reads + status inside the existing cross-pod account-lock transaction. The upload-job table no longer + declares a record-version field; no schema or public API change. + - Endpoint pickers for saved views, saved reports and saved bulk-load profiles are dropped when the host has not registered those possible-value sources, so hosts without them validate. diff --git a/pom.xml b/pom.xml index 6d5b9b9..076f3d4 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,7 @@ + 4.1.0-RC.26 0.1.0-RC.6 21 21 @@ -33,7 +34,7 @@ com.kingsrook qbit-build-parent - 2.0.0 + 2.2.1 com.kingsrook.qbits @@ -81,7 +82,7 @@ com.kingsrook.qbits qbit-object-storage - 0.1.0-RC.2 + 0.1.0-RC.10 @@ -117,7 +118,7 @@ com.kingsrook.qqq qqq-frontend-next - 1.0.0-RC.14 + 1.0.0-RC.38 test @@ -239,7 +240,7 @@ - 4.1.0-RC.7 + 4.1.0-RC.26 diff --git a/src/main/java/com/kingsrook/qbits/filegateway/metadata/FileGatewayTables.java b/src/main/java/com/kingsrook/qbits/filegateway/metadata/FileGatewayTables.java index 063ba60..acefacf 100644 --- a/src/main/java/com/kingsrook/qbits/filegateway/metadata/FileGatewayTables.java +++ b/src/main/java/com/kingsrook/qbits/filegateway/metadata/FileGatewayTables.java @@ -297,7 +297,7 @@ public final class FileGatewayTables *******************************************************************************/ private static QTableMetaData upload_job(FileGatewayQBitConfig config) { - QTableMetaData table = base(config, UPLOAD_JOB, "Upload Jobs").withRecordVersionField("status") + QTableMetaData table = base(config, UPLOAD_JOB, "Upload Jobs") .withRecordLabelFormatAndFields("%s", "id") .withField(field("accountId", QFieldType.INTEGER).withPossibleValueSourceName(ACCOUNT)) .withField(field("aliasId", QFieldType.INTEGER).withPossibleValueSourceName(ALIAS)) diff --git a/src/main/java/com/kingsrook/qbits/filegateway/sftp/AuditWriter.java b/src/main/java/com/kingsrook/qbits/filegateway/sftp/AuditWriter.java index 2bb59a0..c11e379 100644 --- a/src/main/java/com/kingsrook/qbits/filegateway/sftp/AuditWriter.java +++ b/src/main/java/com/kingsrook/qbits/filegateway/sftp/AuditWriter.java @@ -24,7 +24,7 @@ package com.kingsrook.qbits.filegateway.sftp; import java.io.Serializable; import java.time.Instant; import java.util.List; -import java.util.Map; +import java.util.Objects; import com.kingsrook.qbits.filegateway.metadata.FileGatewayTables; import com.kingsrook.qqq.backend.core.actions.QBackendTransaction; import com.kingsrook.qqq.backend.core.actions.permissions.CorePermissionEnforcer; @@ -244,18 +244,23 @@ public class AuditWriter /******************************************************************************* - ** Optimistic status transition, called under withAccountLock because core checks - ** expected versions before SQL execution rather than in the SQL WHERE clause. + ** Guarded status transition. Callers hold withAccountLock, so the status re-read in + ** that transaction is serialized across pods; status is compared here rather than + ** through a core record-version field, because core advances version fields on + ** every update (a STRING version becomes a random UUID). *******************************************************************************/ public boolean transitionUpload(QRecord changes, String expectedStatus) throws QException { - QRecord result = system(() -> new UpdateAction().execute(new UpdateInput(FileGatewayTables.UPLOAD_JOB) - .withRecords(List.of(changes)).withTransaction(transaction.get()) - .withExpectedVersions(Map.of(changes.getValue("id"), expectedStatus))).getRecords().getFirst()); - if(result.getErrors() != null && !result.getErrors().isEmpty()) + if(transaction.get() == null) + { + throw (new QException("Upload transitions require the account lock transaction")); + } + var rows = query(FileGatewayTables.UPLOAD_JOB, new QQueryFilter(new QFilterCriteria("id", QCriteriaOperator.EQUALS, changes.getValue("id")))); + if(rows.isEmpty() || !Objects.equals(expectedStatus, rows.getFirst().getValueString("status"))) { return (false); } + update(FileGatewayTables.UPLOAD_JOB, changes); return (true); }