Skip to content

refactor(enrich/maintainer): split into submodule directory (#57 2/3)#64

Merged
Metbcy merged 2 commits into
mainfrom
refactor/split-maintainer-rs-57
Jun 1, 2026
Merged

refactor(enrich/maintainer): split into submodule directory (#57 2/3)#64
Metbcy merged 2 commits into
mainfrom
refactor/split-maintainer-rs-57

Conversation

@Metbcy
Copy link
Copy Markdown
Owner

@Metbcy Metbcy commented Jun 1, 2026

Part 2 of 3 for #57 (module size budget round 2). Follows the same pattern as #62 (run.rs split).

What

src/enrich/maintainer.rs (1284 LOC) split into src/enrich/maintainer/ (8 files):

  • mod.rs (79): header doc, module decls, pub use re-exports
  • types.rs (74): Host, MaintainerAgeFinding, MaintainerInfo, LookupError, response structs, constants
  • pipeline.rs (206): enrich, enrich_with, enrich_with_hosts
  • github.rs (118): lookup_github_repo, github_get
  • gitlab.rs (129): lookup_gitlab_repo, gitlab_get
  • codeberg.rs (19): lookup_codeberg_repo
  • parsing.rs (286): URL parsers, ISO-8601, percent_encode, JSON extractors, Link header
  • tests.rs (421): full #[cfg(test)] block

Biggest non-test file: parsing.rs at 286 LOC. Well under the 600 budget.

Behavior change

None. Pure mechanical cut/paste. Public API preserved via pub use in mod.rs (verified pub(crate) helpers like parse_github_repo and iso8601_to_unix_seconds still resolve at their old paths).

Verification

  • cargo test --lib: 429 passed, 0 failed
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo test --lib enrich::maintainer: 43 passed

Follow-up

3/3 of #57: split src/render/sarif.rs (1205 LOC). Coming next.

src/enrich/maintainer.rs (1284 LOC) -> src/enrich/maintainer/:
- types.rs (74): Host, MaintainerAgeFinding, MaintainerInfo, LookupError, GithubResponse, GitlabResponse, constants
- pipeline.rs (206): enrich, enrich_with, enrich_with_hosts
- github.rs (118): lookup_github_repo, github_get
- gitlab.rs (129): lookup_gitlab_repo, gitlab_get
- codeberg.rs (19): lookup_codeberg_repo
- parsing.rs (286): URL/ISO/percent/JSON/Link-header helpers
- tests.rs (421): full #[cfg(test)] block

Biggest non-test file: parsing.rs at 286 LOC. Public API unchanged
(re-exported via mod.rs). Pure mechanical split, zero behavior change.
429 lib tests pass, clippy clean.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Coverage report

Line coverage: 84.2% (9585 / 11384 lines)

Full lcov report available as workflow artifact coverage-lcov: download from this run.

v0.9.8 introduces this report; --fail-under-lines will be added once coverage is visible across 2–3 releases.

@Metbcy Metbcy merged commit 8143f15 into main Jun 1, 2026
10 checks passed
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