Skip to content

Commit b98dcb1

Browse files
authored
chore: remove descriptions from fixes (#985)
1 parent 42862eb commit b98dcb1

4 files changed

Lines changed: 17 additions & 28 deletions

File tree

crates/zizmor/src/audit/artipacked.rs

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -144,29 +144,23 @@ impl Artipacked {
144144
/// Create a Fix for setting persist-credentials: false
145145
fn create_persist_credentials_fix<'doc>(step: &impl StepCommon<'doc>) -> Fix<'doc> {
146146
Fix {
147-
title: "Set persist-credentials: false".to_string(),
148-
description: "To prevent credential persistence, set 'persist-credentials: false' in this checkout step. \
149-
When 'persist-credentials' is true (the default), the GITHUB_TOKEN persists in the local git config \
150-
after checkout, which may be inadvertently leaked through subsequent actions like artifact uploads. \
151-
Setting 'persist-credentials: false' ensures that credentials don't persist beyond the checkout step itself.".to_string(),
147+
title: "set persist-credentials: false".to_string(),
152148
key: step.location().key,
153149
disposition: Default::default(),
154-
patches: vec![
155-
Patch {
156-
route: step.route(),
157-
operation: Op::MergeInto {
158-
key: "with".to_string(),
159-
value: {
160-
let mut with_map = serde_yaml::Mapping::new();
161-
with_map.insert(
162-
serde_yaml::Value::String("persist-credentials".to_string()),
163-
serde_yaml::Value::Bool(false),
164-
);
165-
serde_yaml::Value::Mapping(with_map)
166-
},
150+
patches: vec![Patch {
151+
route: step.route(),
152+
operation: Op::MergeInto {
153+
key: "with".to_string(),
154+
value: {
155+
let mut with_map = serde_yaml::Mapping::new();
156+
with_map.insert(
157+
serde_yaml::Value::String("persist-credentials".to_string()),
158+
serde_yaml::Value::Bool(false),
159+
);
160+
serde_yaml::Value::Mapping(with_map)
167161
},
168-
}
169-
],
162+
},
163+
}],
170164
}
171165
}
172166
}
@@ -239,7 +233,7 @@ mod tests {
239233
assert!(!finding.fixes.is_empty(), "Expected fixes but got none");
240234

241235
let fix = &finding.fixes[0];
242-
assert_eq!(fix.title, "Set persist-credentials: false");
236+
assert_eq!(fix.title, "set persist-credentials: false");
243237

244238
fix.apply(document).unwrap()
245239
}
@@ -248,14 +242,14 @@ mod tests {
248242
fn test_fix_title_and_description() {
249243
// Test that the fix has the expected title and description format
250244
// Since Step::new is private, we test this indirectly through the audit logic
251-
let title = "Set persist-credentials: false";
245+
let title = "set persist-credentials: false";
252246
let description_keywords = [
253247
"persist-credentials",
254248
"GITHUB_TOKEN",
255249
"credential persistence",
256250
];
257251

258-
assert_eq!(title, "Set persist-credentials: false");
252+
assert_eq!(title, "set persist-credentials: false");
259253
for keyword in description_keywords {
260254
// This is a basic smoke test - in practice, integration tests would verify the fix works
261255
assert!(!keyword.is_empty());

crates/zizmor/src/audit/bot_conditions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ impl BotConditions {
382382

383383
Some(Fix {
384384
title: "replace spoofable actor context".into(),
385-
description: "todo".into(),
386385
key: &workflow.key,
387386
disposition: FixDisposition::Safe,
388387
patches: vec![Patch {

crates/zizmor/src/audit/template_injection.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ impl TemplateInjection {
311311

312312
Some(Fix {
313313
title: "replace expression with environment variable".into(),
314-
description: "todo".into(),
315314
key: step.location().key,
316315
disposition: Default::default(),
317316
patches,

crates/zizmor/src/finding.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ pub(crate) struct Fix<'doc> {
123123
/// A short title describing the fix.
124124
#[allow(dead_code)]
125125
pub(crate) title: String,
126-
/// A detailed description of the fix.
127-
#[allow(dead_code)]
128-
pub(crate) description: String,
129126
/// The key back into the input registry that this fix applies to.
130127
pub(crate) key: &'doc InputKey,
131128
/// The fix's disposition.

0 commit comments

Comments
 (0)