Repository navigation
feat: effect document, github-repo targets and GitHub REST client - #2
Open
ccf-lisa[bot] wants to merge 3 commits into
Open
ccf-lisa[bot] wants to merge 3 commits into
ccf-lisa[bot] wants to merge 3 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
ccf-lisa
Bot
force-pushed
the
effector/02-github-client
branch
from
December 2, 2026 11:00
fbfccd1 to
1387be9
Compare
The effect document fields the plugin reads, the github-repo target scheme, and a small GitHub REST client over net/http for the calls the plugin makes (repository, direct collaborators, invitations, web commit signoff), with Link pagination kept on the API host and errors that carry the call and GitHub's message but never the token. Tests use an httptest fake GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared golangci-lint config the CI now uses enables bodyclose and errorlint: send returns the response headers instead of the response (it already closes the body), and the Link URL parse error is wrapped with %w.
GitHub redirects a renamed or transferred repository's calls (301 GET, 307 PATCH/DELETE) to its new location, and net/http followed them with the token, so an action could change a repository its targets don't allow. The client no longer follows redirects and fails with "repository moved to …"; getRepository and setWebCommitSignoff also fail when full_name differs (ignoring case) from the target.
ccf-lisa
Bot
force-pushed
the
effector/02-github-client
branch
from
December 2, 2026 23:50
1387be9 to
396270e
Compare
Contributor
Author
|
Adding |
This was referenced Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 2/5 for
effector-github-settings: the effect document,github-repotargets and the GitHub REST client.Part 2 (GitHub client) of Plugins → effector-github-settings; LLD (Manifest target scheme, Rule parameters' GitHub calls, Testing). Ported from the PoC.
What
internal/document.go: the fields of the effect document the plugin reads (accepts the effect or a whole webhook body), andParseTargetforgithub-repo:github.com/<owner>/<repo>(rejects other schemes, bad values,./..).internal/github.go: a small net/http client for the five calls the plugin makes:GET /repos/{o}/{r},PATCHit (web commit signoff),GET/DELETEdirect collaborators (affiliation=direct),GET/DELETEinvitations. GitHub'sAcceptand API version headers, a 30s timeout, Link pagination (100 per page, at most 100 pages) that refuses next URLs off the API host so the token never leaves it. Errors read<METHOD> <path>: <status> <GitHub message>(with the rate-limit reset time when GitHub sends one), capped at 300 characters, never the token or URL.repository moved to …, andgetRepository/setWebCommitSignofffail whenfull_nameisn't the target's (case aside).httptestfake GitHub (fakegithub_test.go, reused by later PRs): reads and writes, pagination, page cap, off-host links, 401/403/404, rate limit, non-JSON bodies, long messages, GHE base path, transport errors. No test calls the real GitHub API.Deviation from the PoC
apiErroromits the status when there was no response (it printedGET /x: 0 canceled).Local gate
Build, vet,
go test -race, golangci-lint v2.15.0 with the shared workflows config (0 issues),go mod tidyclean, with the sibling checkouts. CI fails on module resolution until 5/5 (accepted).The shared lint config (CI since 1/5) enables
bodycloseanderrorlint:sendreturns the response headers instead of the response (it already closed the body), and the Link URL parse error is wrapped with%w.Counted lines: 1026 (
size-exception: the redirect fix and its 301/307 tests from review).🤖 Generated with Claude Code