ado-sync 0.1.65 → 0.1.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +15 -15
  2. package/dist/__tests__/regressions.test.js +1011 -1
  3. package/dist/__tests__/regressions.test.js.map +1 -1
  4. package/dist/ai/summarizer.d.ts +2 -1
  5. package/dist/ai/summarizer.js +6 -1
  6. package/dist/ai/summarizer.js.map +1 -1
  7. package/dist/azure/test-cases.d.ts +11 -1
  8. package/dist/azure/test-cases.js +286 -43
  9. package/dist/azure/test-cases.js.map +1 -1
  10. package/dist/cli.js +85 -8
  11. package/dist/cli.js.map +1 -1
  12. package/dist/config.js +74 -1
  13. package/dist/config.js.map +1 -1
  14. package/dist/id-markers.d.ts +1 -0
  15. package/dist/id-markers.js +13 -0
  16. package/dist/id-markers.js.map +1 -1
  17. package/dist/sync/cache.d.ts +2 -0
  18. package/dist/sync/cache.js.map +1 -1
  19. package/dist/sync/engine.d.ts +12 -1
  20. package/dist/sync/engine.js +210 -41
  21. package/dist/sync/engine.js.map +1 -1
  22. package/dist/types.d.ts +52 -2
  23. package/llms.txt +11 -11
  24. package/package.json +8 -1
  25. package/docs/advanced.md +0 -989
  26. package/docs/agent-setup.md +0 -204
  27. package/docs/capability-roadmap.md +0 -280
  28. package/docs/cli.md +0 -614
  29. package/docs/configuration.md +0 -322
  30. package/docs/examples/csharp-mstest-local-llm.yaml +0 -35
  31. package/docs/examples/csharp-mstest.yaml +0 -21
  32. package/docs/examples/csharp-nunit.yaml +0 -21
  33. package/docs/examples/csharp-specflow.yaml +0 -16
  34. package/docs/examples/cypress.yaml +0 -21
  35. package/docs/examples/detox-react-native.yaml +0 -21
  36. package/docs/examples/espresso-android.yaml +0 -21
  37. package/docs/examples/flutter-dart.yaml +0 -21
  38. package/docs/examples/java-junit.yaml +0 -21
  39. package/docs/examples/java-testng.yaml +0 -21
  40. package/docs/examples/js-jasmine-wdio.yaml +0 -21
  41. package/docs/examples/js-jest.yaml +0 -21
  42. package/docs/examples/playwright-js.yaml +0 -21
  43. package/docs/examples/playwright-ts.yaml +0 -21
  44. package/docs/examples/puppeteer.yaml +0 -21
  45. package/docs/examples/python-pytest.yaml +0 -21
  46. package/docs/examples/robot-framework.yaml +0 -19
  47. package/docs/examples/testcafe.yaml +0 -21
  48. package/docs/examples/xcuitest-ios.yaml +0 -21
  49. package/docs/mcp-server.md +0 -312
  50. package/docs/publish-test-results.md +0 -947
  51. package/docs/spec-formats.md +0 -1357
  52. package/docs/troubleshooting.md +0 -101
  53. package/docs/vscode-extension.md +0 -139
  54. package/docs/work-item-links.md +0 -115
  55. package/docs/workflows.md +0 -457
  56. package/mkdocs.yml +0 -40
  57. package/requirements-docs.txt +0 -4
  58. package/scripts/build_site.sh +0 -6
@@ -1,204 +0,0 @@
1
- # Agent Setup Guide
2
-
3
- This document is written for AI agents (Claude Code, GitHub Copilot, Cursor, etc.) to autonomously set up `ado-sync` for a user. Follow the steps in order.
4
-
5
- ---
6
-
7
- ## Step 1 — Detect the test framework
8
-
9
- Scan the user's repository for these file patterns and map to a `local.type`:
10
-
11
- | If you find... | Use `local.type` | Default include glob |
12
- |---|---|---|
13
- | `*.feature` files + `*.cs` project files | `gherkin` (SpecFlow) | `Features/**/*.feature` |
14
- | `*.feature` files (no .cs) | `gherkin` | `specs/**/*.feature` or `features/**/*.feature` |
15
- | `*.md` files with `### ` headings in a specs folder | `markdown` | `specs/**/*.md` |
16
- | `*.cs` + `[TestMethod]` or `[Test]` annotations | `csharp` | `**/Tests/**/*.cs` |
17
- | `*.java` + `@Test` + JUnit/TestNG imports | `java` | `**/src/test/**/*.java` |
18
- | `*.py` + `def test_` functions | `python` | `tests/**/*.py` |
19
- | `*.spec.ts` or `*.spec.js` + `@playwright/test` import | `playwright` | `tests/**/*.spec.ts` |
20
- | `*.cy.ts` or `*.cy.js` + `cypress/` folder | `cypress` | `cypress/e2e/**/*.cy.ts` |
21
- | `*.test.ts` or `*.test.js` + jest config / `jest` in package.json | `javascript` | `src/**/*.test.ts` |
22
- | `*.test.ts` + `detox` in package.json | `detox` | `e2e/**/*.test.ts` |
23
- | `*.java` or `*.kt` in `androidTest/` | `espresso` | `app/src/androidTest/**/*.java` |
24
- | `*.swift` + `XCUIApplication` usage | `xcuitest` | `UITests/**/*.swift` |
25
- | `*_test.dart` + `flutter_test` import | `flutter` | `test/**/*_test.dart` |
26
- | `*.robot` files | `robot` | `tests/**/*.robot` |
27
-
28
- If none of the above match, ask the user which framework they use.
29
-
30
- ---
31
-
32
- ## Step 2 — Collect required config values
33
-
34
- Ask the user (or read from their existing environment) for these four values:
35
-
36
- | Value | How to find it | Example |
37
- |---|---|---|
38
- | **Azure DevOps org URL** | The base URL to their ADO org | `https://dev.azure.com/contoso` |
39
- | **Project name** | The ADO project name, visible in the breadcrumb | `MyProject` |
40
- | **Test Plan ID** | Test Plans → click the plan → number in the URL (`?planId=42`) | `42` |
41
- | **PAT token** | ADO → User Settings → Personal Access Tokens → New Token, scope: **Test Management Read & Write** + **Work Items Read** | (secret) |
42
-
43
- If the user already has `AZURE_DEVOPS_TOKEN` in their environment or `.env`, use that — do not ask again.
44
-
45
- ---
46
-
47
- ## Step 3 — Generate the config file
48
-
49
- Write `ado-sync.json` in the project root with these values:
50
-
51
- ```json
52
- {
53
- "orgUrl": "<orgUrl>",
54
- "project": "<project>",
55
- "auth": { "type": "pat", "token": "$AZURE_DEVOPS_TOKEN" },
56
- "testPlan": { "id": <planId> },
57
- "local": {
58
- "type": "<local.type>",
59
- "include": ["<include glob>"],
60
- "exclude": []
61
- },
62
- "sync": { "markAutomated": true }
63
- }
64
- ```
65
-
66
- For code-based types (`csharp`, `java`, `python`, `javascript`, `playwright`, `cypress`, `detox`, `espresso`, `xcuitest`, `flutter`), always include `"markAutomated": true` — it links the Test Case to the automation method in Azure DevOps.
67
-
68
- Add reasonable excludes based on the framework:
69
-
70
- | local.type | Suggested excludes |
71
- |---|---|
72
- | `csharp` | `["**/*BaseTest.cs", "**/*Helper.cs", "**/*Fixture.cs"]` |
73
- | `java` | `["**/*BaseTest.java", "**/*Helper.java", "**/*Base.java"]` |
74
- | `python` | `["tests/conftest.py", "tests/**/helpers.py", "tests/**/fixtures.py"]` |
75
- | `playwright` | `["**/*.helper.ts", "**/*.fixtures.ts"]` |
76
- | `javascript` | `["**/*.helper.ts", "**/*.util.ts"]` |
77
- | `robot` | `["tests/resources/**"]` |
78
-
79
- ---
80
-
81
- ## Step 4 — Set the token
82
-
83
- If the user has not already exported `AZURE_DEVOPS_TOKEN`, add it to a `.env` file:
84
-
85
- ```
86
- AZURE_DEVOPS_TOKEN=<their-token>
87
- ```
88
-
89
- Add `.env` to `.gitignore` if not already present.
90
-
91
- ---
92
-
93
- ## Step 5 — Validate the setup
94
-
95
- Run:
96
-
97
- ```bash
98
- ado-sync validate
99
- ```
100
-
101
- Expected output:
102
- ```
103
- ✓ Config is valid
104
- ✓ Azure connection established
105
- ✓ Project "..." found
106
- ✓ Test Plan ... found
107
- All checks passed.
108
- ```
109
-
110
- If any check fails:
111
-
112
- | Error | Fix |
113
- |---|---|
114
- | `Authentication failed` | Token is wrong or expired — generate a new PAT |
115
- | `Access denied` | PAT is missing Test Management or Work Items scope |
116
- | `Project not found` | `project` field has a typo — check the ADO breadcrumb |
117
- | `Test Plan not found` | Wrong `testPlan.id` — check the URL on the Test Plans page |
118
- | `Config error` | Missing required field — check the error message and fix `ado-sync.json` |
119
-
120
- ---
121
-
122
- ## Step 6 — Preview, then push
123
-
124
- ```bash
125
- # Show what will be created — no changes made
126
- ado-sync push --dry-run
127
-
128
- # Create Test Cases in Azure DevOps and write IDs back into files
129
- ado-sync push
130
- ```
131
-
132
- After push, each test file will have an ID written back (e.g. `@tc:12345`). Commit these changes.
133
-
134
- ---
135
-
136
- ## Step 7 — (Optional) Set up CI
137
-
138
- For GitHub Actions, add to `.github/workflows/test.yml`:
139
-
140
- ```yaml
141
- - name: Push test cases to Azure DevOps
142
- run: ado-sync push --config-override sync.disableLocalChanges=true
143
- env:
144
- AZURE_DEVOPS_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
145
-
146
- - name: Publish test results
147
- run: ado-sync publish-test-results --testResult results/junit.xml --testResultFormat junit
148
- env:
149
- AZURE_DEVOPS_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
150
- ```
151
-
152
- Use `sync.disableLocalChanges=true` in CI so the pipeline never commits ID writeback files.
153
-
154
- Add `AZURE_DEVOPS_TOKEN` to the repository's GitHub secrets (Settings → Secrets → Actions).
155
-
156
- ---
157
-
158
- ## Step 8 — (Optional) Register the MCP server
159
-
160
- If the user is using Claude Code, Cursor, or VS Code with GitHub Copilot, register the MCP server so the AI can manage sync operations directly without CLI invocations.
161
-
162
- **Claude Code** — add to `~/.claude/claude_desktop_config.json`:
163
- ```json
164
- {
165
- "mcpServers": {
166
- "ado-sync": {
167
- "command": "ado-sync-mcp",
168
- "env": {
169
- "AZURE_DEVOPS_TOKEN": "<token>",
170
- "ADO_SYNC_CONFIG": "<absolute path to ado-sync.json>"
171
- }
172
- }
173
- }
174
- }
175
- ```
176
-
177
- See [mcp-server.md](mcp-server.md) for VS Code and Cursor instructions.
178
-
179
- ---
180
-
181
- ## Quick decision tree
182
-
183
- ```
184
- User has test files?
185
- ├─ .feature → local.type: gherkin (or gherkin for SpecFlow)
186
- ├─ .cs → local.type: csharp
187
- ├─ .java → local.type: java (or espresso if in androidTest/)
188
- ├─ .py → local.type: python
189
- ├─ .spec.ts/js → local.type: playwright (if @playwright/test) or javascript
190
- ├─ .cy.ts/js → local.type: cypress
191
- ├─ .test.ts/js → local.type: javascript (or detox if detox in package.json)
192
- ├─ .swift → local.type: xcuitest
193
- ├─ _test.dart → local.type: flutter
194
- ├─ .robot → local.type: robot
195
- └─ .md → local.type: markdown
196
-
197
- Token available?
198
- ├─ Yes (env var) → write "$AZURE_DEVOPS_TOKEN" in config
199
- └─ No → ask user, write to .env, add .env to .gitignore
200
-
201
- Run: ado-sync validate → all green?
202
- ├─ Yes → ado-sync push --dry-run → ado-sync push → commit ID writebacks
203
- └─ No → fix the failing check (see Step 5 error table above)
204
- ```
@@ -1,280 +0,0 @@
1
- # Capability Roadmap
2
-
3
- This roadmap turns the recent benchmark review into a product-owned plan for expanding ado-sync without copying another tool's terminology or structure.
4
-
5
- The goal is straightforward: make large-scale synchronization more predictable, make result publishing more trustworthy, and give teams a cleaner path from single-suite setups to portfolio-scale usage.
6
-
7
- ---
8
-
9
- ## Current strengths
10
-
11
- ado-sync already delivers a solid base:
12
-
13
- - bidirectional push and pull for local specs and Azure DevOps test cases
14
- - broad parser coverage across Gherkin, source-code, tabular, and result-file formats
15
- - Azure work item linking, state updates, attachments, and field updates
16
- - test result publishing with multiple input formats
17
- - higher-level workflows such as stale detection, coverage, trend analysis, AI-assisted generation, and editor integration
18
-
19
- The roadmap below focuses on gaps that limit scale, predictability, or user trust.
20
-
21
- ---
22
-
23
- ## Phase 1: Fix correctness gaps first
24
-
25
- ### Why this comes first
26
-
27
- Some configuration surfaces are documented and typed, but not fully honored at runtime. That weakens confidence in the tool even when the rest of the workflow is sound.
28
-
29
- ### Priority work
30
-
31
- 1. Align `publish-test-results` docs, types, and runtime behavior.
32
- 2. Either implement or remove unsupported settings from public docs and config types.
33
- 3. Add focused regression tests around run creation and configuration lookup.
34
-
35
- ### Main files
36
-
37
- - `src/sync/publish-results.ts`
38
- - `src/types.ts`
39
- - `docs/publish-test-results.md`
40
- - `src/__tests__/regressions.test.ts`
41
-
42
- ### Concrete targets
43
-
44
- - honor `publishTestResults.testConfiguration.name` by resolving configuration names to IDs before run creation
45
- - support explicit test suite targeting for result publication when configured
46
- - implement deterministic flaky-outcome policies instead of exposing them as no-op configuration
47
- - document only behavior that is actually live
48
-
49
- ### Exit criteria
50
-
51
- - every documented `publishTestResults` setting is either implemented end-to-end or removed
52
- - dry-run and live-run behavior produce matching routing decisions
53
- - regression coverage exists for name-based configuration selection and flaky handling
54
-
55
- ---
56
-
57
- ## Phase 2: Introduce scoped synchronization
58
-
59
- ### Problem to solve
60
-
61
- Today the model is centered on a plan, optional suite mapping, and local filters. That works for smaller installations, but it does not give teams a strong way to define which remote inventory a configuration owns.
62
-
63
- ### Product direction
64
-
65
- Add a first-class sync target model that tells ado-sync exactly which remote set belongs to a configuration. This should be original to ado-sync, not a copy of anyone else's schema.
66
-
67
- ### Proposed design direction
68
-
69
- Introduce a new top-level concept such as `syncTarget` or `ownership` with selectable modes:
70
-
71
- - `tagged` for test cases carrying a generated ownership tag
72
- - `suite` for test cases managed through a designated suite root
73
- - `query` for test cases matched by an Azure DevOps query or rule set
74
-
75
- This model should work alongside `configurationKey`, not replace it.
76
-
77
- ### Main files
78
-
79
- - `src/types.ts`
80
- - `src/config.ts`
81
- - `src/sync/engine.ts`
82
- - `src/cli.ts`
83
- - `docs/configuration.md`
84
-
85
- ### Exit criteria
86
-
87
- - push, pull, stale detection, and status all use the same ownership boundary
88
- - removing a local scenario does not risk touching unrelated remote items
89
- - multiple configurations can target the same project without collisions
90
-
91
- ---
92
-
93
- ## Phase 3: Build a real hierarchy engine
94
-
95
- ### Problem to solve
96
-
97
- Current suite support is useful but narrow. It covers basic mapping and conditional routing, but not richer hierarchy construction, cleanup rules, or multiple parallel views of the same inventory.
98
-
99
- ### Product direction
100
-
101
- Create named hierarchy definitions that can materialize test suites from local structure, tags, or explicit routing rules.
102
-
103
- ### Proposed capabilities
104
-
105
- - folder-based hierarchy generation
106
- - file-based hierarchy generation
107
- - tag-driven hierarchy generation
108
- - explicit level rules for multi-level suite trees
109
- - cleanup policies for stale nodes and stale memberships
110
- - optional multiple hierarchy outputs from the same local corpus
111
-
112
- ### Main files
113
-
114
- - `src/azure/test-cases.ts`
115
- - `src/sync/engine.ts`
116
- - `src/types.ts`
117
- - `docs/advanced.md`
118
- - `docs/configuration.md`
119
-
120
- ### Exit criteria
121
-
122
- - hierarchy definitions are declarative and testable
123
- - hierarchy sync can add, move, and prune memberships safely
124
- - teams can maintain more than one suite view without duplicating specs
125
-
126
- ---
127
-
128
- ## Phase 4: Expand the command surface for scale workflows
129
-
130
- ### Problem to solve
131
-
132
- The current command line is clean, but it is missing a few control points that matter in large repositories and CI pipelines.
133
-
134
- ### Priority work
135
-
136
- 1. Add source-file filters for push and pull.
137
- 2. Add operation modes such as create-only, link-only, and update-only where applicable.
138
- 3. Add consistent diagnostic controls across commands.
139
- 4. Allow temporary auth and routing overrides in a controlled way.
140
-
141
- ### Main files
142
-
143
- - `src/cli.ts`
144
- - `src/config.ts`
145
- - `src/sync/engine.ts`
146
- - `docs/cli.md`
147
-
148
- ### Exit criteria
149
-
150
- - operators can target a small slice of a large repo without changing config files
151
- - CI jobs can run low-risk creation-only or link-only flows
152
- - troubleshooting output is consistent across push, pull, status, and result publication
153
-
154
- ---
155
-
156
- ## Phase 5: Modernize configuration ergonomics
157
-
158
- ### Problem to solve
159
-
160
- The configuration model is powerful enough for a single repository, but it becomes awkward when shared across many teams or environments.
161
-
162
- ### Product direction
163
-
164
- Make configuration layering easier, safer, and more portable.
165
-
166
- ### Priority work
167
-
168
- 1. Support comment-tolerant JSON configuration parsing.
169
- 2. Add optional parent-config discovery through ancestor folders.
170
- 3. Add personal config overlays for credentials and machine-local overrides.
171
- 4. Add reusable remote profiles so org-level connection settings do not need to be copied into every repository.
172
-
173
- ### Main files
174
-
175
- - `src/config.ts`
176
- - `src/types.ts`
177
- - `docs/configuration.md`
178
- - `src/cli.ts`
179
-
180
- ### Exit criteria
181
-
182
- - teams can share base config safely without checking credentials into the repo
183
- - repository config stays small even when many projects use the same Azure DevOps org
184
- - the override and inheritance rules are explicit and easy to debug
185
-
186
- ---
187
-
188
- ## Phase 6: Deepen automation and result publishing
189
-
190
- ### Problem to solve
191
-
192
- The core publishing flow works, but automation metadata and run routing are still simpler than what enterprise teams usually need.
193
-
194
- ### Product direction
195
-
196
- Expand the publishing model so it can express how tests were executed, where runs should land, and how automated metadata should be maintained.
197
-
198
- ### Priority work
199
-
200
- 1. Support automation classification rules instead of a single coarse toggle.
201
- 2. Resolve named test configurations at runtime.
202
- 3. Allow controlled publication to more than one destination suite when desired.
203
- 4. Add stronger matching and fallback rules for automated result association.
204
- 5. Expand attachment and comment policies for passing, flaky, and retried tests.
205
-
206
- ### Main files
207
-
208
- - `src/sync/publish-results.ts`
209
- - `src/azure/test-runs.ts`
210
- - `src/azure/test-cases.ts`
211
- - `src/types.ts`
212
- - `docs/publish-test-results.md`
213
-
214
- ### Exit criteria
215
-
216
- - automation metadata is predictable across push and publish flows
217
- - result publication can be routed by configuration rather than ad hoc flags alone
218
- - retry-heavy pipelines produce consistent final outcomes
219
-
220
- ---
221
-
222
- ## Phase 7: Add extension points instead of hard-coding every variant
223
-
224
- ### Problem to solve
225
-
226
- ado-sync already supports many ecosystems, but every new integration currently tends to require first-party changes.
227
-
228
- ### Product direction
229
-
230
- Introduce a narrow extension model for parser registration, result ingestion, custom routing, and metadata transforms.
231
-
232
- ### Candidate extension seams
233
-
234
- - local spec discovery
235
- - parser registration
236
- - result-file ingestion
237
- - test-case field transformation
238
- - run-routing policies
239
-
240
- ### Main files
241
-
242
- - `src/types.ts`
243
- - `src/config.ts`
244
- - parser modules under `src/parsers/`
245
- - `src/sync/engine.ts`
246
- - `src/sync/publish-results.ts`
247
-
248
- ### Exit criteria
249
-
250
- - new ecosystems can be added without invasive changes to the core sync engine
251
- - experimental integrations can ship behind stable interfaces
252
- - core maintenance load stays bounded as format coverage expands
253
-
254
- ---
255
-
256
- ## Recommended implementation order
257
-
258
- 1. Phase 1: correctness and documentation trust
259
- 2. Phase 2: scoped synchronization model
260
- 3. Phase 4: command-surface improvements needed to operate the new scope model
261
- 4. Phase 3: hierarchy engine
262
- 5. Phase 6: deeper automation and result-routing behavior
263
- 6. Phase 5: configuration ergonomics and shared profiles
264
- 7. Phase 7: extension model
265
-
266
- This order reduces user-facing confusion first, then hardens ownership boundaries before adding more advanced routing and hierarchy features.
267
-
268
- ---
269
-
270
- ## Near-term backlog candidates
271
-
272
- If the goal is to start implementation immediately, the highest-value first batch is:
273
-
274
- 1. fix `publish-test-results` contract drift
275
- 2. add named test configuration lookup
276
- 3. design `syncTarget` ownership schema in `src/types.ts`
277
- 4. wire ownership filtering into `status`, `push`, `pull`, and `stale`
278
- 5. add `--source-file`, `--create-only`, and `--link-only` style command controls
279
-
280
- That batch improves trust, reduces operational risk, and lays the foundation for the larger roadmap.