Skip to content

CI: agent skills fixes for the new S3 report prefix scheme - #117287

Merged
maxknv merged 3 commits into
masterfrom
ci_check_ci_s3_prefix_followup
Aug 31, 2026
Merged

maxknv merged 3 commits into
masterfrom
ci_check_ci_s3_prefix_followup

Conversation

@maxknv

@maxknv maxknv commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Follow-up for #110081, which changed the S3 report layout so the result JSON now lives under the normalized workflow name both as a path segment and in the file name:

  • PRs/<pr>/<sha>/<workflow>/result_<workflow>.json
  • REFs/master/<sha>/<workflow>/result_<workflow>.json

ci/jobs/scripts/check_ci.py still fetched the old .../result_pr.json path, so curl downloaded an S3 AccessDenied body that then failed to parse as JSON (Expecting value: line 1 column 1). The URL is now built from Utils.normalize_string(<workflow name>) for both the PR/master report and the sync-PR report.

Also picks up the accompanying .claude/ tooling and skill edits.

Related: #110081

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/117287]

Version info

  • Merged into: 26.9.1.436 (included in 26.9 and later)

Follow-up for #110081, which
changed the S3 report layout so that the result JSON now lives under the
normalized workflow name both as a path segment and in the file name:

  PRs/<pr>/<sha>/<workflow>/result_<workflow>.json
  REFs/master/<sha>/<workflow>/result_<workflow>.json

`check_ci.py` still fetched the old `.../result_pr.json` path, so the download
returned an S3 AccessDenied body that failed to parse as JSON. Build the URL
from `Utils.normalize_string(<workflow name>)` for both the PR/master report
and the sync-PR report.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@maxknv maxknv changed the title CI: fix check_ci.py for the new S3 report prefix scheme CI: agent skills for the new S3 report prefix scheme Aug 31, 2026
@maxknv
maxknv marked this pull request as draft August 31, 2026 08:47
@clickhouse-gh

clickhouse-gh Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2560613]

Summary: ✅


AI Review

Summary

This PR updates check_ci.py, the CI-report helpers, and the related skills/docs for the workflow-segmented S3 layout, and the curl -f fix in get_ci_praktika_result is good. The remaining issue is that three touched consumers now assume every historical report already uses the new layout, so pre-29c7bd89c89 CI links and commits can no longer be inspected. That is a regression in CI triage tooling, so I am requesting changes.

Findings

⚠️ Majors

  • [.claude/tools/fetch_ci_report.js:226] constructJsonUrl now always inserts the workflow segment. Live repro: node .claude/tools/fetch_ci_report.js "https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=117287&sha=83e3e3d2ae48bb61ba1a1521b85120cbbca52f85&name_0=PR" requests .../pr/result_pr.json and fails, while the legacy flat .../result_pr.json still returns 200. Please probe the flat top-level path before assuming the new layout so old bot and issue links remain readable.
  • [.claude/tools/fetch_perf_report.py:308] get_performance_shards has the same regression for historical performance-report URLs. python3 .claude/tools/fetch_perf_report.py "https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=117287&sha=83e3e3d2ae48bb61ba1a1521b85120cbbca52f85&name_0=PR" --summary now dies on .../pr/result_pr.json, which means older performance links in PR and issue history can no longer be analyzed. Please add the same legacy flat-path handling here.
  • [.claude/skills/double-check-perf-tests/double_check_perf.py:306] The local perf rerun helper now hardcodes the new report layout for all commits. Even python3 .claude/skills/double-check-perf-tests/double_check_perf.py 83e3e3d2ae48bb61ba1a1521b85120cbbca52f85 --pr 117287 --dry-run fails immediately with HTTP 403 on .../pr/result_pr.json, so commits measured before the layout change can no longer be double-checked. The report lookup needs the same flat-path compatibility path as the other readers.
Final Verdict
  • Status: ⚠️ Request changes
    Minimum required actions:
  1. Preserve compatibility with pre-29c7bd89c89 top-level CI report URLs in .claude/tools/fetch_ci_report.js.
  2. Add the same legacy flat-path handling to .claude/tools/fetch_perf_report.py.
  3. Make .claude/skills/double-check-perf-tests/double_check_perf.py able to read historical pre-layout commits again.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 31, 2026
Comment thread ci/jobs/scripts/check_ci.py Resolved
Comment thread .claude/tools/fetch_ci_report.js Resolved
Comment thread .claude/tools/fetch_perf_report.py Resolved
@maxknv
maxknv marked this pull request as ready for review August 31, 2026 08:57
maxknv and others added 2 commits August 31, 2026 11:08
Add -f to the report curl in get_ci_praktika_result so a missing or
forbidden S3 object fails immediately with a clear error instead of
downloading the S3 AccessDenied body and blowing up later in
Result.from_file with an opaque JSON parse exception. This mirrors the
-f already used by get_sync_pr_result.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@maxknv

maxknv commented Aug 31, 2026 •

Copy link
Copy Markdown
Member Author

Thanks for the review. I checked each point against origin/master (now merged into this branch), and the path findings don't hold on current master — they were accurate only against the pre-merge commit 83e3e3d2, whose CI ran with the older praktika.

Why the report layout is segmented now. get_s3_prefix_static appends the normalized workflow name unconditionally on master:

  • 633ec9e571a ("sync praktika") first added it behind _should_include_workflow_name_in_s3_prefix
  • 29c7bd89c89 ("sync"), the latest change to ci/praktika/_environment.py:427, dropped the condition: prefix += f"/{Utils.normalize_string(workflow_name)}"

_ResultS3.copy_result_to_s3 writes to {env.get_s3_prefix()}/{name} (ci/praktika/result.py:1312), so the report JSON is now at PRs/<pr>/<sha>/<workflow>/result_<workflow>.json. Attached files (result.py:1424) and job artifacts (runner.py:362,379) are also keyed off get_s3_prefix, so they pick up the same workflow segment — the perf-helper paths are consistent too.

Empirical check (live S3):

PR .../<sha>/result_pr.json .../<sha>/pr/result_pr.json
#110081 (new praktika) 403 200
#117287 (old praktika, this PR's own pre-merge report) 200 403

#117287's own report is flat only because it was built before this branch merged master; reports produced by current master are segmented, which is what these readers now target.

The -f point is valid and fixed. get_ci_praktika_result omitted -f, so a missing report downloaded the S3 AccessDenied body and failed later in Result.from_file with an opaque parse error (the exact symptom this PR set out to fix). Added -f plus an explicit error in 25606136ddd, matching what get_sync_pr_result already does.

const workflowSegment = normalizeTaskName(workflowName);
const normalizedTask = normalizeTaskName(taskName);
return `${baseUrl}/${suffix}/${encodeURIComponent(sha)}/result_${normalizedTask}.json`;
return `${baseUrl}/${suffix}/${encodeURIComponent(sha)}/${workflowSegment}/result_${normalizedTask}.json`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This hardcodes the post-29c7bd89c89 layout for every HTML or top-level workflow URL, so historical CI links stop working.

Live repro on current HEAD:

node .claude/tools/fetch_ci_report.js "https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=117287&sha=83e3e3d2ae48bb61ba1a1521b85120cbbca52f85&name_0=PR"

That now requests .../PRs/117287/83e3e3d2.../pr/result_pr.json and fails with 403, while the legacy flat object .../PRs/117287/83e3e3d2.../result_pr.json still returns 200. This PR's updated docs also say older json.html links are still accepted, and many issue / PR comments already store those URLs. Please keep the new segmented path for current reports, but fall back to the flat top-level report path when the workflow-segmented object is missing.

# The performance comparison always runs in the "PR" workflow, whose normalized
# name is "pr" (Utils.normalize_string("PR")). See get_s3_prefix_static in
# ci/praktika/_environment.py and buildResultPath in ci/praktika/praktika.html.
pr_json_url = f"{base_url}/PRs/{pr_number}/{sha}/{WORKFLOW_SEGMENT}/result_pr.json"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This has the same backward-compatibility regression for historical performance reports. The CLI still accepts json.html URLs, but:

python3 .claude/tools/fetch_perf_report.py "https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=117287&sha=83e3e3d2ae48bb61ba1a1521b85120cbbca52f85&name_0=PR" --summary

now dies on .../PRs/117287/83e3e3d2.../pr/result_pr.json, while the legacy flat .../PRs/117287/83e3e3d2.../result_pr.json still exists. That means older performance-report links in PR and issue history can no longer be analyzed. Please probe the pre-layout flat top-level report path here before assuming the workflow-segmented layout.


def get_performance_shards(pr_number: int, sha: str) -> list[PerfShard]:
pr_json_url = f"{REPORTS_BUCKET}/PRs/{pr_number}/{sha}/result_pr.json"
pr_json_url = f"{REPORTS_BUCKET}/PRs/{pr_number}/{sha}/{PR_WORKFLOW_SEGMENT}/result_pr.json"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

double_check_perf.py now makes the same one-layout assumption for every historical commit. On current HEAD, even:

python3 .claude/skills/double-check-perf-tests/double_check_perf.py 83e3e3d2ae48bb61ba1a1521b85120cbbca52f85 --pr 117287 --dry-run

fails immediately with HTTP 403 for .../PRs/117287/83e3e3d2.../pr/result_pr.json, although the old flat .../PRs/117287/83e3e3d2.../result_pr.json is still there. This skill is meant to reproduce an arbitrary CI-measured commit, so the report lookup needs the same legacy flat-path fallback as the other readers instead of assuming every historical run already has the workflow segment.

@maxknv maxknv changed the title CI: agent skills for the new S3 report prefix scheme CI: agent skills fixes for the new S3 report prefix scheme Aug 31, 2026
@maxknv
maxknv added this pull request to the merge queue Aug 31, 2026
Merged via the queue into master with commit 975b103 Aug 31, 2026
175 checks passed
@maxknv
maxknv deleted the ci_check_ci_s3_prefix_followup branch August 31, 2026 12:15
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants