Skip to content

refactor(providers): split provider_github.zig into focused modules - #437

Merged
apotema merged 1 commit into
developmentfrom
refactor/split-provider-github
Sep 26, 2026
Merged

apotema merged 1 commit into
developmentfrom
refactor/split-provider-github

Conversation

@apotema

@apotema apotema commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Refactor-only split of src/cli/provider_github.zig (1,408 lines) under the toolkit's 1,000-line rule, following the labelle-bgfx gfx/ pattern: a thin re-exporting root plus a directory of focused files. No caller changes; the public API is re-exported unchanged.

File map

File Lines Contents
src/cli/provider_github.zig 53 Thin root: re-exports the public API, owns extraction_count (a var can't be aliased), test {} referencing every module
provider_github/pin.zig 112 Pin, Document, lock_name, parse, checkPins + identity/strict-document test
provider_github/files.zig 35 read, cacheRoot, uniqueName, sha256Hex, writeAtomically
provider_github/archive.zig 253 archivePath, download, verified archive, cachedManifest, tar validation (safe path, ASCII, control chars, device names, case-folded file/dir) + its tests
provider_github/sources.zig 214 Sources, Extractions, checkName
provider_github/registry_cache.zig 214 registry_cache_dir/file, registry_hint_scan_limit, cachedRegistryOwner, cacheRegistry + hint tests
provider_github/preview.zig 330 preview_name, PreviewEntry, Preview, digest, writePreview/loadPreview/checkPreview, removePreview + preview-binding tests
provider_github/resolve.zig 238 registry_url, resolve (preview / --accept, lock writing) + whole-document and schema-2 claim tests
provider_github/test_fixtures.zig 117 AcceptFixture, testProviderArchive (test-only)

What changed besides moves

  • Helpers now shared across files gained pub (read, uniqueName, sha256Hex, writeAtomically, archive, validateTar, safeArchivePath, cachedManifest, cacheRegistry, jsonText, removePreview, PreviewEntry.toPin, the fixture's methods). None of them are re-exported from the root.
  • sources.zig bumps github.extraction_count through the root import, since a var cannot be re-exported. pipeline.zig keeps reading provider_github.extraction_count.
  • One local alias was renamed (files became files_mod in archive.zig) because validateTar has a local named files.

Test counts (before / after)

Step Before After
zig build test-provider-dispatch 73/73 74/74
zig build test 1070/1075 (5 skipped) 1071/1076 (5 skipped)

The +1 in both is the new unnamed test {} reference block in the root, which counts as a test. With that block removed temporarily the dispatch step reports 73/73, so every original named test still runs.

Verification

zig fmt --check (on the changed files), zig build, zig build -Dtarget=x86_64-windows, zig build test (includes the agnosticism guard) and zig build test-provider-dispatch all exit 0. The Python e2e suites also pass, with each exit code checked separately: provider_dispatch (25), provider_github (70), provider_config (21), provider_hooks (43), provider_targets (40) and plugin_compat.

https://claude.ai/code/session_01R2K5sJDL5Msn1uRTkybiDP


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

provider_github.zig (1,408 lines) becomes a thin root that re-exports the
same public API over provider_github/{pin,files,archive,sources,
registry_cache,preview,resolve,test_fixtures}.zig. Moves plus import fixes
only: helpers shared across the new files gained `pub`, `extraction_count`
stays a var in the root (sources.zig bumps it through the root import), and
a `test {}` block in the root references every module so no file's tests
are dropped by lazy analysis.

Claude-Session: https://claude.ai/code/session_01R2K5sJDL5Msn1uRTkybiDP
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 3f8facb8-2491-4e12-bd20-0bf2ed417886

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T21:34:57.856853Z 36ec255 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@apotema
apotema merged commit e87a6ab into development Sep 26, 2026
8 checks passed
@apotema
apotema deleted the refactor/split-provider-github branch September 26, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant