-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
git submodule need origin #5353
git submodule need origin #5353
Conversation
Hi @charles-chenzz, I checked out to the branch and tested it out using === RUN TestNewRepoSpecFromUrl_Smoke/arbitrary_testing
repospec_test.go:699: https://github.com/etc/etc
repospec_test.go:702:
Error Trace: /Volumes/Workstation/Project/kustomize/api/internal/git/repospec_test.go:702
Error: Not equal:
expected: "/notCloned"
actual : "/notCloned/etc"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-/notCloned
+/notCloned/etc
Test: TestNewRepoSpecFromUrl_Smoke/arbitrary_testing
Messages: absPath mismatch
repospec_test.go:710:
Error Trace: /Volumes/Workstation/Project/kustomize/api/internal/git/repospec_test.go:710
Error: Not equal:
expected: &git.RepoSpec{raw:"", Host:"https://gist.github.com/", RepoPath:"bc7947cb727d7f9217e7862d961a1ffd.git", Dir:"", KustRootPath:"", Ref:"", Submodules:false, Timeout:0}
actual : &git.RepoSpec{raw:"", Host:"https://github.com/", RepoPath:"etc/etc", Dir:"", KustRootPath:"etc", Ref:"deadbeefdeafbeef", Submodules:false, Timeout:0}
Diff:
--- Expected
+++ Actual
@@ -2,7 +2,7 @@
raw: (string) "",
- Host: (string) (len=24) "https://gist.github.com/",
- RepoPath: (string) (len=36) "bc7947cb727d7f9217e7862d961a1ffd.git",
+ Host: (string) (len=19) "https://github.com/",
+ RepoPath: (string) (len=7) "etc/etc",
Dir: (filesys.ConfirmedDir) "",
- KustRootPath: (string) "",
- Ref: (string) "",
+ KustRootPath: (string) (len=3) "etc",
+ Ref: (string) (len=16) "deadbeefdeafbeef",
Submodules: (bool) false,
Test: TestNewRepoSpecFromUrl_Smoke/arbitrary_testing My go test file content: // api/internal/git/repospec_test.go#683
{
name: "arbitrary testing",
input: "https://github.com/etc/etc/etc?ref=deadbeefdeafbeef",
cloneSpec: "https://github.com/etc/etc",
absPath: notCloned.String(),
repoSpec: RepoSpec{
Host: "https://gist.github.com/",
RepoPath: "bc7947cb727d7f9217e7862d961a1ffd.git",
},
}, |
this testcase was on the testfile or you create it? I didn't quite get the point here ( might need detail explanation sorry) |
yes, I created one more test case on the existing test file using the URL provided on the issue. Specifically starting on line#683. I did so because I noticed that the log message provided by the issue creator seems off, I'm not sure if that's a typo though. Error: accumulating resources: accumulation err='accumulating resources from 'https://github.cometc/etc/etc?ref=deadbeefdeafbeef&timeout=90s': URL is a git repository': failed to run '/usr/bin/git submodule update --init --recursive': warning: could not look up configuration 'remote.origin.url'. Assuming this repository is its own authoritative upstream.
|
kustomize/api/internal/git/repospec_test.go Lines 153 to 155 in fb7ee2f
kustomize/api/internal/git/repospec_test.go Lines 689 to 691 in fb7ee2f
base on the comments here, I think that's why submodules testcase won't work here. (don't know if I understand it right here) the regression test is introduce in this #5189 |
Hm that's unfortunate, since the issue OP also didn't include reproduce steps as well. Other changes seems aligned with the proposed solution. I think it's good to go after you update this README to make it stay relevant. |
the stay relevant means remove the comment in https://github.com/charles-chenzz/kustomize/blob/4b225f68c57a23bf507fa50d19c4326078cebd21/api/krusty/testdata/remoteload/with-submodule/README.md#L8-L10 ? I'm not quite get the points here. sorry |
Yup, right, you can update it since #5131 has been resolved, after this PR is merged. 😃 |
ACK. I will let other reviewers opt-in and see if there's anything need to address, would update it on another commit/PR |
/lgtm from me |
I work with @jakedt -- who reported this issue. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charles-chenzz Looks great! Just a few nits that I think will make the code easier to read for future developers.
/lgtm
/hold |
@charles-chenzz Sorry for the confusion. I didn't know that Prow automatically adds the /lgtm cancel |
@antoooks Regarding your earlier comment,
The parser does support multi-level sub-paths. I think the problem lies in the test case. You can also see this in the test output you provided. For example, you provider a And with regards to
Sharp eye :) No, the lack of a slash in the original issue description is not Kustomize's doing. I hypothesize that in order to generalize his url, the reporter whited out his own url with |
I'd prefer we not remove this explanation. It doesn't say that Kustomize still contains the bug, only that the hash is a preventative measure against such a bug. It explains why we include a hash, which a new contributor might wonder in the future. You can clarify the sentence if you'd like, but I'd only delete it if you plan to remove the hash from the testing code, which I think is slightly undesirable because we should be careful when testing locally on developers' machines. |
4b225f6
to
60d7ee6
Compare
@annasong20 I've addressed the nits, could you revisit when you get a chance?
prow won't automatically add the approve label after lgtm maybe it's bug here.. |
/lgtm |
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annasong20 I've addressed the nits, could you revisit when you get a chance?
Looks great! Thanks, @charles-chenzz!!
@charles-chenzz Sorry for the confusion. I didn't know that Prow automatically adds the approve label on lgtm. I will remove the lgtm until we address the nits.
prow won't automatically add the approve label after lgtm maybe it's bug here..
I just tested again and my lgtm
didn't automatically add an approve
. I am thoroughly confused. Would investigate if I had more time.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: annasong20, charles-chenzz 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 |
fix: #5131