Skip to content

Commit a11cfbb

Browse files
committed
Add documentation standards and structure for field mapping tools
1 parent 0b6551a commit a11cfbb

File tree

3 files changed

+91
-40
lines changed

3 files changed

+91
-40
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
applyTo: "docs/content/docs/**"
3+
---
4+
5+
# Documentation Standards
6+
7+
All documentation content **must stay in sync with the codebase**.
8+
Every page must accurately reflect the associated **data files** and **schemas**.
9+
10+
---
11+
12+
## Front Matter
13+
14+
Each documentation file **may include** the following properties:
15+
16+
- **dataFile**: Path to the generated documentation data file (stored in `docs/data/classes`)
17+
Example: `reference.tools.fieldmappingtool.yaml`
18+
19+
- **schemaFile**: Path to the JSON schema file (stored in `docs/static/schema`)
20+
Example: `schema.tools.fieldmappingtool.json`
21+
22+
> ⚠️ Documentation pages **must not** contain options, properties, or samples that do not exist in the corresponding `dataFile`.
23+
24+
---
25+
26+
## Documentation Structure
27+
28+
Documentation files should generally include these sections (in order):
29+
30+
1. **Overview**
31+
- Subsections: *How It Works*, *Use Cases*
32+
33+
2. **Configuration Structure**
34+
- Subsections: *Options*, *Sample*, *Defaults*, *Basic Examples*, *Complex Examples*
35+
36+
3. **Common Scenarios**
37+
- A list of common scenarios with supporting samples
38+
39+
4. **Good Practices**
40+
- Focus on maintainability, readability, and clarity
41+
42+
5. **Troubleshooting**
43+
- Common issues and their resolutions
44+
45+
6. **Schema**
46+
- Use the `{{< class-schema >}}` shortcode to render the schema from `schemaFile`
47+
48+
---
49+
50+
## Rules
51+
52+
- **Options** → use `{{< class-options >}}` to render the options table from `dataFile`.
53+
- **Sample** → use `{{< class-sample sample="sample" >}}` to render the main sample from `dataFile`.
54+
- **Defaults** → use `{{< class-sample sample="defaults" >}}` to render defaults from `dataFile`.
55+
- **Basic Examples / Complex Examples**
56+
- Include generated samples based on the `dataFile`.
57+
- Cross-reference the class object and its usage context.
58+
59+
---

docs/content/docs/reference/field-maps/field-to-tag-field-map/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ This field map is commonly used for:
6767
}
6868
```
6969

70-
#### Prefixed Tag Creation
70+
#### Formatted Tag Creation
7171

7272
```json
7373
{
7474
"FieldMapType": "FieldToTagFieldMap",
7575
"ApplyTo": ["*"],
7676
"sourceField": "Microsoft.VSTS.Common.Priority",
77-
"tagPrefix": "Priority-"
77+
"formatExpression": "Priority-{0}"
7878
}
7979
```
8080

@@ -96,7 +96,7 @@ This field map is commonly used for:
9696
"FieldMapType": "FieldToTagFieldMap",
9797
"ApplyTo": ["Feature"],
9898
"sourceField": "Custom.BusinessValue",
99-
"tagPrefix": "BizValue-"
99+
"formatExpression": "BizValue-{0}"
100100
}
101101
```
102102

@@ -161,13 +161,13 @@ This field map is commonly used for:
161161
"FieldMapType": "FieldToTagFieldMap",
162162
"ApplyTo": ["*"],
163163
"sourceField": "Custom.Department",
164-
"tagPrefix": "Dept-"
164+
"formatExpression": "Dept-{0}"
165165
},
166166
{
167167
"FieldMapType": "FieldToTagFieldMap",
168168
"ApplyTo": ["*"],
169169
"sourceField": "Custom.Component",
170-
"tagPrefix": "Component-"
170+
"formatExpression": "Component-{0}"
171171
}
172172
]
173173
```
@@ -186,7 +186,7 @@ This field map is commonly used for:
186186
"FieldMapType": "FieldToTagFieldMap",
187187
"ApplyTo": ["Bug"],
188188
"sourceField": "Custom.BugType",
189-
"tagPrefix": "Type-"
189+
"formatExpression": "Type-{0}"
190190
}
191191
]
192192
```

docs/content/docs/reference/field-maps/tree-to-tag-field-map/index.md

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -57,43 +57,36 @@ This field map is essential for:
5757

5858
### Basic Examples
5959

60-
#### Area Path to Tags
60+
#### Skip Root Levels and Apply Time Travel
6161

6262
```json
6363
{
6464
"FieldMapType": "TreeToTagFieldMap",
6565
"ApplyTo": ["*"],
66-
"sourceField": "System.AreaPath",
67-
"tagPrefix": "Area-",
68-
"includeCompletePath": true,
69-
"includeIndividualLevels": false
66+
"toSkip": 2,
67+
"timeTravel": 0
7068
}
7169
```
7270

73-
#### Iteration Path with Level Tags
71+
#### Skip First Level Only
7472

7573
```json
7674
{
7775
"FieldMapType": "TreeToTagFieldMap",
78-
"ApplyTo": ["*"],
79-
"sourceField": "System.IterationPath",
80-
"tagPrefix": "Sprint-",
81-
"includeCompletePath": false,
82-
"includeIndividualLevels": true
76+
"ApplyTo": ["User Story", "Bug"],
77+
"toSkip": 1,
78+
"timeTravel": 0
8379
}
8480
```
8581

86-
#### Complete Path and Level Breakdown
82+
#### Use Historical Area Path Values
8783

8884
```json
8985
{
9086
"FieldMapType": "TreeToTagFieldMap",
91-
"ApplyTo": ["User Story", "Bug"],
92-
"sourceField": "System.AreaPath",
93-
"tagPrefix": "Team-",
94-
"includeCompletePath": true,
95-
"includeIndividualLevels": true,
96-
"levelSeparator": " > "
87+
"ApplyTo": ["*"],
88+
"toSkip": 0,
89+
"timeTravel": 6
9790
}
9891
```
9992

@@ -141,10 +134,8 @@ When teams are restructuring but want to maintain historical context:
141134
{
142135
"FieldMapType": "TreeToTagFieldMap",
143136
"ApplyTo": ["*"],
144-
"sourceField": "System.AreaPath",
145-
"tagPrefix": "OriginalTeam-",
146-
"includeCompletePath": true,
147-
"includeIndividualLevels": false
137+
"toSkip": 1,
138+
"timeTravel": 0
148139
}
149140
```
150141

@@ -156,10 +147,8 @@ Maintaining sprint information for historical analysis:
156147
{
157148
"FieldMapType": "TreeToTagFieldMap",
158149
"ApplyTo": ["*"],
159-
"sourceField": "System.IterationPath",
160-
"tagPrefix": "CompletedIn-",
161-
"includeCompletePath": true,
162-
"includeIndividualLevels": false
150+
"toSkip": 0,
151+
"timeTravel": 3
163152
}
164153
```
165154

@@ -172,60 +161,63 @@ Creating tags for different organizational levels:
172161
{
173162
"FieldMapType": "TreeToTagFieldMap",
174163
"ApplyTo": ["*"],
175-
"sourceField": "System.AreaPath",
176-
"tagPrefix": "Division-",
177-
"includeCompletePath": false,
178-
"includeIndividualLevels": true
164+
"toSkip": 2,
165+
"timeTravel": 0
179166
},
180167
{
181168
"FieldMapType": "TreeToTagFieldMap",
182169
"ApplyTo": ["*"],
183-
"sourceField": "System.IterationPath",
184-
"tagPrefix": "Release-",
185-
"includeCompletePath": true,
186-
"includeIndividualLevels": false
170+
"toSkip": 0,
171+
"timeTravel": 6
187172
}
188173
]
189174
```
190175

191176
## Best Practices
192177

193178
### Tag Organization
179+
194180
- Use consistent prefixes to group related path tags
195181
- Consider tag naming conventions that align with organizational standards
196182
- Plan for tag management and cleanup procedures
197183

198184
### Performance Considerations
185+
199186
- Monitor tag proliferation in large organizations
200187
- Consider the impact on query performance
201188
- Balance between detail and manageability
202189

203190
### Migration Planning
191+
204192
- Document the mapping strategy for stakeholders
205193
- Test with representative data before full migration
206194
- Coordinate with teams on new tagging conventions
207195

208196
## Integration with Other Field Maps
209197

210198
### Complementary Usage
199+
211200
- **Field Clear Map**: Clear original path fields after tag creation
212201
- **Field Skip Map**: Preserve original paths while adding tags
213202
- **Field Value Map**: Transform path values before tag conversion
214203

215204
### Sequential Processing
205+
216206
- Tree To Tag maps typically run after basic field mappings
217207
- Consider order when combining with other path-related mappings
218208
- Ensure tag creation doesn't conflict with other field operations
219209

220210
## Troubleshooting
221211

222212
### Common Issues
213+
223214
- **Invalid Path Formats**: Ensure source paths follow Azure DevOps conventions
224215
- **Tag Length Limits**: Monitor generated tag lengths
225216
- **Duplicate Tags**: Handle cases where multiple paths generate same tags
226217
- **Special Characters**: Test with paths containing special characters
227218

228219
### Validation Tips
220+
229221
- Test with various path structures
230222
- Verify tag generation with sample data
231223
- Check for tag naming conflicts

0 commit comments

Comments
 (0)