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
> Note: Should be reviewed alongside
devrev/airdrop-shared#24.
This PR introduces support for
- Rate limiting (through proxy)
- Attachments handling (I can now confirm that acceptance tests for
attachment passing means that the attachments will also get extracted to
the DevRev platform)
- Simplify flow for the incremental mode
NOTE: Regarding attachments: In Trello, you have to construct separate
endpoint for streaming attachments (Refer to
`trello-openapi-compact.yaml` for more. This is handled during
attachment normalization phase (in data extraction). This endpoint has
for some reason separate authentication.
Changes include:
- Simplify every acceptance test by removing text `Make sure to replace
placeholders in the resource with The Trello API Key, The Trello OAuth
Token, and The Organization ID.`. Instead, we do that only once on the
toplevel and it seems to working fine
- Acceptance tests in `Data fetching` for rate limiting (testing API
calls rate limits directly)
- Acceptance tests in `Pushing data to DevRev server` for rate limiting
(testing if events get emitted properly)
- Added instructions for constructing the attachment URL
(Trello-specific)
- Added acceptance test that actually tests if attachment extraction
works
- Added event payload for incremental mode
- Simplify and improve acceptance test for incremental mode
- Update `test_data/external_domain_metadata_event_payload.json`
- Update `test_data/trello_external_sync_unit_check.json`
- Updated `trello-openapi-compact.yaml` to:
- Also include information about rate limiting documentation
- Add docs for endpoint for streaming attachments
Issues connected:
- [ISS-217157](https://app.devrev.ai/devrev/works/ISS-217157)
Validate the incremental mode with the following flow:
2
+
- Step 1:
3
+
- Execute request `curl -X POST "http://localhost:8003/external-worker.update-last-successful-sync/<sync_unit_id>" -H "Content-Type: application/json" -d '{"snap_in_version_id":"test-version-id","extend_state":{"users":{"completed":true},"cards":{"completed":true},"attachments":{"completed":true}}}'`, where `<sync_unit_id>` is `event["payload"]["event_context"]["sync_unit_id"]` in the resource [data_extraction_test.json](test_data/data_extraction_test.json).
4
+
- Step 2:
5
+
- Execute request `curl --request PUT --url 'https://api.trello.com/1/cards/688725fd3e26ebcf364bff4a?key=<TRELLO_API_KEY>&token=<TRELLO_TOKEN>&name="Card50-<uuid>"' --header 'Accept: application/json'` (replace <TRELLO_API_KEY>, <TRELLO_TOKEN> and <uuid> with the actual values).
6
+
- Expect the request to succeed.
7
+
- Step 3:
8
+
- Invoke The Extraction Function using the resource [data_extraction_incremental_test.json](test_data/data_extraction_incremental_test.json).
9
+
- Expect The Callback Server to receive from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE".
10
+
- Let `artifact_array = <event_from_callback_server>["event_data"]["artifacts"]` (array of objects).
11
+
- Expect `artifact_array` to not be empty array.
12
+
- Out of `artifact_array`, expect one of the elements to have "item_type" equal to "cards" (`:= cards_artifact`). Expect `cards_artifact["item_count"]=1`.
13
+
- Expect that there is no element in `artifact_array` with "item_type" equal to "attachments". If there is, this indicates that the attachments data was pushed to the DevRev servers, which is wrong.
14
+
- Expect that there is no element in `artifact_array` with "item_type" equal to "users". If there is, this indicates that the users data was pushed to the DevRev servers, which is wrong.
Validate the incremental mode with the following flow:
2
+
- Step 1:
3
+
- Execute request `curl -X POST "http://localhost:8003/external-worker.update-last-successful-sync/<sync_unit_id>" -H "Content-Type: application/json" -d '{"snap_in_version_id":"test-version-id","extend_state":{"users":{"completed":true},"cards":{"completed":true},"attachments":{"completed":true}}}'`, where `<sync_unit_id>` is `event["payload"]["event_context"]["sync_unit_id"]` in the resource [data_extraction_test.json](test_data/data_extraction_test.json).
4
+
- Step 2:
5
+
- Execute request `curl --request PUT --url 'https://api.trello.com/1/cards/688725db990240b77167efef?key=<TRELLO_API_KEY>&token=<TRELLO_TOKEN>&name="Card1-<uuid>"' --header 'Accept: application/json'` (replace <TRELLO_API_KEY>, <TRELLO_TOKEN> and <uuid> with the actual values).
6
+
- Expect the request to succeed.
7
+
- Step 3:
8
+
- Invoke The Extraction Function using the resource [data_extraction_incremental_test.json](test_data/data_extraction_incremental_test.json).
9
+
- Expect The Callback Server to receive from DevRev a **single** event with "event_type" that equals "EXTRACTION_DATA_DONE".
10
+
- Let `artifact_array = <event_from_callback_server>["event_data"]["artifacts"]` (array of objects).
11
+
- Expect `artifact_array` to not be empty array.
12
+
- Out of `artifact_array`, expect one of the elements to have "item_type" equal to "cards" (`:= cards_artifact`). Expect `cards_artifact["item_count"]=1`.
13
+
- Out of `artifact_array`, expect one of the elements to have "item_type" equal to "attachments" (`:= attachments_artifact`). Expect `attachments_artifact["item_count"]=2`.
14
+
- Expect that there is no element in `artifact_array` with "item_type" equal to "users". If there is, this indicates that the users data was pushed to the DevRev servers, which is wrong.
0 commit comments