You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: preserve subdirectory in generated pipeline_path and source_path (#114)
* Initial plan
* fix: preserve directory path in generated pipeline_path and source_path
When compiling from a directory that contains a subdirectory with the
agent markdown (e.g. `ado-aw compile agents/ctf.md` from the repo root),
the generated pipeline embedded only the filename in pipeline_path and
source_path, dropping the subdirectory prefix.
Root causes:
- generate_pipeline_path used file_name() only → agents/ctf.yml became
{{ workspace }}/ctf.yml instead of {{ workspace }}/agents/ctf.yml
- generate_source_path used file_name() only and hardcoded the agents/
prefix → would break for files outside agents/
Fix:
- Both functions now preserve the full relative path via a shared
normalize_relative_path helper (strips leading ./ and normalizes slashes)
- Absolute paths fall back to filename-only to avoid embedding
machine-specific paths in the pipeline YAML
- Added 8 unit tests covering the corrected behaviour
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/13f2c5e7-28fe-4ffb-9460-dd868098ce0c
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
* fix: address review feedback on normalize_relative_path
- Use strip_prefix idiom instead of manual index slicing in ./ loop
- Add doc note that .. components are the caller's responsibility
- Add absolute-path fallback tests for both generate_source_path and
generate_pipeline_path
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/a8c9ad7f-e06e-40d8-98bf-25160a4183d8
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
* fix: handle absolute input paths via git-root relativization
When an absolute path is passed (e.g. ado-aw compile /home/user/repo/agents/ctf.md),
the previous code fell back to filename-only, losing the directory component and
causing the integrity check to fail.
- Add find_git_root() to walk up the directory tree looking for a .git entry
- Update normalize_relative_path() to use it for absolute paths, computing a
path relative to the git repo root instead of falling back to filename-only
- Fall back to filename-only only when no git root is found
- Add tests covering the git-root happy path (using tempfile::TempDir for
safe cleanup) and the no-git-root fallback for both functions
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/75c10525-fed4-4c3f-a784-ede99d43f058
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
0 commit comments