|
79 | 79 |
|
80 | 80 | - Implement The Function that uses The API to fetch The List of Cards for The Board (The Fetched Cards) using the endpoint "/boards/{id}/cards". The Board ID is provided in the "external_sync_unit_id" field of the "event_context" dictionary which is part of "payload" dictionary. |
81 | 81 |
|
82 | | -## Generate 'external_domain_metadata.json' |
| 82 | +## Generate 'initial_domain_mapping.json' and 'external_domain_metadata.json' |
| 83 | + |
| 84 | +***Non-Functional Requirements:*** |
| 85 | + |
| 86 | +- Store The External Domain Metadata JSON object as a separate JSON file. |
| 87 | + |
| 88 | +- Store The Initial Domain Mapping JSON object as a separate JSON file. |
| 89 | + |
| 90 | +### Generate 'external_domain_metadata.json' |
83 | 91 |
|
84 | 92 | ***Definitions:*** |
85 | 93 |
|
86 | 94 | - The structure of The External Domain Metadata JSON object is specified by the JSON schema defined in the resource [external_domain_metadata_schema.json](external_domain_metadata_schema.json). |
87 | 95 | - Please note that all refers_to keys in reference and typed_reference fields must use the format "#record:<record_type_key>", where <record_type_key> matches a key in the top-level record_types. This ensures references are unambiguous and valid. Use {} as the value to refer by default identifier (id), or specify { "by_field": "field_name" } to use a custom key. |
88 | 96 |
|
89 | | -***Non-Functional Requirements:*** |
| 97 | +***Test Requirements:*** |
90 | 98 |
|
91 | | -- Store The External Domain Metadata JSON object as a separate JSON file. |
| 99 | +- Validate generated The External Domain Metadata JSON object with the chef-cli tool (The Chef CLI) using the command "chef-cli validate-metadata": |
| 100 | + - This command reads JSON object from stdin. |
| 101 | + - The path to The Chef CLI executable is provided in the environment variables `CHEF_CLI_PATH`. |
| 102 | + - For the validation of The External Domain Metadata JSON object to be successful The Chef CLI must return an empty output. |
| 103 | + - The test should always fail if The Chef CLI is not available. |
92 | 104 |
|
| 105 | +- The External Domain Metadata JSON object should always be read from The Implementation Code. |
93 | 106 |
|
94 | | -***Test Requirements:*** |
| 107 | +- If The Conformance Tests test The External Domain Metadata JSON object, test it only against The Chef CLI. Don't test it against the literal JSON contents of The External Domain Metadata JSON object. |
| 108 | + |
| 109 | +- If validating The External Domain Metadata JSON object with The Chef CLI, print the stdout and stderr of The Chef CLI to the console. |
95 | 110 |
|
96 | 111 | - The Conformance Tests should not modify nor do any transformations on The External Domain Metadata JSON object at all. If The Conformance Tests indicates a problem with The External Domain Metadata JSON object, The External Domain Metadata JSON object in the implementation code should be adjusted to fix the problem. The tests should only validate the JSON object in its original form. |
97 | 112 |
|
98 | 113 | ***Functional Requirements:*** |
99 | 114 |
|
100 | | -- Implement The Function that generates and returns The External Domain Metadata JSON object. The record types that should be included in the The External Domain Metadata are The List of Cards ('cards') and The List of Users ('users'). |
101 | | - |
102 | | - ***Acceptance Tests:*** |
| 115 | +- Implement The Function that generates and returns The External Domain Metadata JSON object. At start, The External Domain Metadata JSON object should have the only record type 'users' (Name: Users), which will be extended later on. |
| 116 | + - The record type 'users' should have two fields: |
| 117 | + - full_name (Full Name, is required, text) |
| 118 | + - username (Username, is required, text) |
103 | 119 |
|
104 | | - - Validate generated The External Domain Metadata JSON object with the chef-cli tool (The Chef CLI) using the command "chef-cli validate-metadata": |
105 | | - - This command reads JSON object from stdin. |
106 | | - - The path to The Chef CLI executable is provided in the environment variables `CHEF_CLI_PATH`. |
107 | | - - For the test to be successful The Chef CLI must return an empty output. |
108 | | - - The test should always fail if The Chef CLI is not available. |
109 | | - - The Acceptance Tests should not modify nor do any transformations on The External Domain Metadata JSON object at all. The Acceptance Tests should just read The External Domain Metadata JSON object and pass it to The Chef CLI. |
| 120 | +- Extend The External Domain Metadata JSON object to include the record type 'cards'. |
| 121 | + - The record type 'cards' should have the following fields: |
| 122 | + - name (Name, is required, text) |
| 123 | + - url (URL, is required, text) |
| 124 | + - description (Description, is required, rich text) |
| 125 | + - id_members (ID Members, is required, type: reference, it refers to the record type "#record:users") |
110 | 126 |
|
111 | | - |
112 | | -## Generate 'initial_domain_mapping.json' |
| 127 | +### Generate 'initial_domain_mapping.json' |
113 | 128 |
|
114 | 129 | ***Definitions:*** |
115 | 130 |
|
|
120 | 135 | - Please note that mappings are split into separate ‘shards’ - one for each record type - for easier manipulation and storage. |
121 | 136 | - Please note that a leaf type or a concrete id has to be selected for use_devrev_record, but not both. |
122 | 137 |
|
| 138 | +- The Stock Field Mapping Field is a configuration object within the Initial Domain Mapping JSON structure that defines how external system data fields are mapped to DevRev's built-in (stock) fields. It is located within the "stock_field_mappings" object inside a blueprint shard configuration. |
| 139 | + |
| 140 | +- The Fixed Transformation Method is a transformation method that is used to set a fixed value to a field. To apply The Fixed Transformation Method to The Stock Field Mapping Field, set the Metadata extraction transformation method type to "use_fixed_value". If using The Fixed Transformation Method, the value of the field "transformation_method_for_set" inside The Stock Field Mapping Field should be `{"enum": "<value>", "transformation_method": "use_fixed_value", "value": "enum_value"}`, where `<value>` is the fixed value. |
| 141 | + |
| 142 | +- The External Transformation Method is a transformation method that is used to map an external field to a DevRev stock field. To apply The External Transformation Method to The Stock Field Mapping Field, set the Metadata extraction transformation method type to "use_directly", "use_as_array_value", "use_rich_text", depending on the context. Field "primary_external_field" should be set to the name of the external field to map. |
| 143 | + |
| 144 | +- The DevRev Record Transformation Method is a transformation method that is used enable use of a fixed reference to something in DevRev. To apply The DevRev Record Transformation Method to The Stock Field Mapping Field, set the Metadata extraction transformation method type to "use_devrev_record". |
123 | 145 |
|
124 | 146 | ***Non-Functional Requirements:*** |
125 | 147 |
|
126 | | -- Store The Initial Domain Mapping JSON object as a separate JSON file. |
| 148 | +- The External Domain Metadata JSON object should not be modified. If there are discrepancies between The External Domain Metadata JSON object and The Initial Domain Mapping JSON object, assume The External Domain Metadata JSON object is correct and The Initial Domain Mapping JSON object needs to be adjusted. |
127 | 149 |
|
128 | | -***Test Requirements:*** |
| 150 | +***Test Requirements:*** |
129 | 151 |
|
130 | | -- The Conformance Tests should not modify nor do any transformations on The Initial Domain Mapping JSON object at all. If The Conformance Tests indicates a problem with The Initial Domain Mapping JSON object, The Initial Domain Mapping JSON object in the implementation code should be adjusted to fix the problem. The tests should only validate the JSON object in its original form. |
| 152 | +- Validate generated The Initial Domain Mapping JSON object with the chef-cli tool (The Chef CLI) using the command "chef-cli initial-mapping check -m <The External Domain Metadata JSON object file>": |
| 153 | + - The Chef CLI reads The Initial Domain Mapping JSON object from stdin. |
| 154 | + - For return type of The Chef CLI to stdout, see resource [chef_cli_output_schema.json](resources/chef_cli_output_schema.json). Fields "RemainingDeficiencies" and "Warnings" contains information about the deficiencies that need to be resolved for the validation to pass. |
| 155 | + - The path to The Chef CLI executable is provided in the environment variables `CHEF_CLI_PATH`. |
| 156 | + - The test should always fail if we get an empty output. |
| 157 | + - The test must fail unless both of the fields "RemainingDeficiencies" and "Warnings" of the first object in the Chef CLI output array are present and both of their values are exactly null. |
| 158 | + - The test should always fail if The Chef CLI is not available. |
131 | 159 |
|
132 | | -***Functional Requirements:*** |
| 160 | +- The Initial Domain Mapping JSON object should always be read from The Implementation Code. |
133 | 161 |
|
134 | | -- Implement The Function that generates and returns The Initial Domain Mapping JSON object. |
| 162 | +- If validating The Initial Domain Mapping JSON object with The Chef CLI, print the stdout and stderr of The Chef CLI to the console. |
135 | 163 |
|
136 | | - ***Acceptance Tests:*** |
| 164 | +- If The Conformance Tests test The Initial Domain Mapping JSON object, test it only against The Chef CLI. Don't test it against the literal JSON contents of The Initial Domain Mapping JSON object. |
137 | 165 |
|
138 | | - - Validate generated The Initial Domain Mapping JSON object with the chef-cli tool (The Chef CLI) using the command "chef-cli initial-mapping check -m <The External Domain Metadata JSON object file>": |
139 | | - - The Chef CLI reads The Initial Domain Mapping JSON object from stdin. |
140 | | - - The path to The Chef CLI executable is provided in the environment variables `CHEF_CLI_PATH`. |
141 | | - - The test should always fail if The Chef CLI returns a non-empty output. |
142 | | - - The test should always fail if The Chef CLI is not available. |
143 | | - - The Acceptance Tests should not modify nor do any transformations on The Initial Domain Mapping JSON object at all. The Acceptance Tests should just read The Initial Domain Mapping JSON object and pass it to The Chef CLI. |
| 166 | +- The Conformance Tests should not modify nor do any transformations on The Initial Domain Mapping JSON object at all. If The Conformance Tests indicates a problem with The Initial Domain Mapping JSON object, The Initial Domain Mapping JSON object in the implementation code should be adjusted to fix the problem. The tests should only validate the JSON object in its original form. |
| 167 | + |
| 168 | +***Functional Requirements:*** |
144 | 169 |
|
| 170 | +- Implement The Function that generates and returns The Initial Domain Mapping JSON object. At start, The Initial Domain Mapping JSON object should have the only record_type_mappings "users", which will be extended later on. |
| 171 | + - Set the default mapping so that each external user is mapped to a "devu" user object. |
| 172 | + - There should be a single "possible_record_type_mappings" element, specifying: |
| 173 | + - The mapping is one-way, e.g. reverse is false, forward is true |
| 174 | + - There should be no custom fields in the mapping. |
| 175 | + - A new recipe blueprint shard should be created for the mapping, rather than using an existing one. |
| 176 | + - The following The Stock Field Mapping Fields should be mapped using The External Transformation Method: |
| 177 | + - field "full_name" should be mapped to "full_name" |
| 178 | + - field "username" should be mapped to "display_name" |
| 179 | + |
| 180 | +- Extend The Initial Domain Mapping JSON object to include the record_type_mappings "cards". |
| 181 | + - Set the default mapping so that each external card is mapped to a "issue" object. |
| 182 | + - There should be a single "possible_record_type_mappings" element, specifying: |
| 183 | + - The mapping is one-way, e.g. reverse is false, forward is true |
| 184 | + - There should be no custom fields in the mapping. |
| 185 | + - A new recipe blueprint shard should be created for the mapping, rather than using an existing one. |
| 186 | + - The following The Stock Field Mapping Fields should be mapped using The External Transformation Method: |
| 187 | + - field "name" should be mapped to "title" |
| 188 | + - field "url" should be mapped to "item_url_field" |
| 189 | + - field "description" should be mapped to "body" (rich text) |
| 190 | + - field "id_members" should be mapped to "owned_by_ids" using "use_as_array_value" transformation method |
| 191 | + - The following The Stock Field Mapping Fields should be mapped using The Fixed Transformation Method: |
| 192 | + - field "priority" should contain fixed value "P0" |
| 193 | + - field "stage" should contain fixed value "backlog" |
| 194 | + - The following The Stock Field Mapping Fields should be mapped using The DevRev Record Transformation Method: |
| 195 | + - field "applies_to_part_id" should refer to the "product" object type |
145 | 196 |
|
146 | 197 | ## Pushing data to DevRev servers |
147 | 198 |
|
|
0 commit comments