Validate staging dry-run identity envs#827
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds environment variable validation to the staging webhook dry-run script. New helper functions extract and validate the dry-run GitHub repository slug and contributor identity, enforcing ChangesStaging webhook dry-run environment validation
Possibly related issues
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
keilogic
left a comment
There was a problem hiding this comment.
Reviewed current head e00d9702a0d4c974ee579d5791d2579bd6bf65b4 against origin/main 12ca2f0510abce4f3a8b3d77ae8596f47fa5c74c.
Files inspected: scripts/staging_webhook_dry_run.py and tests/test_staging_webhook_dry_run.py.
What I checked:
_dry_run_repo()preserves the defaultramimbo/mergework, trims configured input, rejects blank values, and rejects malformed values before the issue URL or HTTP calls are built._dry_run_contributor()preserves the defaultmergework-dry-run, trims configured input, and rejects blank values before the webhook payload is posted.- The new negative tests monkeypatch
httpx.postto fail if validation happens after an HTTP call, so they prove the fail-closed ordering for malformed repo and blank contributor inputs. - The changed files match source issue #813; the PR body references #761 and #813, and I am treating bounty eligibility as a maintainer decision rather than a code blocker.
Validation:
python -m pytest tests/test_staging_webhook_dry_run.py -q-> 13 passedpython -m ruff check scripts/staging_webhook_dry_run.py tests/test_staging_webhook_dry_run.py-> passedpython -m ruff format --check scripts/staging_webhook_dry_run.py tests/test_staging_webhook_dry_run.py-> 2 files already formattedpython -m mypy scripts/staging_webhook_dry_run.py-> successpython scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> cleangit merge-tree --write-tree origin/main HEAD-> clean tree69a0941e9d813f2f121bc79fac170a49d2429ab0
GitHub reports mergeStateStatus=CLEAN; hosted Quality/readiness/docs/image and CodeRabbit are both successful. Duplicate search for #813, staging dry-run identity terms, MERGEWORK_DRY_RUN_REPO, and MERGEWORK_DRY_RUN_CONTRIBUTOR found only this open PR.
No blockers found in the reviewed scope.
Summary
MERGEWORK_DRY_RUN_REPObefore the staging dry-run helper builds an issue URL or posts to stagingowner/nameformMERGEWORK_DRY_RUN_CONTRIBUTORbefore building the webhook payloadBounty #761: #761
Source issue #813: #813
Refs #761
Validation
uv run --extra dev pytest tests/test_staging_webhook_dry_run.py -q-> 13 passeduv run --extra dev ruff format --check scripts/staging_webhook_dry_run.py tests/test_staging_webhook_dry_run.py-> 2 files already formatteduv run --extra dev ruff check scripts/staging_webhook_dry_run.py tests/test_staging_webhook_dry_run.py-> All checks passeduv run --extra dev python scripts/docs_smoke.py-> docs smoke okuv run --extra dev mypy app-> Success: no issues found in 39 source filesgit diff --check-> cleanLive duplicate/capacity check before PR:
gh issue view 813 -R ramimbo/mergework --json number,title,state,url,body,labels,updatedAt-> Proposed work: validate staging webhook dry-run identity env vars #813 open, labeledproposed-workgh pr list -R ramimbo/mergework --state open --search "813 OR staging webhook dry run OR MERGEWORK_DRY_RUN_REPO OR MERGEWORK_DRY_RUN_CONTRIBUTOR" --json number,title,author,url,headRefName,updatedAt,body-> no staging dry-run identity duplicate PR foundcurl -sS https://api.mrwk.online/api/v1/bounties?repo=ramimbo%2Fmergework-> MRWK bounty: 150 MRWK - focused fixes from confirmed project needs, round 3 #761 open with 6 effective awards remainingNo wallet, payout, treasury execution, bridge, exchange, cash-out, price, secrets, private details, or issue automation changes.
Summary by CodeRabbit
Refactor
Tests