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

fix: always show accumulation errors #5693

Merged

Conversation

colinodell
Copy link
Contributor

@colinodell colinodell commented May 8, 2024

For accumulation errors when...

  1. The file load fails due to malformed YAML
  2. The base load succeeds without issues
  3. The directory fails to accumulate

... we will now report the accumulation errors up the stack. Previously, only the malformed YAML error was returned, masking the actual accumulation errors that were the real problem.

Sending just the YAML error makes sense in situations where the base load completely fails and we're pretty confident the base isn't actually a base. But, if we were able to successfully load that base, then the YAML error alone is pretty irrelevant because we know the resource was not a file after all.

Fixes #5692

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 8, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @colinodell. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 8, 2024
Copy link
Member

@stormqueen1990 stormqueen1990 left a comment

Choose a reason for hiding this comment

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

Hi there, @colinodell! 👋🏻

Thank you for your contribution!

Could you please cover this scenario with a test?
I'm mostly looking for some coverage that could prevent regressions in the future.

@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 17, 2024
@colinodell
Copy link
Contributor Author

Hi @stormqueen1990,

Writing this test was very difficult, especially since kusttarget_test.go (which was supposed to test the YAML error handling) didn't already cover the bottom half of accumulateResources() 😕 But after a few hours I was able to implement something I'm happy with, partially inspired by how accumulation_test.go uses a test server to mock remote responses. Let me know what you think or if further changes are needed here.

Cheers!

Copy link
Member

@stormqueen1990 stormqueen1990 left a comment

Choose a reason for hiding this comment

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

Hi there, @colinodell! 👋🏻

Thank you very much for your contribution. Appreciate the effort to put together a test for this too! 🙏🏻

/lgtm
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 20, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2024
@colinodell
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2024
@colinodell
Copy link
Contributor Author

/retest

Copy link
Member

@stormqueen1990 stormqueen1990 left a comment

Choose a reason for hiding this comment

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

/lgtm
/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 21, 2024
@koba1t
Copy link
Member

koba1t commented May 25, 2024

Thanks @colinodell!
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: colinodell, koba1t

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 25, 2024
@k8s-ci-robot k8s-ci-robot merged commit 88c89f4 into kubernetes-sigs:master May 25, 2024
10 checks passed
antoooks pushed a commit to antoooks/kustomize that referenced this pull request May 30, 2024
* fix: always show accumulation errors if the resource was successfully loaded as a base

* chore: regression test

* chore: fix lint violations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

errors accumulating remote directories are not reported in certain situations
4 participants