Skip to content

Commit e39c31a

Browse files
EvalOpsBotcursoragenthaasonsaas
authored
Audit panic paths, split config domains, and align release metadata (#37)
* fix: harden parser panic paths Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> * refactor: group config domains and trim path modules Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> * fix: align release metadata with tagged version Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> * build: pin jsonwebtoken for Rust 1.83 Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> * build: pin Rust toolchain for current deps Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> * build: raise pinned Rust toolchain to 1.88 Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> * Preserve zero hunk line counts * fix(ci): release.yml YAML parse + clippy uninlined_format_args - release: use python3 -c one-liners for version check (avoid heredoc that actionlint parses as YAML) - Apply clippy uninlined_format_args fixes across codebase for lint job Made-with: Cursor --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com> Co-authored-by: Jonathan Haas <jonathan@haas.holdings>
1 parent 71be8c4 commit e39c31a

File tree

111 files changed

+768
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+768
-812
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ jobs:
2828
- name: Extract version
2929
id: get_version
3030
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Verify release metadata matches tag
33+
env:
34+
TAG_NAME: ${{ steps.get_version.outputs.VERSION }}
35+
run: |
36+
set -euo pipefail
37+
expected_version="${TAG_NAME#v}"
38+
cargo_version="$(python3 -c "import tomllib; from pathlib import Path; print(tomllib.loads(Path('Cargo.toml').read_text())['package']['version'])")"
39+
chart_app_version="$(python3 -c "import re; from pathlib import Path; c=Path('charts/diffscope/Chart.yaml').read_text(); m=re.search(r'^appVersion:\s*\"?(.*?)\"?\s*\$', c, re.MULTILINE); (exit('Chart.yaml missing appVersion') if not m else print(m.group(1)))")"
40+
test "$cargo_version" = "$expected_version" || {
41+
echo "Cargo.toml version ($cargo_version) does not match tag ($expected_version)"
42+
exit 1
43+
}
44+
test "$chart_app_version" = "$expected_version" || {
45+
echo "Chart appVersion ($chart_app_version) does not match tag ($expected_version)"
46+
exit 1
47+
}
3148
3249
- name: Create Release
3350
id: create_release
@@ -264,4 +281,4 @@ jobs:
264281
- name: Upload SBOM to release
265282
env:
266283
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
267-
run: gh release upload ${{ github.ref_name }} sbom-diffscope.spdx.json --clobber || true
284+
run: gh release upload ${{ github.ref_name }} sbom-diffscope.spdx.json --clobber || true

charts/diffscope/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: diffscope
33
description: AI-powered code review engine with smart analysis and professional reporting
44
type: application
55
version: 0.1.0
6-
appVersion: "0.5.3"
6+
appVersion: "0.5.26"
77
home: https://github.com/evalops/diffscope
88
sources:
99
- https://github.com/evalops/diffscope

eval/dag-runtime-smoke-or.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,4 +2195,4 @@
21952195
]
21962196
}
21972197
]
2198-
}
2198+
}

eval/frontier-e2e-or.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9981,4 +9981,4 @@
99819981
]
99829982
}
99839983
]
9984-
}
9984+
}

eval/frontier-smoke-or.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5904,4 +5904,4 @@
59045904
]
59055905
}
59065906
]
5907-
}
5907+
}

src/adapters/anthropic.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,7 @@ mod tests {
407407
let err_msg = format!("{:#}", result.unwrap_err());
408408
assert!(
409409
err_msg.contains("401") || err_msg.contains("Unauthorized"),
410-
"Error should mention 401 or Unauthorized, got: {}",
411-
err_msg
410+
"Error should mention 401 or Unauthorized, got: {err_msg}"
412411
);
413412
mock.assert_async().await;
414413
}
@@ -502,8 +501,7 @@ mod tests {
502501
let err = result.unwrap_err().to_string();
503502
assert!(
504503
err.contains("Unsupported content type"),
505-
"Error should mention unsupported type, got: {}",
506-
err
504+
"Error should mention unsupported type, got: {err}"
507505
);
508506
}
509507

@@ -534,8 +532,7 @@ mod tests {
534532
let err = result.unwrap_err().to_string();
535533
assert!(
536534
err.contains("empty content"),
537-
"Error should mention empty content: {}",
538-
err
535+
"Error should mention empty content: {err}"
539536
);
540537
}
541538

src/adapters/ollama.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,10 @@ mod tests {
211211
fn chat_response_body(content: &str, model: &str, done: bool) -> String {
212212
format!(
213213
r#"{{
214-
"message": {{"role": "assistant", "content": "{}"}},
215-
"model": "{}",
216-
"done": {}
217-
}}"#,
218-
content, model, done
214+
"message": {{"role": "assistant", "content": "{content}"}},
215+
"model": "{model}",
216+
"done": {done}
217+
}}"#
219218
)
220219
}
221220

@@ -227,13 +226,12 @@ mod tests {
227226
) -> String {
228227
format!(
229228
r#"{{
230-
"message": {{"role": "assistant", "content": "{}"}},
231-
"model": "{}",
229+
"message": {{"role": "assistant", "content": "{content}"}},
230+
"model": "{model}",
232231
"done": true,
233-
"prompt_eval_count": {},
234-
"eval_count": {}
235-
}}"#,
236-
content, model, prompt_eval, eval
232+
"prompt_eval_count": {prompt_eval},
233+
"eval_count": {eval}
234+
}}"#
237235
)
238236
}
239237

src/adapters/openai.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,7 @@ mod tests {
771771
let err_msg = format!("{:#}", result.unwrap_err());
772772
assert!(
773773
err_msg.contains("401") || err_msg.contains("Unauthorized"),
774-
"Error should mention 401 or Unauthorized, got: {}",
775-
err_msg
774+
"Error should mention 401 or Unauthorized, got: {err_msg}"
776775
);
777776
mock.assert_async().await;
778777
}
@@ -814,8 +813,7 @@ mod tests {
814813
let err_msg = format!("{:#}", result.unwrap_err());
815814
assert!(
816815
err_msg.contains("429") || err_msg.contains("Rate limited"),
817-
"Error should mention rate limiting, got: {}",
818-
err_msg
816+
"Error should mention rate limiting, got: {err_msg}"
819817
);
820818
mock.assert_async().await;
821819
}
@@ -866,8 +864,7 @@ mod tests {
866864
let err = result.unwrap_err().to_string();
867865
assert!(
868866
err.contains("empty choices"),
869-
"Error should mention empty choices: {}",
870-
err
867+
"Error should mention empty choices: {err}"
871868
);
872869
}
873870

src/commands/doctor/command/display/config.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@ pub(in super::super) fn print_configuration(config: &Config) {
2727
}
2828
);
2929
if let Some(cw) = config.context_window {
30-
println!(" Context: {} tokens", cw);
30+
println!(" Context: {cw} tokens");
3131
}
3232
println!();
3333
}
3434

3535
pub(in super::super) fn print_unreachable(base_url: &str) -> Result<()> {
3636
println!("UNREACHABLE");
37-
println!(
38-
"\nCannot reach {}. Make sure your LLM server is running.",
39-
base_url
40-
);
37+
println!("\nCannot reach {base_url}. Make sure your LLM server is running.");
4138
println!("\nQuick start:");
4239
println!(" Ollama: ollama serve");
4340
println!(" vLLM: vllm serve <model>");

src/commands/doctor/command/display/endpoint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::core::offline::LocalModel;
22

33
pub(in super::super) fn print_endpoint_models(endpoint_type: &str, models: &[LocalModel]) {
4-
println!("\nEndpoint type: {}", endpoint_type);
4+
println!("\nEndpoint type: {endpoint_type}");
55
println!("\nAvailable models ({}):", models.len());
66
if models.is_empty() {
77
println!(" (none found)");
@@ -25,7 +25,7 @@ fn format_model_size_info(model: &LocalModel) -> String {
2525
+ &model
2626
.quantization
2727
.as_ref()
28-
.map(|quantization| format!(", {}", quantization))
28+
.map(|quantization| format!(", {quantization}"))
2929
.unwrap_or_default()
3030
+ ")"
3131
}

0 commit comments

Comments
 (0)