-
Notifications
You must be signed in to change notification settings - Fork 0
Add a --ref flag for pinned suite installation (#271) #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leynos
wants to merge
26
commits into
main
Choose a base branch
from
issue-271-ref-pinned-installation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
47d9117
Add ExecPlan for ref-pinned suite installation (#271)
02e04f3
Add --ref flag to installer CLI for pinned installs
ae6266d
Add git helpers for resolving and pinning refs
91bcd35
Pin the managed clone to a requested ref
27e48e6
Gate the prebuilt fast path on the pinned commit
c0b9ef3
Report the pinned ref in dry-run and progress output
cc10422
Document the --ref pinned-install flag
15323e0
Address pinned installer review feedback (#271)
1304b5b
Resolve fetched branch pins via FETCH_HEAD (#271)
leynos b1955f7
Strengthen pinned installation review coverage (#271)
leynos e32f12b
Strengthen pinned-ref review coverage (#271)
leynos c82530a
Harden pinned ref resolution and reporting (#271)
leynos 23ce765
Preserve pinned validation during offline installs (#271)
leynos ed6b4f1
Require exact provenance for pinned prebuilts (#271)
leynos 7c2b332
Document 0.3.0 installer migration
leynos c3405fa
Add installer diagnostics and output contracts (#271)
leynos 172136e
Parameterize dry-run output tests (#271)
leynos 5f66124
Snapshot installer progress output (#271)
leynos e8b880a
Harden installer provenance test fixtures (#271)
leynos 9d0e3c5
Caption Git operation API reference
leynos 77edfa6
Remove Git API table triage metadata
leynos a370849
Harden pinned checkout provenance and locking (#271)
leynos 56b5aae
Serialize managed clone preparation (#271)
leynos 7293a27
Test managed-clone lock serialization (#271)
leynos 71c6b47
Harden default branch recovery (#271)
leynos dbef184
Strengthen pinned installation verification (#271)
leynos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
90 changes: 90 additions & 0 deletions
90
crates/no_std_fs_operations/tests/no_default_features_build.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| //! Compile-time regression guard for the `dylint-driver`-disabled build. | ||
| //! | ||
| //! The crate is a Dylint lint library: the lint logic lives behind the | ||
| //! optional `dylint-driver` feature, while the default feature set is empty so | ||
| //! the crate can be built by tools that only need a plain library. Issue #322 | ||
| //! removed the private stub that previously existed solely to keep that | ||
| //! empty build warning-free. This test re-checks the configuration the stub | ||
| //! existed for: `cargo check --no-default-features --lib` must still succeed | ||
| //! with warnings denied, now without relying on that stub. | ||
| //! | ||
| //! The check is deliberately restricted to the library target: the crate's | ||
| //! integration test binaries are Dylint harnesses that require `cargo-dylint` | ||
| //! and `dylint-link`, which must not be assumed here. The nested `cargo` | ||
| //! invocation therefore inherits the outer `RUSTFLAGS` (so `-D warnings` from | ||
| //! the Makefile gate applies) but uses an isolated target directory so it never | ||
| //! contends with the outer build. | ||
|
|
||
| use std::path::PathBuf; | ||
| use std::process::Command; | ||
|
|
||
| use anyhow::Context as _; | ||
| use serde_json::Value; | ||
| use tempfile::TempDir; | ||
|
|
||
| /// Top-level name of the package under test. | ||
| const CRATE: &str = "no_std_fs_operations"; | ||
|
|
||
| /// Runs `cargo check --no-default-features --lib` for this crate and asserts | ||
| /// that the build succeeds with warnings denied (via inherited `RUSTFLAGS`). | ||
| /// | ||
| /// The workspace manifest is located by walking up from this test crate's | ||
| /// manifest directory, mirroring `integration_exclusion.rs`, so the nested | ||
| /// invocation resolves the same workspace this test builds under. | ||
| #[test] | ||
| fn crate_builds_without_dylint_driver_feature() -> anyhow::Result<()> { | ||
| let workspace_root = workspace_root()?; | ||
| let target_dir = TempDir::new().context("failed to create isolated target directory")?; | ||
|
|
||
| let output = Command::new("cargo") | ||
| .arg("check") | ||
| .arg("--package") | ||
| .arg(CRATE) | ||
| .arg("--no-default-features") | ||
| .arg("--lib") | ||
| .arg("--message-format=json") | ||
| .current_dir(&workspace_root) | ||
| .env("CARGO_TARGET_DIR", target_dir.path()) | ||
| .output() | ||
| .context("failed to execute nested cargo check")?; | ||
|
|
||
| let stdout = String::from_utf8_lossy(&output.stdout); | ||
| let stderr = String::from_utf8_lossy(&output.stderr); | ||
| assert!( | ||
| output.status.success(), | ||
| "`cargo check --no-default-features --lib` for `{CRATE}` failed \ | ||
| (it must compile without the `dylint-driver` feature now that the \ | ||
| no-driver stub is gone):\n{stderr}" | ||
| ); | ||
|
|
||
| let diagnostics = stdout | ||
| .lines() | ||
| .filter_map(|line| serde_json::from_str::<Value>(line).ok()) | ||
| .filter(|message| message["reason"] == "compiler-message") | ||
| .collect::<Vec<_>>(); | ||
| assert!( | ||
| diagnostics.is_empty(), | ||
| "`cargo check --no-default-features --lib` for `{CRATE}` emitted \ | ||
| compiler diagnostics under `-D warnings`: {diagnostics:#?}" | ||
| ); | ||
|
|
||
| Ok(()) | ||
| } | ||
|
|
||
| /// Returns the workspace root containing this crate's manifest. | ||
| fn workspace_root() -> anyhow::Result<PathBuf> { | ||
| let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
| let mut candidate = manifest_dir.as_path(); | ||
| loop { | ||
| if candidate.join("Cargo.toml").is_file() { | ||
| let workspace = std::fs::read_to_string(candidate.join("Cargo.toml")) | ||
| .context("failed to read candidate workspace Cargo.toml")?; | ||
| if workspace.contains("[workspace]") { | ||
| return Ok(candidate.to_path_buf()); | ||
| } | ||
| } | ||
| candidate = candidate | ||
| .parent() | ||
| .context("workspace root not found above CARGO_MANIFEST_DIR")?; | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the repository-approved filesystem abstractions.
Replace
std::path::PathBufwithcaminoand perform the manifest read throughcap_stdorcap_std::fs_utf8. Reuse an existing repository helper when available.As per coding guidelines: use
cap_std,cap_std::fs_utf8, orcaminoinstead ofstd::fsandstd::pathfor filesystem access.Also applies to: 74-89
🤖 Prompt for AI Agents
Source: Coding guidelines