Skip to content

Inject config environment access (#293)#330

Draft
lodyai[bot] wants to merge 1 commit into
mainfrom
issue-293-refactor-collect-diag-file-layers
Draft

Inject config environment access (#293)#330
lodyai[bot] wants to merge 1 commit into
mainfrom
issue-293-refactor-collect-diag-file-layers

Conversation

@lodyai
Copy link
Copy Markdown
Contributor

@lodyai lodyai Bot commented Jun 1, 2026

Summary

This branch completes the issue #293 environment-access refactor for early CLI
configuration resolution. It introduces an EnvProvider port, threads it
through explicit config selection and early diagnostic JSON resolution, and
removes the remaining direct process-environment dependency from
collect_diag_file_layers.

Closes #293.

Review walkthrough

Validation

  • cargo test --workspace config_merge: passed.
  • make check-fmt: passed.
  • make lint: passed.
  • make test: passed.
  • make markdownlint: passed.
  • make nixie: passed.
  • coderabbit review --agent: completed with zero findings on the main implementation pass.

Notes

make fmt was run after the documentation edit. Its Rust formatting step
completed, but the target exits non-zero in the Markdown formatting phase
because the underlying markdownlint --fix command reports repository-wide
line-length findings in pre-existing untouched documents. The formatter also
rewrote unrelated Markdown files, so those unrelated edits were restored. The
actual validation gates make check-fmt, make markdownlint, and make nixie
all pass on this branch.

Introduce an `EnvProvider` port for CLI configuration resolution.
Thread it through explicit config selection, diagnostic layer
collection, and early diagnostic JSON resolution so tests can use
deterministic environment doubles instead of process-wide mutation.

Reject malformed `NETSUKE_DIAG_JSON` values with a validation error,
and keep discovery load errors visible while resolving startup
diagnostic mode.
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Sorry @LodyAI[bot], you have reached your weekly rate limit of 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Draft detected.

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: ASSERTIVE

Plan: Pro Plus

Run ID: 42485bda-0c46-485a-83ff-baab5aeb37b7

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-293-refactor-collect-diag-file-layers

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

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.

Refactor collect_diag_file_layers to return Result, expose fallibility in resolve_merged_diag_json, and inject environment access via trait interface

1 participant