Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/reusable-10-ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2491,12 +2491,25 @@ jobs:
if [ ! -f "${BASELINE_PATH}" ]; then
BASELINE_PATH="${WORKSPACE_ROOT}/config/coverage-baseline.json"
fi
# THE REUSABLE WORKFLOW SHIPS INSTANTLY VIA @main; THE SCRIPT IT RUNS DOES NOT.
# This invokes the CONSUMER's `tools/coverage_trend.py`, a sync-managed file COPY that
# only arrives on the next maint-68 run (daily, 05:00 UTC). So for one sync window this
# workflow is newer than the script it calls, and passing a flag the older script does
# not know makes argparse exit 2 and fails the step -- in every consumer at once.
# Probe instead of assume; the flag is optional by design (the script defaults to cwd,
# which is already correct for every `working-directory: "."` consumer). Remove this
# shim once the fleet has synced past 2026-08-25.
PROJECT_ROOT_ARG=""
if python "${GITHUB_WORKSPACE}/tools/coverage_trend.py" --help 2>/dev/null \
| grep -q -- '--project-root'; then
PROJECT_ROOT_ARG="--project-root ${PROJECT_ROOT}"
fi
# shellcheck disable=SC2086
python "${GITHUB_WORKSPACE}/tools/coverage_trend.py" \
--coverage-xml coverage.xml \
--coverage-json coverage.json \
--baseline "${BASELINE_PATH}" \
--project-root "${PROJECT_ROOT}" \
${PROJECT_ROOT_ARG} \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve project-root as one shell argument

When a caller uses a working-directory containing whitespace or glob characters, the unquoted ${PROJECT_ROOT_ARG} is word-split (and potentially pathname-expanded), so the Path argument declared at tools/coverage_trend.py:185-193 receives only the first fragment and argparse exits 2 on the remainder. This makes the coverage-trend step fail for an otherwise valid relative working directory; use a Bash array or omit the optional flag rather than encoding the flag and value in an unquoted scalar. Because reusable-workflow changes reach consumers immediately, this regression is exposed as soon as such a caller runs.

AGENTS.md reference: AGENTS.md:L44-L47

Useful? React with 👍 / 👎.

--summary-path coverage-summary.md \
--job-summary "$GITHUB_STEP_SUMMARY" \
--artifact-path coverage-trend.json \
Expand Down
Loading