-
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
Refactor repospec code to be more readable #4866
Comments
/label kind/cleanup |
@annasong20: The label(s) In response to this:
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. |
/kind cleanup |
/triage accepted |
I think we should make this issue an umbrella issue to track the refactoring we want to do for repoSpec. WDYT about retitling it to "Refactor repospec code to be more readable" and listing this particular issue as one of the things we want to do? Then we can add more to this issue as we go along, such as the suggestion here #4863 (comment) - rather than filing a separate issue for each thing. |
parseGitURL
@koba1t would you be interested in taking this issue? |
@annasong20 @natasha41575 I am looking at starting my contribution journey in K8 and would like to pick this up.. Can u please assign it to me? |
/assign |
Hello @kishorerj! |
@koba1t @annasong20 @natasha41575 I created the draft PR with changes to the first task mentioned in the issue above (replace 7 return values with repo spec). #4891. I built the code and also ran the tests to ensure there are no impacts.. Since this is my first change, I have to do a few pending items on CLA which I will get sorted soon. Also will be committing changes for the other issue tasks mentioned here |
@annasong20 @natasha41575 I have created PR for the first task as mentioned above, please take a look at it. I need more details for the second task. What are we trying to achieve here. An example will help.. Also whats the best way to get connected on this issue? Do i ping in slack, set up a zoom meeting? |
@kishorerj and I synced offline. I edited the issue with examples and more context. |
Thanks Anna for giving more context.. This helps |
@annasong20 @natasha41575 I have opened this PR for review(closed the earlier PR I created).. #4900. |
Please ignore this PR.. I have closed it.. Please consider #4900 |
@KnVerey @natasha41575 @annasong20 For2nd task any suggestions on what could be the name instead of OrgRepo ? .. How about repo or repoRoot or repoRootPath .. ? Any opinion? Again on 4th , the url.parsePath() did throw an error with % at the end when I tried as mentioned.. Since I am not sure about the actual context in which this is used further up the stack, is this fine to even proceed by setting the path to "" and logging a warning or do we throw an error and stop any subsequent processing of this url as the url itself is invalid and ask the user to fix this? |
|
I like
My instinct is also to return the error, though it is possible the larger test suite (I only ran a subset previously) might reveal a reason not to do this. Let's try it and discuss further on the PR if needed. |
@annasong20 @natasha41575 @KnVerey pushed the changes for name changes in the PR #4922. I am not clear on task3 . Next I will pick up task 4 on handling url.parse() error and try to push this on Monday/Tuesday |
Describe the bug
RepoSpec
readability issues include:The function
parseGitURL
inRepoSpec
currently has 7 return values. This makes differentiating between the return values more difficult than it needs to be and prone to error. Potential solutions:RepoSpec
instead of the 7 fields ofRepoSpec
NewRepoSpecFromURL
directlyAn example of this can be found here.
Rename
OrgRepo
given reasoning: FixRepoSpec
query extraction #4863 (comment)Rename
Host
, as suggested in: Reinstate #4652 without url-related code #4779 (comment)SchemeAuth
Scheme
,UserInfo
,Host
,Port
, which gives calling code, likekustomize localize
, more informationDecide how to handle
url.Parse()
error fororgRepo
,Path
, and query, as suggested here: FixRepoSpec
query extraction #4863 (comment)Version
Kustomize master branch, commit e724e25
The text was updated successfully, but these errors were encountered: