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

Load and calculate Destination of files for kustomize localize #4652

Merged
merged 12 commits into from
Aug 19, 2022

Conversation

annasong20
Copy link
Contributor

@annasong20 annasong20 commented May 25, 2022

Implement locLoader, which loads and calculates destination paths of files for new command kustomize localize.

@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 25, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @annasong20. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 25, 2022
@k8s-ci-robot
Copy link
Contributor

@annasong20: 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/test-infra repository.

@annasong20
Copy link
Contributor Author

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 25, 2022
@natasha41575
Copy link
Contributor

/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 25, 2022
Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

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

Looks great! Mostly nits so far. I will do another pass after you update

api/loader/fileloader.go Outdated Show resolved Hide resolved
api/localizer/writer.go Outdated Show resolved Hide resolved
api/localizer/writer.go Outdated Show resolved Hide resolved
api/loader/fileloader_test.go Outdated Show resolved Hide resolved
api/loader/fileloader_test.go Outdated Show resolved Hide resolved
inNewDir, _ := filepath.Rel(scope.String(), target.String())
dst, dstErr := makeAndClean(newDir.Join(inNewDir), fSys)
if dstErr != nil {
return nil, errors.Wrapf(dstErr, "unable to write to newDir")
Copy link
Contributor

@natasha41575 natasha41575 May 26, 2022

Choose a reason for hiding this comment

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

Suggested change
return nil, errors.Wrapf(dstErr, "unable to write to newDir")
return nil, errors.Wrapf(dstErr, fmt.Sprintf("unable to write to new directory %q", newDir)

%q will help to print something like unable to write to new directory 'newDir'

Copy link
Contributor Author

@annasong20 annasong20 Jun 10, 2022

Choose a reason for hiding this comment

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

I'm leaning towards not printing newDir's path because it should already be included in dstErr, but nonetheless the fmt.Sprintf suggestion was super helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've re-written almost all of the error messages. Lmk if this is still a problem.

api/localizer/writer.go Outdated Show resolved Hide resolved
api/localizer/writer.go Outdated Show resolved Hide resolved
api/localizer/writer.go Outdated Show resolved Hide resolved
api/localizer/writer.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2022
@annasong20 annasong20 marked this pull request as draft June 6, 2022 19:03
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 6, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 30, 2022
@annasong20 annasong20 changed the title Implement file localization for localize Load and calculate Destination of files for kustomize localize Jul 15, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 2, 2022
@natasha41575 natasha41575 reopened this Aug 2, 2022
@natasha41575
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: annasong20, natasha41575

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 Aug 19, 2022
@natasha41575
Copy link
Contributor

/test all

@k8s-ci-robot k8s-ci-robot merged commit bf17fe1 into kubernetes-sigs:master Aug 19, 2022
@annasong20 annasong20 deleted the localize-file branch August 19, 2022 22:08
annasong20 added a commit to annasong20/kustomize that referenced this pull request Aug 26, 2022
natasha41575 added a commit that referenced this pull request Aug 26, 2022
annasong20 added a commit to annasong20/kustomize that referenced this pull request Aug 29, 2022
annasong20 added a commit to annasong20/kustomize that referenced this pull request Aug 29, 2022
Remove code that changes remotes-loading code path, as mandated by kubernetes-sigs#4756
k8s-ci-robot added a commit that referenced this pull request Aug 30, 2022
Reinstate #4652 without url-related code
annasong20 added a commit to annasong20/kustomize that referenced this pull request Nov 4, 2022
annasong20 added a commit to annasong20/kustomize that referenced this pull request Nov 5, 2022
annasong20 added a commit to annasong20/kustomize that referenced this pull request Nov 7, 2022
k8s-ci-robot pushed a commit that referenced this pull request Nov 8, 2022
* Address TODO in PR #4652

* Improve readability
elisshafer pushed a commit to elisshafer/kustomize that referenced this pull request Dec 8, 2022
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/XL Denotes a PR that changes 500-999 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.

4 participants