You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/docs/pages/airdrop/metadata-extraction.mdx
+27-9Lines changed: 27 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,16 @@ The extraction function of the snap-in must provide a valid metadata file.
7
7
DevRev provides a JSON schema and a CLI tool [chef-cli](https://github.com/devrev/adaas-chef-cli)
8
8
to validate the proposed schema.
9
9
10
+
## Validating metadata
11
+
12
+
To check the metadata for internal consistency, you should use the following command after every step:
13
+
14
+
```bash
15
+
chef-cli validate-metadata < metadata.json
16
+
```
17
+
18
+
This will output any problems there may be with the metadata file.
19
+
10
20
## Triggering event
11
21
12
22
Airdrop initiates the metadata extraction by starting the snap-in with a message with an event
@@ -48,7 +58,7 @@ For best results:
48
58
- Use referentially consistent example data if possible
49
59
- Make sure IDs are strings, not numbers
50
60
51
-
This generated metadata serves as a starting point that will need further refinement.
61
+
This generated metadata serves as a starting point that will need further refinement. It can be used to prototype initial domain mappings (by running a sync with it) and to generate example normalized data, but it is still just a guess: It has to be reviewed and refined.
52
62
53
63
## Craft the metadata declaration
54
64
@@ -169,6 +179,7 @@ be changed by the end user at any time, such as mandatory fields or custom field
169
179
### Declare fields for each record type
170
180
171
181
Fields' keys must match what is actually found in the extracted data in the artifacts.
182
+
Note that field keys are case-sensitive.
172
183
173
184
The supported types are:
174
185
- `bool`
@@ -183,19 +194,22 @@ be changed by the end user at any time, such as mandatory fields or custom field
183
194
- `timestamp`
184
195
- `struct`
185
196
197
+
For a detailed explanation of these supported types, refer to the [supported types page](./supported_types.md).
198
+
186
199
If the external system supports custom fields, the set of custom fields in each record type
187
200
you wish to extract must be declared too.
188
201
189
202
Enum fields' set of possible values can often be customizable.
190
203
A good practice is to retrieve the set of possible values for all enum fields from the external
191
-
system's APIs in each sync run.
204
+
system's APIs in each sync run. You can mark specific enum values as deprecated using the `is_deprecated` property.
192
205
193
206
`ID` (primary key) of the record, `created_date`, and `modified_date` must not be declared.
194
207
195
208
Example:
196
209
197
210
```json
198
211
{
212
+
"schema_version": "v0.2.0",
199
213
"record_types": {
200
214
"issues_stock_epic": {
201
215
"name": "Epic",
@@ -237,7 +251,8 @@ be changed by the end user at any time, such as mandatory fields or custom field
237
251
"key": "P-1"
238
252
},
239
253
{
240
-
"key": "P-2"
254
+
"key": "P-2",
255
+
"is_deprecated": true
241
256
}
242
257
]
243
258
}
@@ -323,22 +338,24 @@ be changed by the end user at any time, such as mandatory fields or custom field
323
338
External system fields that shouldn't be mapped in reverse should be marked as `is_read_only`.
324
339
Depending on their purpose you can also mark fields as `is_indexed`, `is_identifier`, `is_filterable`,
325
340
`is_write_only` etc. By default these will be set to false. You can find the full list of supported
326
-
field attributes and their descriptions in the [metadata schema](./external_domain_metadata_schema.json).
341
+
field attributes and their descriptions in the `external_domain_metadata_schema.json`.
327
342
328
343
### Configure state transitions
329
344
330
345
If an external record type has some concept of states, between which only certain transitions are
331
346
possible (e.g., to move to the 'resolved' status, an issue first has to be 'in_testing'), you
332
347
can declare these in the metadata too.
333
348
334
-
This will allow creation of a matching 'stage diagram' in DevRev, which enables a much simpler
- If a status field has no explicit transitions but you still want a stage diagram, set `all_transitions_allowed` to `true`, which will create a diagram where all the defined stages can transition to each other
413
430
- External systems may categorize statuses (like Jira's status categories), which can be included in the diagram metadata (`states` in the example)
- The `starting_stage` defines the initial stage for new object instances. This data should always be provided if available, otherwise the starting stage will be selected alphabetically
415
432
- In current metadata format (v0.2.0), the order and human-readable name are taken from the enum values defined on the controlling field
433
+
- If the `states` field is not provided, default DevRev states will be used: `open`, `in_progress` and `closed`
0 commit comments