Skip to content

Commit dd7d268

Browse files
committed
Describe re-used report inputs as saved and refuse parent segments in the S3 stash
An earlier canary attempt only saved the inputs; its report may have failed, so the summary should not call them explained. The stash tarball is extracted with tar -P, so an entry with a .. segment could leave /mnt even under the /mnt prefix check. Generated-by: Claude Opus 5
1 parent d6a1518 commit dd7d268

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎.github/workflows/dependency-upgrade-report.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ jobs:
114114
}
115115
if (!include.length && !skipped.length) {
116116
core.notice(explained.length ?
117-
'The saved report inputs were already explained for an earlier canary attempt' :
117+
'The saved report inputs were already saved by an earlier canary attempt' :
118118
'No saved report inputs: this run did not request independent diagnostics');
119119
}
120120
await core.summary.addHeading('Dependency upgrade diagnostics')
121121
.addLink(`Source canary run (attempt ${rawAttempt})`, run.html_url)
122122
.addRaw(`\n\nSource revision: ${run.head_sha}\n\nReports: ${include.length}\n`)
123123
.addRaw(skipped.length ? `\nSkipped: ${skipped.join(', ')}\n` : '')
124-
.addRaw(explained.length ? `\nExplained for an earlier attempt: ${explained.join(', ')}\n` : '')
124+
.addRaw(explained.length ? `\nSaved by an earlier attempt: ${explained.join(', ')}\n` : '')
125125
.write();
126126
127127
explain:
@@ -202,7 +202,7 @@ jobs:
202202
aws s3 cp --only-show-errors "${object}" "${payload}"
203203
echo "${digest} ${payload}" | sha256sum --check --status
204204
tar -tPf "${payload}" | while IFS= read -r entry; do
205-
if [[ "${entry}" != /mnt/* ]]; then
205+
if [[ "${entry}" != /mnt/* || "${entry}" == */../* || "${entry}" == */.. ]]; then
206206
echo "::error::The original CI image stash holds ${entry} outside /mnt"
207207
exit 1
208208
fi

‎dev/breeze/tests/test_dependency_upgrade_report.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def test_plan_explains_inputs_only_for_the_first_canary_attempt_that_saved_them(
231231
assert result["requests"][0]["attempt_number"] == int(source_attempt)
232232
assert included_inputs(result) == inputs_ids
233233
if source_attempt == "2":
234-
assert "Explained for an earlier attempt: 3.14:constraints-source-providers" in result["summary"]
234+
assert "Saved by an earlier attempt: 3.14:constraints-source-providers" in result["summary"]
235235

236236

237237
@requires_node
@@ -245,9 +245,7 @@ def test_plan_does_not_queue_a_second_report_from_inputs_already_explained(sourc
245245
)
246246
result = run_plan(source_run, source_artifacts, source_attempt="2")
247247
assert result["outputs"]["has-reports"] == "false"
248-
assert result["notices"] == [
249-
"The saved report inputs were already explained for an earlier canary attempt"
250-
]
248+
assert result["notices"] == ["The saved report inputs were already saved by an earlier canary attempt"]
251249

252250

253251
def stash_artifact_name(key, ref):

0 commit comments

Comments
 (0)