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

Handle git ls-remote asking for authentication #48

Open
cam72cam opened this issue Nov 28, 2023 · 6 comments
Open

Handle git ls-remote asking for authentication #48

cam72cam opened this issue Nov 28, 2023 · 6 comments

Comments

@cam72cam
Copy link
Member

If a repository is removed or made private, git ls-remote will hang asking for user authentication and break the bumper.

@cam72cam cam72cam added this to the Stage 2 Stretch Goals milestone Nov 28, 2023
@serdardalgic
Copy link

One question, AFAICS, git ls-remote is called directly using os/exec. Did you folks consider using go-git package for calling git commands in the registry? I wonder if there is any reason not to use that. It looks like quite an active project, and takes care of the error handling for most of the cases.

@cam72cam
Copy link
Member Author

@Yantrio had used it extensively in similar work recently and was running into some extremely odd issues and inconsistencies.

@Yantrio
Copy link
Member

Yantrio commented Nov 30, 2023

I did use it and it was extremely flakey for no reason at all. It was not stable enough for me to be confident with using it here. However I'm happy if we re-visit this in the future.

@cam72cam
Copy link
Member Author

@cam72cam
Copy link
Member Author

cmesh@atavisage:~/OpenTOFU/registry-stable/src$ time curl -s https://api.github.com/repos/eda-dev-test/terraform-aws-test/git/refs/tags -o /dev/null 

real    0m0.565s
user    0m0.044s
sys     0m0.012s
cmesh@atavisage:~/OpenTOFU/registry-stable/src$ time git ls-remote https://github.com/eda-dev-test/terraform-aws-test/ > /dev/null 

real    0m0.315s
user    0m0.045s
sys     0m0.025s

With the overhead of the fork/dup/etc.. this might actually be faster.

@cam72cam
Copy link
Member Author

It's also worth noting that this is not a problem for github actions. git ls-remote is unable to poll the term for user input and fails. It's mostly an issue when running it locally.

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

No branches or pull requests

3 participants