Skip to content

Conversation

adityaraj178
Copy link
Contributor

closes: #23817

Changes made:
Update the code so that when an Application has sourceHydrator configured the revision provided will be applied to the DrySource, not to the SyncSource.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@adityaraj178 adityaraj178 requested a review from a team as a code owner September 20, 2025 15:51
Copy link

bunnyshell bot commented Sep 20, 2025

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-icyxa7.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-icyxa7.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@adityaraj178 adityaraj178 force-pushed the diff-manifest-cmd-sourceHydrator branch from 1e60695 to 821e0d5 Compare September 20, 2025 19:39
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.52%. Comparing base (f960274) to head (821e0d5).

Files with missing lines Patch % Lines
server/application/application.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #24670      +/-   ##
==========================================
+ Coverage   60.46%   60.52%   +0.06%     
==========================================
  Files         350      350              
  Lines       60187    60195       +8     
==========================================
+ Hits        36390    36431      +41     
+ Misses      20859    20833      -26     
+ Partials     2938     2931       -7     

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

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

Thanks! One request

Comment on lines 533 to 536
if q.GetRevision() != "" {
source.TargetRevision = q.GetRevision()
}
sources = append(sources, source)
Copy link
Member

Choose a reason for hiding this comment

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

Since this part is common to both blocks, move it outside the if/else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hii @crenshaw-dev, thanks for the review
made the changes. Also, about the build failure, it looks like a flaky test, could you confirm?

@adityaraj178 adityaraj178 force-pushed the diff-manifest-cmd-sourceHydrator branch from eb9fcdb to af0fd5f Compare September 22, 2025 05:43
@adityaraj178 adityaraj178 force-pushed the diff-manifest-cmd-sourceHydrator branch from af0fd5f to f3a7839 Compare September 22, 2025 07:32
if a.Spec.SourceHydrator != nil {
source = a.Spec.SourceHydrator.GetDrySource()
} else {
source = a.Spec.GetSource()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
source = a.Spec.GetSource()
source = a.Spec.GetSource()

how will this work for a multi-source application?

Copy link
Member

Choose a reason for hiding this comment

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

shouldn't there be changes to be made at line 514 to handle multi-source application logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hii @nitishfy,
[HasMultipleSources()] returns false for SourceHydrator apps (since it checks spec.SourceHydrator == nil) and it handles multiple source case well
now single-source apps go to the else branch and here it got divided into sourceHydrator and non-sourceHydrator.
Multi-source apps will take the if branch(line 514) and never reach line 529.

Isn't sourceHydrator is mutually exclusive with multi-source, they can't be used together.

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.

Hydrator: Cannot use argocd app diff and manifest CLI command with DRY revision
3 participants