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

Fix git auth prompting and allow config of '.git' auto suffix #5078

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

ogenstad
Copy link
Contributor

This PR ensures that we set the environment variable to Git so that we never prompt for credentials (in the console of the docker container), this change reflects the what we had with the old git agent.

It also adds a configuration option that lets users disable the automatic suffix of ".git" that Infrahub adds to HTTP repositories if this string wasn't appended to the URL.

Fixes #5077

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Nov 28, 2024
Copy link

codspeed-hq bot commented Nov 28, 2024

CodSpeed Performance Report

Merging #5078 will not alter performance

Comparing pog-no-auth-prompt-configure-auto-suffix-IFC-967 (2757c50) with stable (f856df7)

Summary

✅ 10 untouched benchmarks

):
data["location"]["value"] = f'{data["location"]["value"]}.git'
if config.SETTINGS.git.append_git_suffix:
http_without_dotgit = r"^(https?://)(?!.*\.git$).*"
Copy link

Choose a reason for hiding this comment

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

is git supported over https only transport?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a regex that would look at the repository URL and optionally add a suffix if the URL is http or https.

@ogenstad ogenstad force-pushed the pog-no-auth-prompt-configure-auto-suffix-IFC-967 branch from fc3911c to 2757c50 Compare November 29, 2024 11:57
@ogenstad ogenstad marked this pull request as ready for review November 29, 2024 13:55
@ogenstad ogenstad requested a review from a team November 29, 2024 13:56
@ogenstad ogenstad merged commit d976e73 into stable Nov 29, 2024
30 checks passed
@ogenstad ogenstad deleted the pog-no-auth-prompt-configure-auto-suffix-IFC-967 branch November 29, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants