-
Notifications
You must be signed in to change notification settings - Fork 8
Added support for inheritance in importing repository files. #39
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
base: main
Are you sure you want to change the base?
Conversation
898c082
to
3361a90
Compare
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.
Some comments and suggestions.
More of a long-term, high-level discussion: Did you see the discussion on the original PR about being able to extend multiple files and import multiple files and the semantics of that? dirk-thomas/vcstool#148 (comment). How do you think that should behave? Dirk was suggesting not allowing (warning or erroring on) identical entries for sibling files: not allowing two files being extended to contain the same repository path (e.g., src/vcs2l:
under repositories:
). I think I kind of missed that back then and intended to just merge sibling entries and prioritize from top to bottom instead:
extends:
- a.repos # May override entries from b.repos
- b.repos
repositories:
repo: ... # May override entries from the combination of a.repos and b.repos
We can probably figure this out after this PR, though.
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
3361a90
to
8c7697c
Compare
Yes, it was quite straightforward to extend the implementation to support multiple files. I have included documentation, tests and error support if the user tries to include duplicate files. |
I can understand that the documentation can take up a lot of space in the README. |
Sorry, I meant to initiate a discussion and not really request you to implement something, because, from the initial discussion with Dirk, there were two options when supporting multiple files under
I think Dirk's point was that it makes sense for a file extending another file to override some paths (repos), but it may or may not make sense for a file being extended to override some paths from another file being extended alongside it. |
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Apologies for misreading the conversation. I can drop the specific commit if this does not pertain to the PR.
I am currently not allowing the user to specify the same path by raising the error here. I feel that this is a more simplistic approach, which limits the user to specifying distinct paths as part of the extended files. Please let me know if this is a viable method to follow through, as this file structure can be restrictive and opinionated. |
Sorry, my comment wasn't clear, especially without the original context. See my updated comments. By "the same paths," I meant the same repository paths (not In any case, I think allowing identical repository paths/entries is fine for now. I can see having a |
…e in import command. Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
Oh my bad, I think since we are allowing duplicate repository entries as of now, this should be resolved.
Yes, sure. I can add this as a feature request issue once this PR gets merged with |
Basic Info
Description of contribution in a few bullet points
extends
field forvcs import
to facilitate inheritance.extends
feature.Description of how this change was tested
Ran
pytest
locally to ensure all the unit and linting tests pass:pytest -s -v test
Created a local fork to validate green CI.
Signed-off-by: Leander Stephen Desouza leanderdsouza1234@gmail.com