Skip to content

decrating: absorb shipper-environment into shipper::runtime::environment#65

Merged
EffortlessSteven merged 1 commit into
mainfrom
feature/decrating-absorb-environment
Apr 15, 2026
Merged

decrating: absorb shipper-environment into shipper::runtime::environment#65
EffortlessSteven merged 1 commit into
mainfrom
feature/decrating-absorb-environment

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Absorbs the 2202-LOC shipper-environment microcrate into crates/shipper/src/runtime/environment/ as crate-private modules (Phase 2 decrating).

Depends on PR #53 (dual-implementation cleanup for env + storage + git) being merged first — this PR stacks on feature/decrating-phase1-medium.

Split seams (~2190 LOC across 3 files):

All 13 insta snapshots preserved (renamed from shipper_environment__snapshot_tests__* to shipper__runtime__environment__snapshot_tests__*). All 130 absorbed tests pass in-tree.

Surgical unblock (precedent: PR #54 policy → engine-parallel inline)

shipper-state depended on shipper-environment via one call site in migrate_v1_to_v2. Because shipper-state is an (optional) dep of shipper, it cannot depend on shipper itself — a dep cycle. This PR inlines a ~20-LOC collect_environment_fingerprint into shipper-state (marked #[doc(hidden)], with a TODO comment pointing at crate::runtime::environment) and drops shipper-environment from shipper-state/Cargo.toml. The inline will be replaced with a direct call after shipper-state is itself absorbed into shipper::state.

API discipline

  • Module is pub(crate) mod runtime; mod environment; — the former public shipper::environment API had no external consumers in-tree, so it goes crate-private per runtime-layer rules.
  • #[allow(dead_code)] at the runtime::environment level: several absorbed items (CI branch/SHA/PR helpers, the short pipe-fingerprint form, EnvironmentInfo::fingerprint) have no in-crate callers yet but keep full test coverage for future wiring.
  • shipper's insta dev-dep is bumped to features = ["yaml"] (required by the moved snapshot_tests module).

Per docs/decrating-plan.md §6 Phase 2.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo check --workspace
  • cargo test -p shipper-state (39 passed — confirms surgical unblock)
  • cargo test -p shipper --lib (854 passed)
  • cargo test -p shipper --lib runtime::environment (130 passed — absorbed suite)
  • cargo test -p shipper --tests (34 integration + 2 schema passed)
  • cargo test -p shipper-cli --bins (16 passed)
  • CI green on the PR
  • Rebase onto main after PR decrating: Phase 1 (medium batch) — collapse dual implementations for environment/storage/git #53 merges

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 42 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 12 minutes and 42 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ce2d6b5a-acc9-437b-93e7-1af77517228f

📥 Commits

Reviewing files that changed from the base of the PR and between b001c0f and 7bf17f0.

⛔ Files ignored due to path filters (13)
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__ci_environment_all_debug_variants.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__ci_environment_all_display_variants.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__ci_environment_serialization.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_fingerprint_prerelease_version.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_fingerprint_structured.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_fingerprint_structured_unknown_versions.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_fingerprint_github_actions_with_vars.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_fingerprint_local_no_vars.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_fingerprint_string_ci_with_vars.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_fingerprint_string_local.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_gitlab_ci.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_many_env_vars.snap is excluded by !**/*.snap
  • crates/shipper/src/runtime/environment/snapshots/shipper__runtime__environment__snapshot_tests__environment_info_windows_aarch64.snap is excluded by !**/*.snap
📒 Files selected for processing (20)
  • Cargo.toml
  • RELEASE_CHECKLIST_v0.3.0.md
  • crates/shipper-environment/CLAUDE.md
  • crates/shipper-environment/Cargo.toml
  • crates/shipper-environment/README.md
  • crates/shipper-environment/proptest-regressions/lib.txt
  • crates/shipper-environment/src/lib.rs
  • crates/shipper-state/Cargo.toml
  • crates/shipper-state/src/lib.rs
  • crates/shipper/Cargo.toml
  • crates/shipper/src/engine/mod.rs
  • crates/shipper/src/environment.rs
  • crates/shipper/src/lib.rs
  • crates/shipper/src/runtime/CLAUDE.md
  • crates/shipper/src/runtime/environment/CLAUDE.md
  • crates/shipper/src/runtime/environment/ci.rs
  • crates/shipper/src/runtime/environment/fingerprint.rs
  • crates/shipper/src/runtime/environment/mod.rs
  • crates/shipper/src/runtime/mod.rs
  • docs/architecture.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/decrating-absorb-environment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e002fd33b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}
}
pub use shipper_storage::{CloudStorageConfig, StorageBackend, StorageType};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep StorageBackend API compatible with prior trait

Re-exporting shipper_storage::StorageBackend here changes the public trait contract: it now requires list (and inherits new default methods), whereas shipper::storage::StorageBackend previously had no list requirement. Any downstream crate that implemented the old trait will fail to compile after this change, which contradicts the shim’s stated goal of preserving the existing API surface.

Useful? React with 👍 / 👎.

Stacks on PR #53 (env+storage+git dual-impl cleanup). Move the 2202-LOC
shipper-environment crate into crates/shipper/src/runtime/environment/
as crate-private modules (mod.rs + fingerprint.rs + ci.rs, ~2190 LOC
total). Preserves the deduped in-tree wrapper logic (normalize_version,
EnvironmentInfo::collect delegation with graceful fallback) from PR #53.

Split seams:
- mod.rs         — CiEnvironment, detect_environment, is_ci,
                   collect_environment_fingerprint (the absorbed shim),
                   CiEnvironment snapshot tests.
- fingerprint.rs — EnvironmentInfo, get_rust_version, get_cargo_version,
                   get_environment_fingerprint, normalize_tool_version,
                   collect_env_vars, tests + proptests.
- ci.rs          — get_ci_branch, get_ci_commit_sha, is_pull_request,
                   provider-specific tests.

All 13 snapshots preserved (renamed to `shipper__runtime__environment__
snapshot_tests__*.snap`). All 130 absorbed tests pass in-tree.

Surgical unblock (precedent: PR #54 policy→engine-parallel inline):
shipper-state depended on shipper-environment via one call site in
migrate_v1_to_v2. Because shipper-state is an (optional) dep of
shipper, it cannot depend on shipper itself — a dep cycle. Inlined an
~20-LOC collect_environment_fingerprint into shipper-state (marked
`#[doc(hidden)]`, with a comment pointing back at
crate::runtime::environment for the post-shipper-state-absorption
replacement), and dropped shipper-environment from shipper-state's
Cargo.toml. Will be replaced with a direct call to
crate::runtime::environment::collect_environment_fingerprint after
shipper-state is itself absorbed into shipper::state.

Module is `pub(crate) mod runtime; mod environment;` — the former
public `shipper::environment` API had no external consumers in-tree
and is now crate-private per the runtime-layer discipline.
`#[allow(dead_code)]` is applied at the runtime::environment level
because several absorbed items (CI branch/SHA/PR helpers, the short
pipe-fingerprint form, EnvironmentInfo::fingerprint) currently have
no in-crate callers but retain full test coverage for future wiring.

Also updates shipper's `insta` dev-dep to enable the `yaml` feature
(required by the moved snapshot_tests module).

Per docs/decrating-plan.md section 6 Phase 2.
@EffortlessSteven EffortlessSteven force-pushed the feature/decrating-absorb-environment branch from 4e002fd to 7bf17f0 Compare April 15, 2026 07:25
@EffortlessSteven EffortlessSteven merged commit 5924c30 into main Apr 15, 2026
9 of 15 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