Skip to content

chore: validate trigger.pipeline fields for newlines#184

Merged
jamesadevine merged 2 commits intomainfrom
copilot/validate-trigger-pipeline-newlines
Apr 14, 2026
Merged

chore: validate trigger.pipeline fields for newlines#184
jamesadevine merged 2 commits intomainfrom
copilot/validate-trigger-pipeline-newlines

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

validate_front_matter_identity rejected newlines in name and description but left triggers.pipeline.name, triggers.pipeline.project, and branch entries unchecked — allowing newlines that produce multi-line YAML single-quoted scalars, which could confuse tooling or display incorrectly.

Changes

  • validate_front_matter_identity — extends newline checks to cover triggers.pipeline.name, triggers.pipeline.project (when present), and each entry in triggers.pipeline.branches
  • Tests — four new tests covering rejection of \n in each trigger pipeline field, plus a positive case for valid values; renamed the existing allows_valid_values test to allows_valid_name_and_description to be more precise

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.github.com (HTTP Only)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.1bphc5ppikkmf9gdr0s68x1p9.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.1sgopqj46gptnc0lbexasqcdh.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.1zwwwnsl5hpu01p06g7g22e8r.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.22sas3hw6qnxou445a2xmp1cn.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.27o2kuwnvtifbhdh5pue0nvnt.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.2b�� /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.2uobun4n1xgd04x1d5e7u1y4h.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.330c18cwdvgi96e9ysiyncy21.0cd26lk.rcgu.o g/de�� lib/rustlib/x86_/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rmcp_macros-ec3fabaecd10b65a.r/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw lib/rustlib/x86_/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rmcp_macros-ec3fabaecd10b65a.rcompile bin/rustc e-c4448fe3a5c46e/usr/libexec/gcc/x86_64-linux-gnu/13/collect2 e-c4448fe3a5c46e-plugin e-c4448fe3a5c46e/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so bin/rustc (packet block)
  • dev.azure.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-e07c5709f9b8ed2e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-e07c5709f9b8ed2e --hash-style=gnu --as-needed -shared -fuse-ld=lld -z 7.03fm7k6zrdyh4198fjkt979n0.0cd26lk.rcgu.o 7.0c5vmfzleerl649jl03crh9jw.0cd26lk.rcgu.o 7.0ec7x78epulx2puue5c2mjv57.0cd26lk.rcgu.o 7.0l11ebyxgad7g4bemgqjiqa53.0cd26lk.rcgu.o 7.0m4bktzfagl8begpppf7frszp.0cd26lk.rcgu.o 7.0sr2qr65af94sarrlq2fxuhtn.0cd26lk.rcgu.o 7.0uk8pqg1x68cbq3dud7y7hxwd.0cd26lk.rcgu.o 7.16ml9nr41z6zyeey82dm0hvni.0cd26lk.rcgu.o 7.1a0js2iovuhfw6sdxeo0q4a00.0cd26lk.rcgu.o 7.1bphc5ppikkmf9gdr0s68x1p9.0cd26lk.rcgu.o 7.1sgopqj46gptnc0lbexasqcdh.0cd26lk.rcgu.o 7.1zwwwnsl5hpu01p06g7g22e8r.0cd26lk.rcgu.o 7.22sas3hw6qnxou445a2xmp1cn.0cd26lk.rcgu.o 7.27o2kuwnvtifbhdh5pue0nvnt.0cd26lk.rcgu.o (dns block)
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --allow dev.azure.com --allow *.visualstudio.com -fuse-ld=lld -z relro -o g/de�� pl-d776f39dc20c6/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rmcp_macros-ec3fabaecd10b65a.r/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw eta.o bin/rustc e-c4448fe3a5c46e/home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_-o e-c4448fe3a5c46e-plugin e-c4448fe3a5c46e/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so bin/rustc (dns block)
  • msazuresphere.visualstudio.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --allow dev.azure.com --allow *.visualstudio.com -fuse-ld=lld -z relro -o g/de�� pl-d776f39dc20c6/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rmcp_macros-ec3fabaecd10b65a.r/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw eta.o bin/rustc e-c4448fe3a5c46e/home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_-o e-c4448fe3a5c46e-plugin e-c4448fe3a5c46e/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so bin/rustc (dns block)
  • raw.github.com
    • Triggering command: /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow *.github.com /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.1bphc5ppikkmf9gdr0s68x1p9.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.1sgopqj46gptnc0lbexasqcdh.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.1zwwwnsl5hpu01p06g7g22e8r.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.22sas3hw6qnxou445a2xmp1cn.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.27o2kuwnvtifbhdh5pue0nvnt.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.2b�� /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.2uobun4n1xgd04x1d5e7u1y4h.0cd26lk.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/compiler_tests-d9ec3e202ea63537.330c18cwdvgi96e9ysiyncy21.0cd26lk.rcgu.o g/de�� lib/rustlib/x86_--error-format=json lib/rustlib/x86_--json=diagnostic-rendered-ansi,artifacts,future-incompat bin/rustc e-c4448fe3a5c46ecc e-c4448fe3a5c46e-m64 e-c4448fe3a5c46e/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rustcBTbQgS/symbols.o bin/rustc (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add validation for newlines in trigger.pipeline fields chore: validate trigger.pipeline fields for newlines Apr 14, 2026
Copilot AI requested a review from jamesadevine April 14, 2026 12:35
@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 — correct fix, well-tested. One consistency gap worth noting.

Findings

⚠️ Suggestions

  • src/compile/common.rs:188-213 — The existing name/description validation checks for both newlines AND ADO expressions ($\{\{, $(, $[). The new trigger-field validation only checks for newlines. While resources.pipelines fields (source:, project:, branch entries) are structural config values that ADO doesn't evaluate as expressions at runtime, the inconsistency with the established pattern is worth flagging for future maintainers. Consider adding the ADO expression check here too, or add a code comment explaining why it's intentionally omitted for these fields.

  • src/compile/common.rs:205-211 (branch loop) — The error message for an invalid branch doesn't include which branch triggered the failure. Adding the offending value would improve the developer UX:

    anyhow::bail!(
        "Front matter 'triggers.pipeline.branches' entry {:?} must be single line (no newlines). \
         Multi-line values could inject YAML structure into the generated pipeline.",
        branch,
    );

✅ What Looks Good

  • The Option<TriggerConfig>Option<PipelineTrigger> traversal with if let Some chains is clean and idiomatic.
  • Both \n and \r are checked — correctly handles classic Mac line endings.
  • Test coverage is thorough: three rejection tests (one per field) plus one positive case.
  • Renaming allows_valid_valuesallows_valid_name_and_description is a good precision improvement.
  • validate_front_matter_identity is called in both standalone.rs and onees.rs, so the fix applies to both compile targets.

Generated by Rust PR Reviewer for issue #184 · ● 771.8K ·

@jamesadevine jamesadevine merged commit 16367dd into main Apr 14, 2026
9 of 13 checks passed
@jamesadevine jamesadevine deleted the copilot/validate-trigger-pipeline-newlines branch April 14, 2026 12:49
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.

chore: validate trigger.pipeline fields for newlines

2 participants