|
40 | 40 |
|
41 | 41 | ***Test Requirements:*** |
42 | 42 |
|
43 | | -- Credentials should be read from the environment. The following environment variables are required: `TRELLO_API_KEY` (Trello API Key), `TRELLO_TOKEN` (Trello OAuth Token), `TRELLO_ORGANIZATION_ID` (The Organization ID). |
| 43 | +- Credentials should be read from the environment. The following environment variables are required: `TRELLO_API_KEY` (The Trello API Key), `TRELLO_TOKEN` (The Trello OAuth Token), `TRELLO_ORGANIZATION_ID` (The Organization ID). |
| 44 | + |
| 45 | +- "external_sync_unit_id" "6752eb962a64828e59a35396" can be used when board ID is required for testing purposes. |
44 | 46 |
|
45 | 47 |
|
46 | 48 | ## The Boilerplate Code |
|
84 | 86 |
|
85 | 87 | ***Non-Functional Requirements:*** |
86 | 88 |
|
87 | | -- Store The External Domain Metadata JSON object as a separate source file. |
| 89 | +- Store The External Domain Metadata JSON object as a separate JSON file. |
88 | 90 |
|
89 | 91 | ***Functional Requirements:*** |
90 | 92 |
|
|
105 | 107 |
|
106 | 108 | - The structure of The Initial Domain Mapping JSON object is specified by the JSON schema defined in the resource [initial_mappings_schema.yaml](initial_mappings_schema.yaml). |
107 | 109 | - For a complete list of supported DevRev object types and their fields, see resource [Supported DevRev object types for Airdrop](docs/supported-object-types.md). |
| 110 | + - For information about transformation methods, see resource [Mapping Reasons](docs/mapping-reasons.mdx). |
| 111 | + - When working with devrev_leaf_type, be aware that the schema expects different formats depending on context. In most places, it should be passed as an object with object_category and object_type. However, in the airdrop-recipe-create-possible-record-type-mapping context, it must be a string representing only the object_type. |
| 112 | + - Please note that mappings are split into separate ‘shards’ - one for each record type - for easier manipulation and storage. |
| 113 | + - Please note that a leaf type or a concrete id has to be selected for use_devrev_record, but not both. |
108 | 114 |
|
109 | 115 | ***Non-Functional Requirements:*** |
110 | 116 |
|
111 | | -- Store The Initial Domain Mapping JSON object as a separate source file. |
112 | | - |
| 117 | +- Store The Initial Domain Mapping JSON object as a separate JSON file. |
113 | 118 |
|
114 | 119 | ***Functional Requirements:*** |
115 | 120 |
|
116 | 121 | - Implement The Function that generates and returns The Initial Domain Mapping JSON object. |
117 | 122 |
|
| 123 | + |
118 | 124 | ***Acceptance Tests:*** |
119 | 125 |
|
120 | | - - 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 <path to The External Domain Metadata JSON file>": |
| 126 | + - 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>": |
121 | 127 | - The Chef CLI reads The Initial Domain Mapping JSON object from stdin. |
122 | 128 | - The path to The Chef CLI executable is provided in the environment variables `CHEF_CLI_PATH`. |
123 | | - - For the test to be successful The Chef CLI must return an empty output. |
| 129 | + - The test should always fail if The Chef CLI returns a non-empty output. |
124 | 130 | - The test should always fail if The Chef CLI is not available. |
125 | 131 |
|
126 | 132 |
|
|
134 | 140 |
|
135 | 141 | - Use The Initial Domain Mapping JSON object for initialDomainMapping parameter when spawning a new worker. |
136 | 142 |
|
137 | | -- Implement The Function that pushes The Fetched Boards as external sync units (The Push Boards Function). |
| 143 | +- Implement The Function named "extraction" (The Extraction Function) that pushes The Fetched Boards as external sync units if "event_type" equals "EXTRACTION_EXTERNAL_SYNC_UNITS_START". |
138 | 144 |
|
139 | 145 | ***Acceptance Tests:*** |
140 | 146 |
|
141 | | - - Test The Push Boards Function using the resource [trello_external_sync_unit_check.json](test_data/trello_external_sync_unit_check.json). For the test to be successful The Callback Server **must** receive from DevRev **exactly one** event with "event_type" that equals "EXTRACTION_EXTERNAL_SYNC_UNITS_DONE". The test must not send the event directly to The Callback Server. |
| 147 | + - Test The Extraction Function using the resource [trello_external_sync_unit_check.json](test_data/trello_external_sync_unit_check.json). Make sure to replace placeholders in the resource with The Trello API Key, The Trello OAuth Token, and The Organization ID. For the test to be successful The Callback Server **must** receive from DevRev **exactly one** event with "event_type" that equals "EXTRACTION_EXTERNAL_SYNC_UNITS_DONE". The test must not send the event directly to The Callback Server. |
142 | 148 |
|
143 | | -- The Push Boards Function should fetch the cards count for each board and push it as part of the external sync units. |
| 149 | +- If "event_type" equals "EXTRACTION_EXTERNAL_SYNC_UNITS_START" The Extraction Function should fetch the cards count for each board and push it as part of the external sync units. |
144 | 150 |
|
145 | | -- Implement The Function that implements the "metadata extraction" part of the extraction workflow by pushing The External Domain Metadata JSON object to the repository called 'external_domain_metadata'. (The Push Metadata Function). |
| 151 | +- If "event_type" equals "EXTRACTION_METADATA_START" The Extraction Function should implement the "metadata extraction" part of the extraction workflow by pushing The External Domain Metadata JSON object to the repository called 'external_domain_metadata'. Please note that The External Domain Metadata JSON object shouldn't be normalized when pushed to the repository. |
146 | 152 |
|
147 | | -- Implement The Function that pushes The Fetched Users to the repository designated for 'users' data (The Push Users Function). |
148 | | - |
149 | | -- Implement The Function that pushes The Fetched Cards to the repository designated for 'cards' data (The Push Cards Function). |
150 | | - |
151 | | -- Implement The Function that implements attachment extraction as described in the resource [attachments-extraction.md](docs/attachments-extraction.md) (The Attachment Extraction Function) |
152 | | - |
153 | | -- Implement The Function named "extraction" that calls: |
154 | | - - The Push Boards Function if "event_type" equals "EXTRACTION_EXTERNAL_SYNC_UNITS_START". |
155 | | - - The Push Metadata Function if "event_type" equals "EXTRACTION_METADATA_START". |
156 | | - - The Push Users Function and The Push Cards Function if "event_type" equals "EXTRACTION_DATA_START" (but make sure that a single "EXTRACTION_DATA_DONE" event is emitted). |
157 | | - - The Attachment Extraction Function if "event_type" equals "EXTRACTION_ATTACHMENTS_START" or "EXTRACTION_ATTACHMENTS_CONTINUE". |
| 153 | +- If "event_type" equals "EXTRACTION_DATA_START" The Extraction Function should: |
| 154 | + - push The Fetched Users to the repository designated for 'users' data |
| 155 | + - push The Fetched Cards to the repository designated for 'cards' data |
| 156 | + (but make sure that a single "EXTRACTION_DATA_DONE" event is emitted) |
158 | 157 |
|
159 | 158 | ***Acceptance Tests:*** |
160 | 159 |
|
161 | | - - Test The Function using the resource [data_extraction_test.json](test_data/data_extraction_test.json). Test is successful if The Callback Server receives from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE". The test must not send event directly to The Callback Server. |
| 160 | + - Test The Extraction Function using the resource [data_extraction_test.json](test_data/data_extraction_test.json). Make sure to replace placeholders in the resource with The Trello API Key, The Trello OAuth Token, and The Organization ID. Test is successful if The Callback Server receives from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE". The test must not send event directly to The Callback Server. |
| 161 | + |
| 162 | + - Test The Extraction Function using the resource [data_extraction_test.json](test_data/data_extraction_test.json). Make sure to replace placeholders in the resource with The Trello API Key, The Trello OAuth Token, and The Organization ID. Test is successful if The Callback Server does not receive from DevRev any event with "event_type" that equals "EXTRACTION_DATA_ERROR". The test must not send event directly to The Callback Server. |
162 | 163 |
|
163 | | - - Test The Function using the resource [data_extraction_test.json](test_data/data_extraction_test.json). Test is successful if The Callback Server does not receive from DevRev any event with "event_type" that equals "EXTRACTION_DATA_ERROR". The test must not send event directly to The Callback Server. |
| 164 | +- If "event_type" equals "EXTRACTION_ATTACHMENTS_START" or "EXTRACTION_ATTACHMENTS_CONTINUE" The Extraction Function should implement attachment extraction as described in the resource [attachments-extraction.md](docs/attachments-extraction.md). |
0 commit comments