Fix CWD interation between codspeed.yml and the cli commands#270
Open
GuillaumeLagrange wants to merge 3 commits intomainfrom
Open
Fix CWD interation between codspeed.yml and the cli commands#270GuillaumeLagrange wants to merge 3 commits intomainfrom
GuillaumeLagrange wants to merge 3 commits intomainfrom
Conversation
Move config file discovery logic from `ProjectConfig` into a dedicated `DiscoveredProjectConfig` struct that preserves the config file path. This removes the side-effect of `set_current_dir()` during discovery and instead exposes `config_dir()` for callers to resolve paths relative to the config file location. Also stop merging `working_directory` from config in the merger since it needs path resolution relative to the config file directory, which the merger doesn't have access to.
When running `codspeed run` with config targets, the `working-directory` option is now resolved relative to the config file's directory instead of the current working directory. When no `working-directory` is set, it defaults to the config file's directory. For `codspeed run -- command` and `codspeed exec`, the config's `working-directory` is explicitly ignored — only the `--working-directory` CLI flag is used. A warning is emitted if `--working-directory` is passed in config targets mode.
70676dc to
f630ed5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The rule is
codspeed runwithout argument, the working directory should be by order of prioritycodspeed.ymlgeneral working directory setting, defined in project level options incodspeed.yml, as relative to the file it is written inNote: For this case, CLI overrides of working directory are ignored with a warning
codspeed run -- commandorcodspeed exec -- commandNote: For this case, we EXPLICITLY ignore the path of the discovered config