Skip to content

Commit 557c3e9

Browse files
committed
add schema version in examples
1 parent d4b8f7c commit 557c3e9

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ To check the metadata for internal consistency, you should use the following com
3737
`$ chef-cli validate-metadata < metadata.json`
3838
This will output any problems there may be with the metadata file.
3939

40-
4140
## Getting a good starting point metadata using the infer-metadata command
4241

4342
`$ chef-cli infer-metadata example_data_directory > metadata.json`
4443

4544
1. Collect example data from the external system, and place them in a directory. Each file should:
46-
- Contain the same type of records, named after their type.
47-
- Have .json or .jsonl extension, for example `issues.json`
48-
- Contain either a single json array of objects, or newline-separated objects.
45+
46+
- Contain the same type of records, named after their type.
47+
- Have .json or .jsonl extension, for example `issues.json`
48+
- Contain either a single json array of objects, or newline-separated objects.
4949

5050
2. Run `$ chef-cli infer-metadata example_data_directory`, replacing example_data_directory with the relative path to this directory.
5151

@@ -143,6 +143,7 @@ an issue that can be moved to become a problem in the external system.
143143

144144
```json
145145
{
146+
"schema_version": "v0.2.0",
146147
"record_types": {
147148
"issues_stock_epic": {
148149
"name": "Epic",
@@ -200,6 +201,7 @@ Example:
200201

201202
```json
202203
{
204+
"schema_version": "v0.2.0",
203205
"record_types": {
204206
"issues_stock_epic": {
205207
"name": "Epic",
@@ -289,6 +291,7 @@ If the field is array in the extracted data, it is still typed with the one of t
289291

290292
```json
291293
{
294+
"schema_version": "v0.2.0",
292295
"record_types": {
293296
"users": {
294297
"fields": {
@@ -360,11 +363,11 @@ To declare this in the metadata, ensure the status is represented in the extract
360363
"starting_stage": "detected",
361364
"all_transitions_allowed": false,
362365
"stages": {
363-
"detected": {
366+
"detected": {
364367
"transitions_to": ["mitigated", "archived", "rca_ready"],
365368
"state": "new"
366369
},
367-
"mitigated": {
370+
"mitigated": {
368371
"transitions_to": ["archived", "detected"],
369372
"state": "work_in_progress"
370373
},
@@ -387,7 +390,7 @@ To declare this in the metadata, ensure the status is represented in the extract
387390
"completed": {
388391
"name": "Completed",
389392
"is_end_state": true
390-
},
393+
}
391394
}
392395
}
393396
}
@@ -398,7 +401,7 @@ It is possible that the status field has no explicit transitions defined but one
398401
The external system might have a way to categorize statuses (such as status categories in Jira). These can also be included in the diagram metadata (`states` in the example above) which will create them in DevRev and they can be referenced by the stages. This is entirely optional and in case the `states` field is not provided, default DevRev states will be used, those being `open`, `in_progress` and `closed`. If there is a way, the developer can categorize the stages to one of these three, or leave it up to the end user.
399402
The `starting_stage` field defines the starting stage of the diagram, in which all new instances of the object will be created. This data should always be provided if available, otherwise the starting stage will be selected alphabetically.
400403

401-
In the current (v0.2.0) metadata format, it is no longer neccessary to assign ordinal and stage_name to stages, the order and the human-readable name will be taken from the enum values defined on the controlling field.
404+
In the current (v0.2.0) metadata format, it is no longer neccessary to assign ordinal and stage_name to stages, the order and the human-readable name will be taken from the enum values defined on the controlling field.
402405

403406
## Normalize data
404407

@@ -459,11 +462,13 @@ Obtain a PAT-token from the Settings/Account tab of the devorg where you deploy
459462

460463
To allow the cli to work in the context of that sync, you have to provide its identifying properties in an environment variable.
461464
The recommended method is to run:
465+
462466
```bash
463467
chef-cli ctx switch --env prod
464468
```
465469

466470
This will print the list of airdrop imports in the org. Select the one you like by running
471+
467472
```bash
468473
$ eval $(chef-cli ctx switch --env --prod --id <the id you choose>); chef-cli ctx show
469474
```
@@ -499,7 +504,7 @@ where the options are:
499504
The first function of the local UI is to assemble a 'blueprint' for concrete import running in the test-org, allowing the mapping to be tested out and evaluated.
500505
After it is used for the import, the mappings become immutable, but the chef-cli UI offers a button to make a draft clone, which can be edited again for refinements.
501506

502-
If you are also creating devrev -> external sync, use
507+
If you are also creating devrev -> external sync, use
503508

504509
`$ chef-cli configure-mappings --env prod --reverse`, which enabled mapping in both directions.
505510

0 commit comments

Comments
 (0)