Repository navigation
Conversation
publish-artifacts treated the feature argument as a basename under the git root, so plans/<feature> was missed. git add skipped deleted TCs, leaving a dirty tree for the next safe-checkout. Signed-off-by: Benjamin Kapner <bkapner@redhat.com>
PR Summary by Qodofix: stage nested feature dirs and deleted test cases
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
|
🤖 Finished Review · ✅ Success · Started 3:19 PM UTC · Completed 3:28 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.95 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk change modifying protected script and skill paths with accompanying unit tests, low recent churn, and no security or CI workflow changes. |
ReviewFindingsHigh
Medium
Low
Labels: PR is a bug fix to the artifact staging helper. Next steps:
|
|
/fs-fix Fix only the test_cases staging scope. Do not add a tracking issue, do not address protected-path, and do not change staged_files JSON semantics. Quote from the review: Using the entire test_cases directory as the pathspec ( Suggested fix: Restrict addition, modification, and deletion staging to the previously supported immediate test_cases/*.md files, including tracked Markdown files that no longer exist (e.g. a Also from the review (same change): Replacing the test_cases/*.md selection with directory-wide Keep:
Do not stage non-Markdown files or files in nested subdirectories under test_cases/. Add a test that a deleted Markdown TC is staged and that e.g. test_cases/debug.json and test_cases/draft/secret.env stay unstaged. Leave the PR description as a direct bug fix with no issue. Do not edit AGENTS.md or CONTRIBUTING.md. |
|
🤖 Finished Fix · ✅ Success · Started 3:43 PM UTC · Completed 3:47 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.38 |
Stage only top-level test_cases/*.md (plus tracked deleted ones) instead of the whole directory so non-Markdown and nested files are never published. Keeps staged_files semantics; adds regression test. Addresses review feedback on PR #114. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (human-triggered)Restricted test_cases staging to direct-child *.md (plus tracked deleted *.md), restored staged_files semantics, added a regression test. Full test suite passes. ruff/flake8/pre-commit could not be run in the sandbox: the tools are not installed and the pre-commit hook download failed on a TLS certificate error. Lines are under 120 chars. No merge conflict. Project CI was not inspected in detail. Fixed (3):
Tests: passed Conflict update: skipped; strategy Decision points
PR metadata: body updated Finding threads:
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 3:50 PM UTC · Completed 3:57 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.35 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk change modifying protected script and skill paths with accompanying unit tests, low recent churn, and no security or CI workflow changes. |
ReviewFindingsHigh
Low
Earlier findings
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:38 AM UTC · Completed 10:48 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.07 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk change modifying protected script and skill paths with accompanying unit tests, low recent churn, and no security or CI workflow changes. |
ReviewFindingsHigh
Low
Next steps:
|
| try: | ||
| subprocess.run( | ||
| ["git", "add", rel], | ||
| ["git", "add", "-A", "--", rel], |
There was a problem hiding this comment.
-- stops option parsing, but these arguments are still pathspecs, so a *, ?, or [...] in a feature path segment or a TC filename makes git match sibling paths — and publish_artifacts commits whatever ends up staged. Verified locally: with plans/feat1/ and plans/feat[1]/ both modified, git add -- 'plans/feat[1]/TestPlan.md' stages plans/feat1/TestPlan.md as well; likewise git add -A -- 'plans/feat1/test_cases/TC-1?.md' also stages TC-10.md.
Names created by test-plan-create are snake_case-validated (validate.py feature-name), but publish-artifacts accepts a user-supplied or PR-authored path and never re-checks it, so the allowlist holds only by convention. The same applies to the ls-files lookup below.
Cheap fix: run these calls with GIT_LITERAL_PATHSPECS=1 (or :(literal) prefixes) for both adds and the ls-files path, and add a regression that creates a [-named sibling and asserts the index holds only the intended path.
There was a problem hiding this comment.
Agreed — -- doesn't make these literal. I'll run the git add / ls-files calls with GIT_LITERAL_PATHSPECS=1 and add a regression with a [-named sibling so only the intended path is in the index.
| feature_name=$(basename "$feature_dir") | ||
| repo_root=$(git -C "$feature_dir" rev-parse --show-toplevel) | ||
| if ! publish_result=$(cd "$(cd -P "${CLAUDE_SKILL_DIR}/../.." && pwd -P)" && uv run python scripts/repo.py publish-artifacts "$repo_root" "$feature_name" "test-plan(<source_key>): <short summary of changes> (PR #<PR_NUMBER>)"); then | ||
| if ! publish_result=$(cd "$(cd -P "${CLAUDE_SKILL_DIR}/../.." && pwd -P)" && uv run python scripts/repo.py publish-artifacts "$repo_root" "$feature_dir" "test-plan(<source_key>): <short summary of changes> (PR #<PR_NUMBER>)"); then |
There was a problem hiding this comment.
§0.5 discovers the plan with find . — relative to the agent's cwd, not $repo_path. For an existing clone the checkout runs in a subshell, so cwd is unchanged and discovery can search the wrong repo entirely. And when cwd is a subdirectory of the repo, find . yields ./feat, which _feature_dir_and_rel re-bases under repo_root → <repo>/feat instead of <repo>/plans/feat: it fails, or commits a different feature. basename at least produced a repo-relative name; $feature_dir makes the result depend on an uncontrolled cwd. Discover from the located checkout (find "$repo_path" -name TestPlan.md) and keep feature_dir absolute from there.
There was a problem hiding this comment.
Agreed. $feature_dir only helps if discovery is already rooted at the checkout. I'll switch this to find "$repo_path" -name TestPlan.md and keep feature_dir absolute from there, same in the other skills this PR changed.
| for md_file in tc_dir.glob("*.md"): | ||
| rel = f"{feature_name}/test_cases/{md_file.name}" | ||
| tc_files.extend(f"{tc_rel}/{md.name}" for md in sorted(tc_dir.glob("*.md")) if md.is_file()) | ||
| deleted = subprocess.run( |
There was a problem hiding this comment.
Discovery runs after the required/optional files are already staged, and check=True is not wrapped in a try, so if git ls-files fails the index is left modified and the caller gets a traceback instead of the documented {"status": "failed", "error": ...} JSON — which the skills then pipe through jq -r '.committed'. Move discovery above the first git add and return the standard JSON error. While there, read the -z output as bytes and decode with surrogateescape, since -z emits raw path bytes rather than text.
There was a problem hiding this comment.
Agreed. Ill move the ls-files lookup above the first git add, return the usual {"status": "failed", "error": ...} JSON on failure, and decode the -z output as bytes with surrogateescape.
|
/fs-fix Fix only Federico's three inline comments. Do not add a tracking issue. Do not address protected-path.
Do not widen staging back to the whole test_cases directory. Keep direct-child *.md plus tracked deleted *.md only. |
|
🤖 Finished Fix · ✅ Success · Started 1:06 PM UTC · Completed 1:10 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.19 |
…s (PR #114) - Run git add/ls-files with GIT_LITERAL_PATHSPECS so wildcard names match only themselves - Discover test case paths before staging, return JSON error on ls-files failure, decode -z output as bytes with surrogateescape - Discover TestPlan.md from the located checkout in test-plan-resolve-feedback Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 2 (human-triggered)Addressed Federico's three comments (literal pathspecs, discovery from the located checkout, discovery-before-staging with JSON error handling) as instructed; protected-path finding and tracking issue left alone per instruction. All 1620 tests pass; ruff/flake8/pre-commit could not run in the sandbox (tools missing / network blocked). Fixed (3):
Tests: passed Finding threads:
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 1:14 PM UTC · Completed 1:21 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.24 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk change modifying protected script and skill paths with accompanying unit tests, low recent churn, and no security or CI workflow changes. |
ReviewFindingsHigh
Low
Earlier findings
Next steps:
|
Summary
publish-artifactsjoined the git root with the feature basename. Skills passbasename "$feature_dir", so the default~/Code/opendatahub-test-plans/plans/<feature>layout looks for<repo>/<feature>/TestPlan.mdand fails. The same helper onlygit adds files that still exist, so a deleted test case never lands in the commit and the nextsafe-checkoutdies on a dirty tree.Accept a basename, repo-relative path, or absolute path inside the repo, and stage deleted
test_cases/*.mdfiles as well as added/modified ones. The three calling skills now pass$feature_dir.The GitLab generator publish path is unchanged. This is the local skill flow.
Related Issue
None — opened directly as a bug fix.
Changes
stage_artifacts.<feature>/test_cases/*.mdadditions, modifications, and deletions (tracked deleted files viagit ls-files --deleted). Non-Markdown files and nested directories undertest_cases/are never staged.$feature_dirfromtest-plan-publish,test-plan-case-implement, andtest-plan-resolve-feedback.Testing
tests/unit/test_repo_stage.py, including a regression test thatdebug.jsonanddraft/secret.envstay unstaged while a deleted TC is staged.uv run --extra dev pre-commit run --all-filesmake lintVerified the new nested-path and deleted-TC tests fail before the fix.
Full suite command:
uv run pytest tests/ -q --cov=scripts --cov-report=term-missing --cov-fail-under=70make lintpasses with an existing warning about the removedcontent-critical-positionrule in.skillsaw.yaml.Checklist