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

[WIP] pyinfra/operations: git.config to manage system-level config #1187

Draft
wants to merge 3 commits into
base: 3.x
Choose a base branch
from

Conversation

Pirols
Copy link
Contributor

@Pirols Pirols commented Aug 27, 2024

No description provided.

@Pirols Pirols marked this pull request as draft August 28, 2024 08:35
Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay @Pirols - this looks great! Just need to fix the test situation, I can't quite understand why those are failing 🤔

@Pirols
Copy link
Contributor Author

Pirols commented Sep 26, 2024

Sorry for the long delay @Pirols - this looks great!

Hello @Fizzadar, thanks!

Just need to fix the test situation, I can't quite understand why those are failing 🤔

As you might have noticed, I have isolated the faulty (in terms of the tests' coverage) part of this PR into 9972fae, which AFAICT should not be breaking any previous usage of that fact. I have not worked on this in a while, so my memory is not of much use but I had noted the following:

The problematic part is in the fixup commit and it boils down to changing the GitConfig fact to enable the collection of the system level config. The issue is raised by the unit tests and seems to be due to the updated GitConfig returning None instead of a dictionary. This is - surprisingly - happening even for tests where the system flag is not set and the command - and thus the behaviour - should go unchanged.

Now, my 2¢: git config --system works, obviously, at system level and I don't know if that requires some extra configuration in how pyinfra performs tests. In fact, git config --system --list may even output an error: fatal: unable to read config file '/etc/gitconfig': No such file or directory.

Is this of any inspiration to you?

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