Skip to content

praktika: add GH.api and strict/argv support to the gh retry helpers - #119166

Merged
leshikus merged 3 commits into
ClickHouse:masterfrom
leshikus:praktika-gh-api-helper
Oct 10, 2026
Merged

leshikus merged 3 commits into
ClickHouse:masterfrom
leshikus:praktika-gh-api-helper

Conversation

@leshikus

@leshikus leshikus commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Add a GH.api(endpoint, method=, fields=, jq=, paginate=, strict=) REST wrapper in ci/praktika/gh.py that builds the gh api command as an argv list and runs it through get_output_with_retries, so REST callers stop hand-assembling the command string and inherit the retry/strict behaviour. Also:

  • add a strict= flag to do_command_with_retries (mirroring get_output_with_retries) so a caller can raise with the command's stderr instead of wrapping the boolean in an assert;
  • let get_output_with_retries accept an argv list (joined with shlex.join).

Framework-only change; mirrors the ci/praktika/gh.py helper change made in the private repo's AWSDeployApply work so the two praktika copies do not diverge.

Changelog category (leave one):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):


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

Version info

  • Merged into: 26.10.1.1986-master (included in 26.10 and later)

@leshikus leshikus added the can be tested Allows running workflows for external contributors label Sep 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b25629f]

Summary: ✅


AI Review

Summary

This PR adds GH.api(...), lets get_output_with_retries accept argv lists and configurable retries, and adds a strict= mode to do_command_with_retries. One material gap remains: GH.api is still too narrow to serve as the generic REST wrapper described in the PR, because it cannot preserve the typed, file-backed, or repeated-field payloads already used by existing Praktika helpers.

Findings

⚠️ Majors

  • [ci/praktika/gh.py:636-637] GH.api promises a common REST wrapper for existing callers, but fields is serialized exclusively via -f from a plain dict. That changes request semantics for any caller that currently needs typed -F conversion, @file expansion, or repeated key[] entries (for example post_pr_line_comment, post_pr_review, _submit_team_review_requests, and update_pr_body when it sends a file). Migrating those helpers to GH.api would silently send a different payload instead of only inheriting retries, so the abstraction is not yet safe in the form this PR advertises.
    Suggested fix: split raw and typed fields (raw_fields vs fields), add headers / input_file support, or accept a pre-shaped argv extension so existing helpers can preserve -F, repeated keys, and --input behavior exactly.
Final Verdict

Changes requested: GH.api needs a more complete request-shaping surface before it can be merged as the shared REST helper promised by this PR.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 10, 2026
Comment thread ci/praktika/gh.py Resolved
Comment thread ci/praktika/gh.py Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 10, 2026
@leshikus
leshikus marked this pull request as ready for review September 10, 2026 14:03
@leshikus
leshikus requested a review from maxknv September 10, 2026 14:03
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@maxknv maxknv removed the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@maxknv maxknv removed the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@leshikus
leshikus added this pull request to the merge queue Oct 9, 2026
Merged via the queue into ClickHouse:master with commit dd9a7ea Oct 10, 2026
174 checks passed
@leshikus
leshikus deleted the praktika-gh-api-helper branch October 10, 2026 00:13
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 10, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 15, 2026
…retry-v2

Resolves the conflict with ClickHouse#119166 in ci/praktika/gh.py: GH.api_get stays
in place before do_command_with_retries, which keeps master's new strict
parameter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). 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.

3 participants