Skip to content

feat!(git-clone): change path input to base_dir and return repo_dir as output #132

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

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

matifali
Copy link
Member

After #124, we now automatically append the path with the repo name, so the example should be changed to pass only the base directory as the path input.

After #124, we now automatically append the `path` with the `repo` name, so the example should be changed to pass only the base directory as the `path` input.
@matifali matifali requested a review from mafredri January 26, 2024 11:37
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

The fix makes sense.

I wonder if dest / destination would be a more suitable name for the property now, though? It can be read as "we do a git clone and place it in destination" (same as if you were in dest when running git clone manually). I'm not sure what path conveys to me in this context, is it the place we clone, is it the end name of the cloned repo, etc.

I think users would also appreciate being able to override the folder name that's created.

If we draw parallels to how git is used:

# Both create `modules` in pwd.
git clone https://github.com/coder/modules
git clone https://github.com/coder/modules.git

# Creates `bar` in `foo` in `pwd`.
git clone https://github.com/coder/modules.git foo/bar

Git calls the this extra parameter directory that renames the folder. I think we could get away with calling it name, too.

Just some thoughts.

@matifali
Copy link
Member Author

@mafredri Yes, I agree, but that would be a breaking change. We do have versioning now, and Depedanbot should handle version bumps, too. Unfortunately, Dependabot can not suggest a change of input variable names. That is why I am avoiding renaming inputs as this is out top used module.

@matifali matifali changed the title docs(git-clone): correct path example to not use the repo name feat(git-clone): correct path example to not use the repo name and return repo_dir as output Jan 26, 2024
@mafredri
Copy link
Member

mafredri commented Jan 26, 2024

@matifali I agree about breaking, but to be fair, this change is breaking too. If someone had previously configured a path, it would change due to #124, no?

@matifali
Copy link
Member Author

@mafredri Hmm, yes. So let's change it. What about base_dir?

@matifali matifali requested a review from mafredri January 26, 2024 12:13
@matifali matifali changed the title feat(git-clone): correct path example to not use the repo name and return repo_dir as output feat!(git-clone): correct path example to not use the repo name and return repo_dir as output Jan 26, 2024
@matifali matifali requested a review from kylecarbs January 26, 2024 12:18
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Good choice for param, LGTM!

@matifali matifali changed the title feat!(git-clone): correct path example to not use the repo name and return repo_dir as output feat!(git-clone): change path input to base_dir and return repo_dir as output Jan 26, 2024
@matifali matifali merged commit 7d31865 into main Jan 26, 2024
@matifali matifali deleted the git-clone-docs branch January 26, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants