Skip to content

Commit b4321df

Browse files
committed
cargo-rail: manual testing and updates to UX/ergonomics.
1 parent 1ed6f7c commit b4321df

File tree

8 files changed

+51
-24
lines changed

8 files changed

+51
-24
lines changed

.github/actions/setup/action.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ runs:
3434
with:
3535
tool: cargo-audit
3636

37+
- name: Install cargo-semver-checks
38+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2
39+
with:
40+
tool: cargo-semver-checks
41+
42+
- name: Install git-cliff
43+
uses: taiki-e/install-action@6f9c7cc51aa54b13cbcbd12f8bbf69d8ba405b4b # v2
44+
with:
45+
tool: git-cliff
46+
3747
- name: Install Rust Nightly Toolchain
3848
uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # master
3949
with:

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ AGENTS.md
2222
*.pem
2323
*.key
2424

25+
# Cargo-Rail (Testing)
26+
rail.toml
2527
# Notes
26-
TESTING_PLAN.md
2728
STATUS.md
29+
E2E_TESTING_SETUP.md
30+
CLEAN.md
31+
32+
# Documentation
2833
docs/RELEASE_GUIDE.md
2934
docs/SECURITY.md
3035
docs/USER_GUIDE.md

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ jobs:
502502
- [USER_GUIDE.md](docs/USER_GUIDE.md) - Complete walkthrough
503503
- [SECURITY.md](docs/SECURITY.md) - Threat model and mitigations
504504
- [RELEASE_GUIDE.md](docs/RELEASE_GUIDE.md) - Release workflow
505-
- [TESTING_PLAN.md](TESTING_PLAN.md) - Manual testing checklist
505+
- [E2E_TESTING_SETUP.md](E2E_TESTING_SETUP.md) - End-to-end testing guide
506506
- [STATUS.md](STATUS.md) - Development status
507507

508508
---

crates/cargo-rail/src/checks/security_config.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ impl Check for SecurityConfigCheck {
1818
}
1919

2020
fn run(&self, ctx: &CheckContext) -> RailResult<CheckResult> {
21+
// Detect actual config file location
22+
let config_path = RailConfig::find_config_path(&ctx.workspace_root);
23+
2124
// Try to load configuration
2225
let config = match RailConfig::load(&ctx.workspace_root) {
2326
Ok(c) => c,
@@ -109,11 +112,15 @@ impl Check for SecurityConfigCheck {
109112
if warnings.is_empty() {
110113
Ok(CheckResult::pass(self.name(), message))
111114
} else {
112-
Ok(CheckResult::warning(
113-
self.name(),
114-
message,
115-
Some("Review security settings in .rail/config.toml"),
116-
))
115+
// Use actual config path in suggestion
116+
let suggestion = if let Some(path) = config_path {
117+
let relative_path = path.strip_prefix(&ctx.workspace_root).unwrap_or(&path);
118+
format!("Review security settings in {}", relative_path.display())
119+
} else {
120+
"Review security settings in rail.toml".to_string()
121+
};
122+
123+
Ok(CheckResult::warning(self.name(), message, Some(&suggestion)))
117124
}
118125
}
119126

crates/cargo-rail/src/commands/status.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn print_status_table(statuses: &[CrateStatus]) {
216216

217217
// Header
218218
println!("{:<20} {:<12} {:<20} {:<10} REMOTE", "CRATE", "SPLIT", "SYNC", "DIRTY");
219-
println!("{:-<80}", "");
219+
println!("{:-<120}", "");
220220

221221
for status in statuses {
222222
let split_str = match status.split_status {
@@ -235,9 +235,12 @@ fn print_status_table(statuses: &[CrateStatus]) {
235235

236236
let dirty_str = if status.dirty { "yes" } else { "no" };
237237

238-
// Truncate remote URL for display
239-
let remote_display = if status.remote.len() > 35 {
240-
format!("{}...", &status.remote[..32])
238+
// Intelligently truncate remote URL for display (preserve end which has repo name)
239+
let remote_display = if status.remote.len() > 75 {
240+
// Truncate from middle to preserve repo name at end
241+
let start = &status.remote[..35];
242+
let end = &status.remote[status.remote.len().saturating_sub(35)..];
243+
format!("{}...{}", start, end)
241244
} else {
242245
status.remote.clone()
243246
};

crates/cargo-rail/src/core/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub enum SplitMode {
9393

9494
impl RailConfig {
9595
/// Find config file in search order: rail.toml, .rail.toml, .cargo/rail.toml, .config/rail.toml
96-
fn find_config_path(path: &Path) -> Option<PathBuf> {
96+
pub fn find_config_path(path: &Path) -> Option<PathBuf> {
9797
let candidates = vec![
9898
path.join("rail.toml"),
9999
path.join(".rail.toml"),

deny.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[graph]
2-
# Target Coverage for Rail Substrate
32
targets = [
43
"x86_64-unknown-linux-gnu",
54
"aarch64-unknown-linux-gnu",
@@ -11,7 +10,7 @@ targets = [
1110
[advisories]
1211
yanked = "warn"
1312

14-
# Ignore unmaintained advisories for transitive dependencies we cannot easily control
13+
# Ignore unmaintained advisories for transitive dependencies we cannot easily control - TODO: Remove this once we have a better solution
1514
ignore = [
1615
"RUSTSEC-2024-0370", # proc-macro-error (via git-cliff-core → rust-embed → include-flate)
1716
]

rail.toml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
root = "/Users/mr.wolf/loadingalias/cargo-rail"
33

44
[security]
5-
require_signed_commits = false
5+
require_signed_commits = true
66
pr_branch_pattern = "rail/sync/{crate}/{timestamp}"
77
protected_branches = [
88
"main",
99
"master",
1010
]
1111

1212
[[splits]]
13-
name = "cargo-rail"
14-
remote = "../test-crate-a-split"
13+
name = "test-crate-a"
14+
remote = "[email protected]:loadingalias/cargo-rail-test-core.git"
1515
branch = "main"
1616
mode = "single"
1717
include = [
@@ -24,11 +24,11 @@ include = [
2424
exclude = []
2525

2626
[[splits.paths]]
27-
crate = "crates/cargo-rail"
27+
crate = "crates/test-crate-a"
2828

2929
[[splits]]
30-
name = "test-crate-a"
31-
remote = "../test-crate-a-split"
30+
name = "test-crate-b"
31+
remote = "[email protected]:loadingalias/cargo-rail-test-client.git"
3232
branch = "main"
3333
mode = "single"
3434
include = [
@@ -41,13 +41,13 @@ include = [
4141
exclude = []
4242

4343
[[splits.paths]]
44-
crate = "crates/test-crate-a"
44+
crate = "crates/test-crate-b"
4545

4646
[[splits]]
47-
name = "test-crate-b"
48-
remote = "../test-crate-a-split"
47+
name = "test-combined"
48+
remote = "[email protected]:loadingalias/cargo-rail-test-combined.git"
4949
branch = "main"
50-
mode = "single"
50+
mode = "combined"
5151
include = [
5252
"src/**",
5353
"tests/**",
@@ -57,5 +57,8 @@ include = [
5757
]
5858
exclude = []
5959

60+
[[splits.paths]]
61+
crate = "crates/test-crate-a"
62+
6063
[[splits.paths]]
6164
crate = "crates/test-crate-b"

0 commit comments

Comments
 (0)