Skip to content

feat: use server side apply for dry runs where possible #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a-buck
Copy link

@a-buck a-buck commented May 21, 2025

Hi, excited to say this is my first PR to the argoproj. This PR proposes a solution to issue #631. I am very happy to write up this proposal more formally in a design doc, comment to an existing issue or a new one if preferred - please let me know if any preference.

Proposal
This PR proposes that Dry Run syncs leverage server side apply for rich validation and feedback in the spirit of shifting left. For us at least, this would be very useful to improve parity of feedback between pre merge and post merge CI builds - surfacing feedback from various validation webhooks and policies.

Notably server side apply dry runs and the auto-create namespace feature are not compatible - the server side dry run feedback would just fail that the namespace does not exist. Therefore this PR proposes that in this case we fall back to client side apply.

alternatives

I see 2 alternatives:

  • return an error to the user if a sync is performed where: server side apply is enabled, dry run is enabled, auto namespace creation is enabled. This approach would have the benefit of not being misleading (with the current proposal it is not obvious that a client side apply is being used as a fallback )

  • do nothing and stick with client side apply. I would like to advocate strongly against this route as server side apply has the potential to give much richer feedback to users. At least for us there is a lot of value in using server side apply for dry runs with the amount of validation policies and so forth we have.

@a-buck a-buck requested a review from a team as a code owner May 21, 2025 22:19
@a-buck a-buck force-pushed the serverSideApplyForResourceCreationDryRuns branch from 07d939f to 1fe1455 Compare May 21, 2025 22:20
Copy link

codecov bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.86%. Comparing base (8849c3f) to head (bd6cd7c).
Report is 46 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #725      +/-   ##
==========================================
- Coverage   54.26%   53.86%   -0.41%     
==========================================
  Files          64       64              
  Lines        6164     6500     +336     
==========================================
+ Hits         3345     3501     +156     
- Misses       2549     2726     +177     
- Partials      270      273       +3     

☔ 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.

Previously dry runs would always use client side apply. This is because server side apply is not compatible with the namespace auto creation feature - since the server side validation fails in this case (as expected).

This change uses server side apply for dry runs where ServerSideApply=true option is set, but not in the case where the CreateNamespace=true option is set.

An alternative would be to return an error if both auto-create namespace and server side apply options were set for dry runs. However this would be more of a breaking change

Signed-off-by: abuck <[email protected]>
@a-buck a-buck force-pushed the serverSideApplyForResourceCreationDryRuns branch from 1fe1455 to bd6cd7c Compare May 22, 2025 07:39
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant