feat: add hierarchical review numbering and pr description header
This commit is contained in:
@@ -12,6 +12,7 @@ fn render_md_reads_json_and_outputs_markdown_to_stdout() {
|
||||
"repo": "org/repo",
|
||||
"pr_index": 1,
|
||||
"title": "t",
|
||||
"description": "PR body",
|
||||
"state": "open",
|
||||
"author": "a",
|
||||
"base_branch": "main",
|
||||
@@ -54,6 +55,7 @@ fn render_md_writes_to_out_file_when_requested() {
|
||||
"repo": "org/repo",
|
||||
"pr_index": 2,
|
||||
"title": "t2",
|
||||
"description": "PR body",
|
||||
"state": "open",
|
||||
"author": "a",
|
||||
"base_branch": "main",
|
||||
@@ -220,7 +222,7 @@ fn fetch_writes_markdown_to_stdout_by_default() {
|
||||
assert!(stdout.contains("# org/repo `#7` Fix parser"));
|
||||
assert!(stdout.contains("## Commits"));
|
||||
assert!(stdout.contains("## Diff Stat"));
|
||||
assert!(stdout.contains("## Review 1 (COMMENT)"));
|
||||
assert!(stdout.contains("## Review 7.1 (COMMENT)"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -9,6 +9,7 @@ fn model_json_roundtrip() {
|
||||
repo: "org/repo".into(),
|
||||
pr_index: 9,
|
||||
title: "feat: x".into(),
|
||||
description: Some("desc".into()),
|
||||
state: "open".into(),
|
||||
author: "alice".into(),
|
||||
base_branch: "main".into(),
|
||||
|
||||
@@ -11,6 +11,7 @@ fn render_markdown_includes_expected_sections_and_preserves_comment_markdown() {
|
||||
repo: "org/repo".into(),
|
||||
pr_index: 7,
|
||||
title: "Fix parser".into(),
|
||||
description: Some("PR body".into()),
|
||||
state: "open".into(),
|
||||
author: "alice".into(),
|
||||
base_branch: "main".into(),
|
||||
@@ -73,12 +74,14 @@ fn render_markdown_includes_expected_sections_and_preserves_comment_markdown() {
|
||||
assert!(md.contains("## Metadata"));
|
||||
assert!(md.contains("## Commits"));
|
||||
assert!(md.contains("## Diff Stat"));
|
||||
assert!(md.contains("## Review 1 (COMMENT)"));
|
||||
assert!(md.contains("> 编号规则:Review `<pr>.<review>`;Comment `<pr>.<review>.<comment>`;Reply `<pr>.<review>.<comment>.<reply>`"));
|
||||
assert!(md.contains("PR body"));
|
||||
assert!(md.contains("## Review 7.1 (COMMENT)"));
|
||||
assert!(md.contains("### Comment 7.1.1"));
|
||||
assert!(md.contains("src/main.rs:9"));
|
||||
assert!(md.contains("### Reply 7.1.1.1"));
|
||||
assert!(md.contains("src/main.rs:12"));
|
||||
let review_pos = md.find("## Review 1 (COMMENT)").unwrap();
|
||||
let review_pos = md.find("## Review 7.1 (COMMENT)").unwrap();
|
||||
let comment_pos = md.find("### Comment 7.1.1").unwrap();
|
||||
assert!(comment_pos > review_pos);
|
||||
assert!(!md.contains("## Comments (No Review)"));
|
||||
@@ -95,6 +98,7 @@ fn render_markdown_uses_minimal_fence_for_plain_text() {
|
||||
repo: "org/repo".into(),
|
||||
pr_index: 1,
|
||||
title: "T".into(),
|
||||
description: None,
|
||||
state: "open".into(),
|
||||
author: "alice".into(),
|
||||
base_branch: "main".into(),
|
||||
|
||||
Reference in New Issue
Block a user