Commit ace63b6
feat: Add git root discovery for default base path (#1773)
* feat: Add git root discovery for default base path
Enable running Atmos from any subdirectory like Git. When using the default
embedded configuration and no local Atmos config exists, Atmos now
automatically discovers the git repository root and uses it as the base path.
Local configuration always takes precedence—if atmos.yaml, .atmos.yaml,
.atmos/, .atmos.d/, or atmos.d/ exist in the current directory, git root
discovery is skipped.
This behavior is controlled by ATMOS_GIT_ROOT_BASEPATH environment variable
(defaults to enabled, set to "false" to disable for testing).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* [autofix.ci] apply automated fixes
* docs: Document git root discovery in CLI configuration
Add comprehensive documentation for the git root discovery feature in the
CLI Configuration page. Explains how it works, when it activates, local
configuration precedence, and how to disable it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* test: Update snapshot for git root discovery trace logging
Updates the Valid_Log_Level_in_Config_File test snapshot to include new
TRACE-level log messages that were introduced by the git root discovery
feature. The snapshot now correctly captures the "Git root base path
disabled via ATMOS_GIT_ROOT_BASEPATH=false" trace messages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Add happy-path test and refactor git root functions
Changes:
1. Add happy-path test for git root discovery (addresses CodeRabbitAI feedback)
- All previous tests had expectChange=false
- New test uses TEST_GIT_ROOT to verify BasePath updates correctly
- Ensures regression protection for core feature
2. Extract git root functions to dedicated file (resolve file-length-limit)
- Move applyGitRootBasePath and hasLocalAtmosConfig to pkg/config/git_root.go
- Reduces load.go from 836 to 739 lines
- Remove orphaned comment block for moved function
- Improves code organization and maintainability
Tests: All pkg/config tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* [autofix.ci] apply automated fixes
* Improve comment explaining bootstrap config pattern for ATMOS_GIT_ROOT_BASEPATH
Addresses CodeRabbitAI feedback about reading from Settings struct.
The updated comment clarifies:
- This is bootstrap configuration, read during config loading
- Must use os.Getenv() because processEnvVars() runs AFTER LoadConfig()
- Follows same pattern as ATMOS_CLI_CONFIG_PATH in readEnvAmosConfigPath()
- Cannot use Settings struct as it's populated after git root discovery
This is intentional architectural design, not a violation of Atmos patterns.
Bootstrap config (controls config loading) vs application config (loaded from config).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude (via Conductor) <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Andriy Knysh <[email protected]>
Co-authored-by: aknysh <[email protected]>1 parent bc06ba6 commit ace63b6
File tree
12 files changed
+1806
-36
lines changed- docs/prd
- pkg/config
- tests
- snapshots
- website
- blog
- docs/cli/configuration
12 files changed
+1806
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
973 | | - | |
| 973 | + | |
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
| |||
0 commit comments