Repository navigation
Record bind history outside StateDB - #7817
shreyas-goenka wants to merge 1 commit into
Conversation
a99be74 to
e02cd13
Compare
|
Commit: Regression test reportSelected 20 changed tests (limit=20, 2 not selected) 26 tests: regression=16 unreleased=0 coverage=10 failing=0
TestAccept/bundle/deployment/bind/feature_spec/DMS=true/OUTPUT_MODE=recorded: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌main (f4a7fe5): latest (v1.27.0): TestAccept/bundle/dms/bind-immutable/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌main (f4a7fe5): latest (v1.27.0): same output as main (f4a7fe5) TestAccept/bundle/dms/bind-unbind/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌main (f4a7fe5): latest (v1.27.0): TestAccept/bundle/dms/bind-upload-failure/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌main (f4a7fe5): latest (v1.27.0): TestAccept/bundle/dms_fault/complete_version/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌main (f4a7fe5): latest (v1.27.0): TestAccept/bundle/dms_fault/create_deployment/DMS=true: branch ✅ | main (f4a7fe5) ❌ | latest (v1.27.0) ❌main (f4a7fe5): latest (v1.27.0): 10 more failure details omitted, see the full report in the run. |
1841b1a to
fbccb43
Compare
✅ Integration test reportCommit: 40d560d
Top 3 slowest tests (at least 2 minutes):
|
fbccb43 to
51ec50c
Compare
| @@ -0,0 +1,5 @@ | |||
|
|
|||
| >>> [CLI] bundle deployment bind spec1 main.fspec_[UNIQUE_NAME].boundspec --auto-approve | |||
| Warn: Failed to record deployment history for bind: failed to create deployment version: operations.resource_key must have a known resource type prefix (e.g. 'jobs.', 'pipelines.'): feature_specs.spec1 | |||
There was a problem hiding this comment.
I'm taking a look whether we need to add feature_spec as a resource to DMS.
51ec50c to
c2454aa
Compare
| $CLI bundle deployment bind kept "$job_id" --auto-approve &> LOG.setup | ||
| rm -f "$OUT_REQUESTS" | ||
|
|
||
| title "A remote state upload failure fails the bind version" |
There was a problem hiding this comment.
Because of API failing, the remote deployment state is not updated. In this case, deployment history does capture the bind operation but marks it as a failed version.
c2454aa to
365bce7
Compare
365bce7 to
40d560d
Compare
|
/review |
There was a problem hiding this comment.
Automated review at 40d560d. Each finding was verified against the code.
No blocking issues found. 1 non-blocking comment(s) below.
This PR records committed bundle deployment bind operations as UPDATE versions in deployment history (DMS), running outside the StateDB. The implementation is correct: it creates a history version after bind commits, completes it after the remote state upload, handles failures gracefully with best-effort semantics, and has thorough fault-injection test coverage. The main concern is that createBindingVersion closely replicates DMS protocol logic already in dms.go, creating a maintenance risk.
| } | ||
|
|
||
| // createBindingVersion claims a history version for the staged binding operations. | ||
| func createBindingVersion(ctx context.Context, b *bundle.Bundle, serial int, staged []bundledeployments.StagedOperation) (*bindingHistory, error) { |
There was a problem hiding this comment.
[nice to have] createBindingVersion re-implements the create-deployment-if-absent block (lines 237–251, including the recoverCreatedDeployment fallback and DeploymentIDFromName extraction) and the git-info + CreateVersion construction (lines 255–270) that already live in createOrUpdateDeployment (dms.go:83–98) and startVersion (dms.go:220–241). A protocol change—say a new field on CreateVersion or a tweaked recovery rule—now needs updating in both places. Can you extract at least the "ensure deployment exists" block and the version-info builder into shared helpers that both paths call?
Changes
Record committed
bundle deployment bindoperations asUPDATEin deployment history. Recording is best effort and runs separately from StateDB, after approval and the existing temporary-file commit.Why
Bind changes resource state without recording history today. This preserves the existing preparation flow, two state writes, and serial increments. Bind omits uploaded-file metadata; existing deployment metadata is preserved.
Stacked on #7816.
Tests
This PR was written by Codex.