Skip to content

test: add regression test for branch name single-quote escaping in pipeline triggers#183

Merged
jamesadevine merged 2 commits intomainfrom
copilot/add-regression-test-for-single-quote-escaping
Apr 14, 2026
Merged

test: add regression test for branch name single-quote escaping in pipeline triggers#183
jamesadevine merged 2 commits intomainfrom
copilot/add-regression-test-for-single-quote-escaping

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

generate_pipeline_resources escapes embedded single quotes in branch names ('''), but the only existing escaping test (test_pipeline_resources_escapes_single_quotes) only asserted on source: and project: — leaving the branch escaping path completely uncovered.

Changes

  • src/compile/common.rs — extends test_pipeline_resources_escapes_single_quotes to include a branch with an embedded single quote and asserts the correct YAML output:
branches: vec!["main".to_string(), "it's-branch".to_string()],
// ...
assert!(result.contains("- 'it''s-branch'"));

Copilot AI changed the title [WIP] Add regression test for branch name single-quote escaping test: add regression test for branch name single-quote escaping in pipeline triggers Apr 14, 2026
Copilot AI requested a review from jamesadevine April 14, 2026 12:33
@jamesadevine jamesadevine marked this pull request as ready for review April 14, 2026 12:35
@jamesadevine
Copy link
Copy Markdown
Collaborator

/rust-review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Rust PR Reviewer completed successfully!

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Rust PR Review

Summary: Looks good — a clean, well-targeted regression test.

Findings

✅ What Looks Good

  • Correctness: The assertion assert!(result.contains("- 'it''s-branch'")) precisely mirrors the escaping logic on line 309 of common.rs (branch.replace('\'', "''") wrapped in single-quote delimiters). Verified manually and confirmed by running the test locally — passes cleanly.
  • Scope: The PR does exactly what it says. One changed file, three lines touched, no production code modified.
  • Coverage gap closed: The previous test only checked source: and project: escaping. Branch name escaping was a real blind spot — if someone ever changed the branch formatting code, nothing would have caught the regression. This fills it.
  • Test style is consistent with the existing test_pipeline_resources_escapes_single_quotes pattern (same function, same assertion style).

No bugs, security concerns, or suggestions. Ready to merge.

Generated by Rust PR Reviewer for issue #183 · ● 491K ·

@jamesadevine jamesadevine merged commit 2da49cd into main Apr 14, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add regression test for branch name single-quote escaping in pipeline triggers

2 participants