Added support for reading alakazam.yml from CWD and fallback to ~/.config/alakazam.yml. This allows working with a completely separate path for e.g. development.
I also had abra configured with a different abra_dir. When alakazam runs abra, it uses the configured abra dir, but alakazam also had some hardcoded references to ~/.abra. I added get_abra_dir() with the same logic that abra uses internally and replaced all hardcoded references.
Support alakazam.yml in CWD
Resolve ABRA_DIR using env var or abra.yml instead of hardcoding ~/.abra
Add ABRA_DIR to exclude_paths when inside root
Added support for reading alakazam.yml from CWD and fallback to ~/.config/alakazam.yml. This allows working with a completely separate path for e.g. development.
I also had abra configured with a different abra_dir. When alakazam runs abra, it uses the configured abra dir, but alakazam also had some hardcoded references to ~/.abra. I added get_abra_dir() with the same logic that abra uses internally and replaced all hardcoded references.
- Support alakazam.yml in CWD
- Resolve ABRA_DIR using env var or abra.yml instead of hardcoding ~/.abra
- Add ABRA_DIR to exclude_paths when inside root
Woah, super cool @dannygroenewegen! Great to see this happening. Driving by but LGTM! Not to demand too much but probably it would be pretty easy to create a unit test for get_abra_dir. We have to start writing tests eventually 🙃 I trust @moritz will know better.
Woah, super cool @dannygroenewegen! Great to see this happening. Driving by but LGTM! Not to demand too much but probably it would be pretty easy to create a unit test for `get_abra_dir`. We have to start writing tests eventually 🙃 I trust @moritz will know better.
simon
requested review from simon 2026-05-07 11:30:13 +00:00
simon
requested review from moritz 2026-05-07 11:30:13 +00:00
moritz
requested changes 2026-05-11 13:54:30 +00:00
Thank you for this PR 🚀. It's a nice feature to be able to have completely different project dirs, each separately configured.
I'm just curious for which use cases you use it? I think it's good if you don't want to have any global defaults for all of your projects. Else you would have all of your projects inside one main directory, which contains your global defaults.
On thing that stopped me from directly merging this, is that it only uses the alakazam.yml inside the current path, but if you run alakazam from any sub directory in your project it would fall back to "~/.config/alakazam.yml", which could lead to some confusing behaviour.
Thank you for this PR 🚀. It's a nice feature to be able to have completely different project dirs, each separately configured.
I'm just curious for which use cases you use it? I think it's good if you don't want to have any global defaults for all of your projects. Else you would have all of your projects inside one main directory, which contains your global defaults.
On thing that stopped me from directly merging this, is that it only uses the `alakazam.yml` inside the current path, but if you run `alakazam` from any sub directory in your project it would fall back to `"~/.config/alakazam.yml"`, which could lead to some confusing behaviour.
To be able to use the project specific alakazam.yml in nested directories, it would be good to use a function similar to get_abra_dir() to find alakazam.yml inside the parent dirs.
To be able to use the project specific `alakazam.yml` in nested directories, it would be good to use a function similar to `get_abra_dir() ` to find `alakazam.yml` inside the parent dirs.
dannygroenewegen marked this conversation as resolved
Thank you for this PR 🚀. It's a nice feature to be able to have completely different project dirs, each separately configured.
I'm just curious for which use cases you use it? I think it's good if you don't want to have any global defaults for all of your projects. Else you would have all of your projects inside one main directory, which contains your global defaults.
On thing that stopped me from directly merging this, is that it only uses the alakazam.yml inside the current path, but if you run alakazam from any sub directory in your project it would fall back to "~/.config/alakazam.yml", which could lead to some confusing behaviour.
Resolved your comments. I assumed to run alakazam only from root_path, didn't realise it also works from subdirs. Fixed the alakazam.yml lookup for this case.
The main use cases I had in mind for seperating project dirs:
I was making changes to recipes for integration and had multiple running with chaos version. I noticed some weird behaviour where different abra calls within a single alakazam call would use different commits of a recipe. I have a hunch for the reason, but didn't fully dig into it. It felt safer to have a completely separate project dir for both alakazam and abra when hacking around.
I can imagine the need for managing multiple independent entities: E.g. a single uptime kuma is tied to the root dir, but also sharing multiple project dirs with different sets of admins seems easier than managing that with subdirs.
> Thank you for this PR 🚀. It's a nice feature to be able to have completely different project dirs, each separately configured.
> I'm just curious for which use cases you use it? I think it's good if you don't want to have any global defaults for all of your projects. Else you would have all of your projects inside one main directory, which contains your global defaults.
>
> On thing that stopped me from directly merging this, is that it only uses the `alakazam.yml` inside the current path, but if you run `alakazam` from any sub directory in your project it would fall back to `"~/.config/alakazam.yml"`, which could lead to some confusing behaviour.
Resolved your comments. I assumed to run alakazam only from root_path, didn't realise it also works from subdirs. Fixed the alakazam.yml lookup for this case.
The main use cases I had in mind for seperating project dirs:
- I was making changes to recipes for integration and had multiple running with chaos version. I noticed some weird behaviour where different abra calls within a single alakazam call would use different commits of a recipe. I have a hunch for the reason, but didn't fully dig into it. It felt safer to have a completely separate project dir for both alakazam and abra when hacking around.
- I can imagine the need for managing multiple independent entities: E.g. a single uptime kuma is tied to the root dir, but also sharing multiple project dirs with different sets of admins seems easier than managing that with subdirs.
dannygroenewegen
requested review from moritz 2026-05-15 11:27:30 +00:00
moritz
merged commit 776e86a03a into main2026-05-18 16:43:29 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Added support for reading alakazam.yml from CWD and fallback to ~/.config/alakazam.yml. This allows working with a completely separate path for e.g. development.
I also had abra configured with a different abra_dir. When alakazam runs abra, it uses the configured abra dir, but alakazam also had some hardcoded references to ~/.abra. I added get_abra_dir() with the same logic that abra uses internally and replaced all hardcoded references.
Woah, super cool @dannygroenewegen! Great to see this happening. Driving by but LGTM! Not to demand too much but probably it would be pretty easy to create a unit test for
get_abra_dir. We have to start writing tests eventually 🙃 I trust @moritz will know better.Thank you for this PR 🚀. It's a nice feature to be able to have completely different project dirs, each separately configured.
I'm just curious for which use cases you use it? I think it's good if you don't want to have any global defaults for all of your projects. Else you would have all of your projects inside one main directory, which contains your global defaults.
On thing that stopped me from directly merging this, is that it only uses the
alakazam.ymlinside the current path, but if you runalakazamfrom any sub directory in your project it would fall back to"~/.config/alakazam.yml", which could lead to some confusing behaviour.@@ -55,3 +55,3 @@#}SETTINGS = {}SETTINGS_PATH = "~/.config/alakazam.yml"SETTINGS_PATH = "alakazam.yml" if Path("alakazam.yml").exists() else "~/.config/alakazam.yml"To be able to use the project specific
alakazam.ymlin nested directories, it would be good to use a function similar toget_abra_dir()to findalakazam.ymlinside the parent dirs.@@ -467,8 +467,27 @@ def generate_all_secrets(domain: str) -> None:print(f"\t {gen_sec['name']}: {gen_sec['value']}")def get_abra_dir() -> Path:A little docstring what this function is doing would be nice.
f1abf6229fto5ee1201b575ee1201b57toaf878c4661Resolved your comments. I assumed to run alakazam only from root_path, didn't realise it also works from subdirs. Fixed the alakazam.yml lookup for this case.
The main use cases I had in mind for seperating project dirs: