Skip to content

Commit 13c0af1

Browse files
Fix .gitattributes writer: quote paths with spaces, dedupe per-batch syncs, deterministic ordering (#330)
* feat: emit .lock.yml for compiled pipelines and manage .gitattributes Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/6964fcee-affd-47fd-bce6-3168d0b89d53 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com> * refactor: address code review nits in gitattributes module Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/6964fcee-affd-47fd-bce6-3168d0b89d53 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com> * fix: address rust-review feedback on .gitattributes writer Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/8a920650-7872-4658-9e7a-85642e24bc6b Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
1 parent 618fc0e commit 13c0af1

8 files changed

Lines changed: 359 additions & 23 deletions

File tree

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,27 @@ request with a clear description of what changed and why.
107107
### 4. Compile to a Pipeline
108108

109109
```bash
110-
# Simple form — generates the .yml alongside the source .md
110+
# Simple form — generates a `.lock.yml` alongside the source `.md`
111111
ado-aw compile dependency-updater.md
112112

113113
# Or specify a custom output location
114-
ado-aw compile dependency-updater.md -o path/to/dependency-updater.yml
114+
ado-aw compile dependency-updater.md -o path/to/dependency-updater.lock.yml
115115
```
116116

117117
This generates a complete Azure DevOps pipeline YAML file. The compiler also
118118
copies the agent markdown body into the output tree so it's available at runtime.
119119

120+
The compiler also writes/updates a `.gitattributes` file at the repository root
121+
that marks every compiled `.lock.yml` pipeline as `linguist-generated=true merge=ours`,
122+
so GitHub hides them from PR diffs and merge conflicts in generated YAML resolve
123+
to the local copy (which can then be rebuilt with `ado-aw compile`).
124+
120125
### 5. Verify (CI Check)
121126

122127
Ensure pipelines stay in sync with their source:
123128

124129
```bash
125-
ado-aw check dependency-updater.yml
130+
ado-aw check dependency-updater.lock.yml
126131
```
127132

128133
This is useful as a CI gate — if someone edits the markdown but forgets to
@@ -134,7 +139,7 @@ recompile, the check will fail.
134139

135140
### Step 1: Commit both files
136141

137-
Your repo should contain the agent source `.md` and the compiled pipeline `.yml`.
142+
Your repo should contain the agent source `.md` and the compiled pipeline `.lock.yml`.
138143
Place them wherever your team's conventions dictate — there is no required directory structure.
139144

140145
Push both files to your Azure DevOps repository.
@@ -144,7 +149,7 @@ Push both files to your Azure DevOps repository.
144149
1. Go to **Pipelines → New Pipeline**
145150
2. Select your repository
146151
3. Choose **Existing Azure Pipelines YAML file**
147-
4. Point to the compiled `.yml` pipeline file
152+
4. Point to the compiled `.lock.yml` pipeline file
148153
5. Save (or Save & Run)
149154

150155
### Step 3: Set Up ARM Service Connections for Permissions

prompts/create-ado-agentic-workflow.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,14 @@ When generating the agent file:
489489
After creating the agent file, compile it into an Azure DevOps pipeline:
490490

491491
```bash
492-
# Simple form — generates the .yml pipeline alongside the .md source
492+
# Simple form — generates a `.lock.yml` pipeline alongside the `.md` source
493493
ado-aw compile <path/to/agent.md>
494494

495495
# Or specify a custom output location
496-
ado-aw compile <path/to/agent.md> -o <path/to/pipeline.yml>
496+
ado-aw compile <path/to/agent.md> -o <path/to/pipeline.lock.yml>
497497
```
498498

499-
This generates a `.yml` pipeline file. Both the source `.md` and generated `.yml` must be committed together.
499+
This generates a `.lock.yml` pipeline file. Both the source `.md` and generated `.lock.yml` must be committed together. The compiler also writes/updates a `.gitattributes` file at the repository root so compiled pipelines are marked `linguist-generated=true merge=ours`.
500500

501501
If the `ado-aw` CLI is not installed or not available on `PATH`, guide the user to download it from:
502502
https://github.com/githubnext/ado-aw/releases
@@ -506,8 +506,8 @@ https://github.com/githubnext/ado-aw/releases
506506
```
507507
Next steps:
508508
1. Review and customize the agent instructions in <filename>.md
509-
2. Commit both the .md source and the generated .yml pipeline
510-
3. Register the .yml as a pipeline in Azure DevOps
509+
2. Commit both the .md source, the generated .lock.yml pipeline, and any .gitattributes changes
510+
3. Register the .lock.yml as a pipeline in Azure DevOps
511511
```
512512

513513
---
@@ -595,5 +595,5 @@ safe-outputs:
595595
- **Minimal permissions**: Default to no permissions; add only what the task requires.
596596
- **Explicit allow-lists**: Restrict MCP tools to only what the agent needs.
597597
- **No direct writes**: All mutations go through safe outputs — the agent cannot push code or call write APIs directly.
598-
- **Compile before committing**: Always compile with `ado-aw compile` and commit both the `.md` source and generated `.yml` together.
598+
- **Compile before committing**: Always compile with `ado-aw compile` and commit both the `.md` source and generated `.lock.yml` together.
599599
- **Check validation**: The compiler will error if write safe-outputs are configured without `permissions.write`.

prompts/debug-ado-agentic-workflow.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Follow this sequence for every debugging session:
4444

4545
3. **Check for compilation drift** — before deep-diving into runtime errors, verify the pipeline YAML is in sync with its source markdown:
4646
```bash
47-
ado-aw check <pipeline.yml>
47+
ado-aw check <pipeline.lock.yml>
4848
```
4949

5050
4. **Apply the fix** — make the targeted change to the agent `.md` source file, then recompile:
@@ -178,17 +178,17 @@ network:
178178

179179
**Diagnosis**:
180180
```bash
181-
ado-aw check <pipeline.yml>
181+
ado-aw check <pipeline.lock.yml>
182182
```
183183

184184
If the check fails, the pipeline YAML is out of sync with the source markdown. This happens when:
185185
- The `.md` source was edited without recompiling
186186
- The compiler version changed (different output for the same input)
187-
- The `.yml` was manually edited
187+
- The `.lock.yml` was manually edited
188188

189189
**Fix**: Recompile and commit both files together:
190190
```bash
191-
ado-aw compile <agent.md> -o <pipeline.yml>
191+
ado-aw compile <agent.md> -o <pipeline.lock.yml>
192192
```
193193

194194
---
@@ -350,7 +350,7 @@ If downloads fail:
350350

351351
```bash
352352
# Verify pipeline YAML matches its source markdown
353-
ado-aw check <pipeline.yml>
353+
ado-aw check <pipeline.lock.yml>
354354
355355
# Recompile a single agent
356356
ado-aw compile <path/to/agent.md>
@@ -371,7 +371,7 @@ ado-aw configure --dry-run
371371

372372
Use this checklist to systematically rule out common issues:
373373

374-
- [ ] **Compilation in sync**: `ado-aw check <pipeline.yml>` passes
374+
- [ ] **Compilation in sync**: `ado-aw check <pipeline.lock.yml>` passes
375375
- [ ] **Correct stage identified**: Know which of the 3 jobs failed
376376
- [ ] **Network allowlist**: All required domains are in `network.allowed` or built-in
377377
- [ ] **MCP tools allowed**: Every tool the agent needs is in an `allowed:` list

prompts/update-ado-agentic-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ After completing an update:
336336
Next steps:
337337
1. Review the changes in <filename>.md
338338
2. Recompile: ado-aw compile <path/to/agent.md>
339-
3. Commit both the updated .md source and regenerated .yml pipeline
339+
3. Commit both the updated .md source and regenerated .lock.yml pipeline
340340
```
341341

342342
If only agent instructions were changed:

0 commit comments

Comments
 (0)