Skip to content
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

feat: new config for excluding fields on history-less resources #760

Merged

Conversation

theurichde
Copy link
Contributor

@theurichde theurichde commented May 30, 2023

What this PR does / why we need it:

This PR introduces a new diff field exclusion configuration for resources without a valid history

Which issue(s) this PR fixes:

Fixes #746

Does this PR introduce a user-facing change?

New diff field exclusion configuration for resources without a valid history

Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


@theurichde
Copy link
Contributor Author

Hello @praveenrewar!

I would like to have a brief review on this draft. I would like to ensure, that I am on the right track here. Unit tests are green, e2e tests are running right at the moment.

Of course, I will add unit tests for this specific feature, too.

Additionally, I would like to refactor it a bit more, but first let's see if the overall approach is the right one ;-)

@praveenrewar
Copy link
Member

Hey @theurichde! Thank you so much for working on this ❤️
At first glance, it looks good to me, I will take a closer look at it in the morning.

@praveenrewar
Copy link
Member

Hi @theurichde, the overall approach looks good to me, as you have mentioned we could do some refactoring, but I think we are in the right direction 🚀

We are completely ignoring the status field from diff, but we should probably ensure that status is available for ytt rebase rules and other places where it is used to determine if the resource is in the desired state (the changes shouldn't effect this functionality as we have an original copy of the resource for other uses but we should double check it to be on the safe side). The e2e tests should cover most of these scenarios except for ytt rebase rules using status field.

pkg/kapp/config/default.go Outdated Show resolved Hide resolved
pkg/kapp/diff/resource_with_history.go Show resolved Hide resolved
@theurichde theurichde force-pushed the 746-diff-in-status-fails-fix branch from 87cf0f3 to 76c9820 Compare June 22, 2023 15:27
@theurichde theurichde marked this pull request as ready for review June 28, 2023 06:38
pkg/kapp/config/default.go Show resolved Hide resolved
test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

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

I feel that the custom_wait_rules_test and order_test are creating a hindrance in this PR and they are not even related to the changes being made. Do you want to pair to quickly wrap this or would you be comfortable if I made a separate (quick) PR to refactor them so they are not effected by the changes being made in this PR (You have spent some time working on them so it's totally fine if you would want to continue and finish it here itself :) )?

test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
test/e2e/custom_wait_rules_test.go Outdated Show resolved Hide resolved
@praveenrewar
Copy link
Member

praveenrewar commented Jun 28, 2023

Do you want to pair to quickly wrap this or would you be comfortable if I made a separate (quick) PR to refactor them so they are not effected by the changes being made in this PR

I just created a PR to refactor those tests, let me know if you would want me to merge it and rebase this PR on top of it or feel free to copy those changes.

@theurichde
Copy link
Contributor Author

want me to merge it and rebase this PR on top of it

Okidoki, go for it 😍

@praveenrewar
Copy link
Member

Okidoki, go for it 😍

Done 🚀

@theurichde theurichde force-pushed the 746-diff-in-status-fails-fix branch from f33db2f to f910030 Compare June 29, 2023 10:02
…rces

Signed-off-by: Tim Heurich <theurichde@users.noreply.github.com>
@theurichde theurichde force-pushed the 746-diff-in-status-fails-fix branch from f910030 to eb2e9d8 Compare June 29, 2023 13:09
Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

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

Thank you so much for working on this @theurichde 🙇🏻

@praveenrewar praveenrewar merged commit 7a75a89 into carvel-dev:develop Jun 30, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

diff in Status field causes conflicts during apply stage in newer version of kapp
3 participants