Skip to content

Share GitHub finalization JSON request helper#923

Merged
ramimbo merged 1 commit into
ramimbo:mainfrom
catcherintheroad-hub:codex/share-github-finalization-json-request-846
Jun 5, 2026
Merged

Share GitHub finalization JSON request helper#923
ramimbo merged 1 commit into
ramimbo:mainfrom
catcherintheroad-hub:codex/share-github-finalization-json-request-846

Conversation

@catcherintheroad-hub
Copy link
Copy Markdown

@catcherintheroad-hub catcherintheroad-hub commented Jun 5, 2026

Summary

  • Extracts the repeated GitHub issue finalization JSON request/read pattern into a private _request_json() helper.
  • Keeps _post_json(), _get_json(), and _patch_json() as the call-site-facing wrappers.
  • Preserves request methods, payload handling, timeout, JSON parsing, issue finalization flow, labels, comments, and close behavior.

Evidence

Validation

  • uv run --python 3.12 --extra dev python -m pytest tests/test_github_issue_finalization.py tests/test_treasury_executor.py::test_executor_executes_due_create_bounty_and_finalizes_issue tests/test_treasury_executor.py::test_executor_finalizes_github_issue_for_paid_bounty -q -> 19 passed.
  • uv run --python 3.12 --extra dev ruff check app/github_issue_finalization.py tests/test_github_issue_finalization.py -> passed.
  • uv run --python 3.12 --extra dev ruff format --check app/github_issue_finalization.py tests/test_github_issue_finalization.py -> 2 files already formatted.
  • uv run --python 3.12 --extra dev mypy app/github_issue_finalization.py -> success.
  • uv run --python 3.12 --extra dev python scripts/docs_smoke.py -> docs smoke ok.
  • git diff --check origin/main...HEAD -> clean.
  • git merge-tree --write-tree origin/main HEAD -> clean tree abda6f4c7b8cc6d19c1ef4bc0fd2711b121cfce1.

Scope

No public API contract, bounty lifecycle semantics, GitHub label/comment/close behavior, ledger behavior, wallet behavior, treasury execution behavior, payout behavior, admin-token behavior, private data, credentials, secrets, exchange, bridge, cash-out, or MRWK price behavior changed.

Summary by CodeRabbit

  • Refactor
    • Internal code improvements for better maintainability. No user-facing changes in this update.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b6273a2c-9e44-4120-b41a-e41caf4c47a0

📥 Commits

Reviewing files that changed from the base of the PR and between d4d0e48 and 00859f5.

📒 Files selected for processing (1)
  • app/github_issue_finalization.py

📝 Walkthrough

Walkthrough

This PR centralizes GitHub HTTP JSON request handling by introducing a shared _request_json helper that accepts a configurable HTTP method and optional payload. The _post_json, _get_json, and _patch_json methods are refactored to delegate to this helper, eliminating duplicated request-building and response-parsing code.

Changes

HTTP Request Centralization

Layer / File(s) Summary
Centralized request helper and method refactoring
app/github_issue_finalization.py
New internal _request_json helper accepts configurable HTTP method and optional JSON payload, constructs the GitHub Request using _github_request, and handles shared opener(..., timeout=10) + JSON parsing. _post_json, _get_json, and _patch_json are refactored to delegate to _request_json instead of duplicating request and response handling.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Share GitHub finalization JSON request helper' clearly and specifically names the changed surface—extraction of a shared JSON request helper in github_issue_finalization.py—matching the core refactoring work.
Description check ✅ Passed The description includes all required sections with substantive content: Summary (extraction and preservation details), Evidence (bounty tracking, duplicate search, scope), Validation (comprehensive test/lint/type-check results), and Scope (explicit statement of no breaking changes). The author provides concrete evidence of passing test runs, tooling checks, and clean diffs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Mergework Public Artifact Hygiene ✅ Passed PR introduces code refactoring only. README/docs contain no investment, price, cash-out, or fabricated payout claims. MRWK described as native coin supporting future snapshots/bridges, as required.
Bounty Pr Focus ✅ Passed Diff matches stated scope (app/github_issue_finalization.py), refactoring centralizes _request_json correctly, public APIs unchanged, test coverage present with 13 tests, no scope creep.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@aunysillyme aunysillyme left a comment

Choose a reason for hiding this comment

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

Reviewed PR #923 current head 00859f5510c096c65df4fc1420ae83a1fc8592e9 as a non-author.

Refs #838 review bounty.

Evidence checked:

  • Inspected app/github_issue_finalization.py.
  • Verified _request_json() centralizes the repeated GitHub request/read pattern while preserving the existing call-site wrappers _post_json(), _get_json(), and _patch_json().
  • Confirmed POST, GET, and PATCH behavior still passes through _github_request() with the same URL, token, optional payload, method, timeout, and _read_json() response parsing.
  • Confirmed the change is limited to GitHub issue finalization request plumbing and does not change bounty lifecycle semantics, labels/comments/close behavior, ledger, wallet, treasury execution, payout, admin-token behavior, private data, credentials, exchange, bridge, cash-out, or MRWK price behavior.

Validation run on this exact head:

  • uv run --python 3.12 --extra dev python -m pytest tests/test_github_issue_finalization.py tests/test_treasury_executor.py::test_executor_executes_due_create_bounty_and_finalizes_issue tests/test_treasury_executor.py::test_executor_finalizes_github_issue_for_paid_bounty -q -> 19 passed.
  • uv run --python 3.12 --extra dev ruff check app/github_issue_finalization.py tests/test_github_issue_finalization.py -> passed.
  • uv run --python 3.12 --extra dev ruff format --check app/github_issue_finalization.py tests/test_github_issue_finalization.py -> 2 files already formatted.
  • uv run --python 3.12 --extra dev mypy app/github_issue_finalization.py -> success.
  • uv run --python 3.12 --extra dev python scripts/docs_smoke.py -> docs smoke ok.
  • git diff --check origin/main...HEAD -> clean.
  • git merge-tree --write-tree origin/main HEAD -> clean tree 65d0bae2200250a4764d0ecb331b2ff11183e234.

GitHub state before review: PR open, mergeable=MERGEABLE, hosted Quality, readiness, docs, and image checks successful, CodeRabbit successful, and no human reviews visible on current head.

Duplicate/scope check: #838 bounty row 109 is open with 30 effective awards remaining; #923 is distinct from #922 because it touches app/github_issue_finalization.py request helper reuse rather than bounty-attempt duplicate responses.

No blocker found.

@ramimbo ramimbo merged commit 9e9864c into ramimbo:main Jun 5, 2026
2 checks passed
@ramimbo ramimbo added mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded labels Jun 5, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants