Skip to content

Update deployment trigger sync strategy based on planned step output#6274

Merged
khanhtc1202 merged 1 commit into
masterfrom
update-deployment-sync-strategy
Sep 29, 2025
Merged

Update deployment trigger sync strategy based on planned step output#6274
khanhtc1202 merged 1 commit into
masterfrom
update-deployment-sync-strategy

Conversation

@khanhtc1202
Copy link
Copy Markdown
Member

What this PR does:

SSIA

Why we need it:

If users trigger deployment under the AUTO strategy, the value stored in model.deployment.trigger.sync_strategy remains as is while executing the deployment. That makes later logic depend on the deployment's strategy value work unexpectedly, since we only support QUICK_SYNC and PIPELINE_SYNC. The AUTO strategy will be inferred to one of QUICK or PIPELINE sync by the planning step; thus, the value in the deployment model should be updated to reflect the inferred output.

Which issue(s) this PR fixes:

Fixes #6207

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.78%. Comparing base (e4beafb) to head (0543a2f).
⚠️ Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
pkg/datastore/datastoretest/datastore.mock.go 0.00% 4 Missing ⚠️
pkg/datastore/deploymentstore.go 50.00% 2 Missing ⚠️
pkg/app/pipedv1/controller/planner.go 0.00% 1 Missing ⚠️
pkg/app/server/grpcapi/piped_api.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6274   +/-   ##
=======================================
  Coverage   28.78%   28.78%           
=======================================
  Files         560      560           
  Lines       59813    59816    +3     
=======================================
+ Hits        17215    17216    +1     
- Misses      41279    41281    +2     
  Partials     1319     1319           
Flag Coverage Δ
. 23.23% <20.00%> (+<0.01%) ⬆️
.-pkg-app-pipedv1-plugin-analysis 32.64% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 58.35% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 67.63% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 39.56% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 35.51% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval 55.73% <ø> (ø)
.-pkg-plugin-sdk 50.47% <ø> (ø)
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@khanhtc1202 khanhtc1202 enabled auto-merge (squash) September 26, 2025 08:28
Copy link
Copy Markdown
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost LGTM, let me confirm one point


req := &pipedservice.ReportDeploymentPlannedRequest{
DeploymentId: p.deployment.Id,
SyncStrategy: out.SyncStrategy,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ASK] I think pipedv0 needs the same logic, is that correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly. Pipedv0 can also have this logic, but the current pipedv0 stage executing steps logic doesn't depend on the deployment sync strategy value, so the same issue we faced on pipedv1 has not occurred.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aka. issue #6207 only occurred on the pipedv1 application deployment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@khanhtc1202 khanhtc1202 merged commit f7660ee into master Sep 29, 2025
45 of 46 checks passed
@khanhtc1202 khanhtc1202 deleted the update-deployment-sync-strategy branch September 29, 2025 03:40
This was referenced Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure deployment trigger sync strategy be reflected after planning step

2 participants