Skip to content

Commit 1d649ce

Browse files
committed
Cleanup
1 parent f2dc3f6 commit 1d649ce

12 files changed

+220
-162
lines changed

fern/docs/pages/adaas/loading-phases.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

fern/docs/pages/adaas/attachments-extraction.mdx renamed to fern/docs/pages/airdrop/attachments-extraction.mdx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
1-
For the attachment extraction phase of the import process, the extractor has to upload each attachment to DevRev’s S3
2-
using the `S3Interact` API.
1+
For the attachment extraction phase of the import process, the extractor has to upload each
2+
attachment to DevRev's S3 using the `S3Interact` API.
33

44
## Triggering event
55

6-
Airdrop initiates the attachment extraction by starting the snap-in with a message with an event of type `EXTRACTION_ATTACHMENTS_START`.
6+
Airdrop initiates the attachment extraction by starting the snap-in with a message with an event of
7+
type `EXTRACTION_ATTACHMENTS_START`.
78
This is done after the data extraction, transformation and loading into DevRev are completed.
89

910
During the attachment extraction phase,
1011
the snap-in extracts attachments from the external system and uploads them as artifacts to DevRev.
1112

12-
The snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_ATTACHMENTS_PROGRESS` together with an optional progress estimate and relevant artifacts
13+
The snap-in must respond to Airdrop with a message with an event of type
14+
`EXTRACTION_ATTACHMENTS_PROGRESS` together with an optional progress estimate and relevant artifacts
1315
when it extracts some data and the maximum snap-in run time (12 minutes) has been reached.
1416

15-
The snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_ATTACHMENTS_DELAY` and specify a back-off time
16-
when the extraction has been rate-limited by the external system and back-off is required.
17+
The snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_ATTACHMENTS_DELAY`
18+
and specify a back-off time when the extraction has been rate-limited by the external system and
19+
back-off is required.
1720

18-
In both cases, Airdrop starts the snap-in with a message with an event of type `EXTRACTION_ATTACHMENTS_CONTINUE`.
19-
The restart is immediate in case of `EXTRACTION_ATTACHMENTS_PROGRESS`, or delayed
20-
in case of `EXTRACTION_ATTACHMENTS_DELAY`.
21+
In both cases, Airdrop starts the snap-in with a message with an event of type
22+
`EXTRACTION_ATTACHMENTS_CONTINUE`.
23+
The restart is immediate in case of `EXTRACTION_ATTACHMENTS_PROGRESS`, or delayed in case of
24+
`EXTRACTION_ATTACHMENTS_DELAY`.
2125

22-
Once the attachment extraction phase is done, the snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_ATTACHMENTS_DONE`.
26+
Once the attachment extraction phase is done, the snap-in must respond to Airdrop with a message
27+
with an event of type `EXTRACTION_ATTACHMENTS_DONE`.
2328

24-
If attachment extraction fails the snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_ATTACHMENTS_ERROR`.
29+
If attachment extraction fails the snap-in must respond to Airdrop with a message with an event of
30+
type `EXTRACTION_ATTACHMENTS_ERROR`.
2531

2632
## Snap-in response
2733

28-
After uploading an attachment or a batch of attachments, the extractor also has to prepare and upload a file specifying
29-
the extracted and uploaded attachments.
34+
After uploading an attachment or a batch of attachments, the extractor also has to prepare and
35+
upload a file specifying the extracted and uploaded attachments.
3036

31-
It should contain the DevRev IDs of the extracted and uploaded attachments, along with the parent domain object ID
32-
from the external system and the actor ID from the external system.
37+
It should contain the DevRev IDs of the extracted and uploaded attachments, along with the parent
38+
domain object ID from the external system and the actor ID from the external system.
3339

34-
The uploaded artifact is structured like a normal artifact containing extracted data in JSON Lines (JSONL) format and requires specifying `ssor_attachment` as the item type.
40+
The uploaded artifact is structured like a normal artifact containing extracted data in JSON Lines
41+
(JSONL) format and requires specifying `ssor_attachment` as the item type.
3542

3643
## Examples
3744

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
During the deletion phases, the snap-in may clean up its state or other side effects in the third party systems.
2-
In the most common extraction use cases, there is nothing to do and snap-ins may reply with the completion message.
1+
During the deletion phases, the snap-in may clean up its state or other side effects in the third
2+
party systems. In the most common extraction use cases, there is nothing to do and snap-ins may reply
3+
with the completion message.
34

45
## Data deletion
56

@@ -10,19 +11,19 @@ It is started by sending the worker a message with an event of type `EXTRACTION_
1011

1112
### Snap-in response
1213

13-
The worker must respond to Airdrop with a message with an event of type `EXTRACTION_DATA_DELETE_DONE` when done or
14-
`EXTRACTION_DATA_DELETE_ERROR` in case of an error.
14+
The worker must respond to Airdrop with a message with an event of type `EXTRACTION_DATA_DELETE_DONE`
15+
when done or `EXTRACTION_DATA_DELETE_ERROR` in case of an error.
1516

1617
## Attachments deletion
1718

1819

1920
### Triggering event
2021

21-
Airdrop initiates the attachments deletion phase when an import is deleted from the DevRev app, after the data deletion has completed.
22+
Airdrop initiates the attachments deletion phase when an import is deleted from the DevRev app,
23+
after the data deletion has completed.
2224
It is started by sending the snap-in a message with an event of type `EXTRACTION_ATTACHMENTS_DELETE`.
2325

2426
### Snap-in response
2527

26-
The snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_ATTACHMENTS_DELETE_DONE` when done,
27-
or `EXTRACTION_ATTACHMENTS_DELETE_ERROR` in case of an error.
28-
28+
The snap-in must respond to Airdrop with a message with an event of type`EXTRACTION_ATTACHMENTS_DELETE_DONE`
29+
when done, or `EXTRACTION_ATTACHMENTS_DELETE_ERROR` in case of an error.

fern/docs/pages/adaas/data-extraction.mdx renamed to fern/docs/pages/airdrop/data-extraction.mdx

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11

2-
In the data extraction phase, the extractor is expected to call the external systems APIs
2+
In the data extraction phase, the extractor is expected to call the external system's APIs
33
to retrieve all the items that were updated since the start of the last extraction.
4-
If there was no previous extraction (the current run is an initial import), then all the items should be extracted.
4+
If there was no previous extraction (the current run is an initial import),
5+
then all the items should be extracted.
56

67
The extractor must store at what time it started each extraction in its state,
78
so that it can extract only items created and/or updated since this date in the next sync run.
89

910
## Triggering event
1011

11-
Airdrop initiates data extraction by starting the snap-in with a message with event of type `EXTRACTION_DATA_START`
12-
when transitioning to the data extraction phase.
12+
Airdrop initiates data extraction by starting the snap-in with a message with event of type
13+
`EXTRACTION_DATA_START` when transitioning to the data extraction phase.
1314

1415
During the data extraction phase, the snap-in extracts data from an external system,
1516
prepares batches of data and uploads them in the form of artifacts to DevRev.
@@ -18,33 +19,43 @@ The snap-in must respond to Airdrop with a message with event of type `EXTRACTIO
1819
together with an optional progress estimate and relevant artifacts
1920
when it extracts some data and the maximum Airdrop snap-in runtime (12 minutes) has been reached.
2021

21-
If the extraction has been rate-limited by the external system and back-off is required, the snap-in must respond to
22-
Airdrop with a message with event of type `EXTRACTION_DATA_DELAY` and specifying back-off time with `delay` attribute.
22+
If the extraction has been rate-limited by the external system and back-off is required, the snap-in
23+
must respond to Airdrop with a message with event of type `EXTRACTION_DATA_DELAY` and specifying
24+
back-off time with `delay` attribute.
2325

2426
In both cases, Airdrop starts the snap-in with a message with event of type `EXTRACTION_DATA_CONTINUE`.
25-
The restarting is immediate (in case of `EXTRACTION_DATA_PROGRESS`) or delayed (in case of `EXTRACTION_DATA_DELAY`).
27+
The restarting is immediate (in case of `EXTRACTION_DATA_PROGRESS`) or delayed
28+
(in case of `EXTRACTION_DATA_DELAY`).
2629

27-
Once the data extraction is done, the snap-in must respond to Airdrop with a message with event of type `EXTRACTION_DATA_DONE`.
30+
Once the data extraction is done, the snap-in must respond to Airdrop with a message with event of
31+
type `EXTRACTION_DATA_DONE`.
2832

29-
If data extraction failed in any moment of extraction, the snap-in must respond to Airdrop with a message with event of type `EXTRACTION_DATA_ERROR`.
33+
If data extraction failed in any moment of extraction, the snap-in must respond to Airdrop with a
34+
message with event of type `EXTRACTION_DATA_ERROR`.
3035

3136
## Snap-in response
3237

33-
During the data extraction phase, the snap-in uploads batches of extracted items (the recommended batch size is 2000 items) formatted in JSONL
34-
(JSON Lines format), gzipped, and submitted as an artifact to S3Interact (with tooling from `@devrev/adaas-sdk`).
38+
During the data extraction phase, the snap-in uploads batches of extracted items (the recommended
39+
batch size is 2000 items) formatted in JSONL (JSON Lines format), gzipped, and submitted as an
40+
artifact to S3Interact (with tooling from `@devrev/adaas-sdk`).
3541

36-
Each artifact is submitted with an `item_type`, defining a separate domain object from the external system and matching the `record_type` in the provided metadata.
42+
Each artifact is submitted with an `item_type`, defining a separate domain object from the
43+
external system and matching the `record_type` in the provided metadata.
3744
Item types defined when uploading extracted data must validate the declarations in the metadata file.
3845

3946
Extracted data must be normalized.
4047

41-
- Null values: All fields without a value should either be omitted or set to null. For example, if an external system provides values such as "", -1 for missing values, those must be set to null.
42-
- Timestamps: Full-precision timestamps should be formatted as RFC3999 (`1972-03-29T22:04:47+01:00`), and dates should be just `2020-12-31`.
48+
- Null values: All fields without a value should either be omitted or set to null.
49+
For example, if an external system provides values such as "", -1 for missing values,
50+
those must be set to null.
51+
- Timestamps: Full-precision timestamps should be formatted as RFC3999 (`1972-03-29T22:04:47+01:00`),
52+
and dates should be just `2020-12-31`.
4353
- References: references must be strings, not numbers or objects.
4454
- Number fields must be valid JSON numbers (not strings)
4555
- Multiselect fields must be provided as an array (not CSV)
4656

47-
Each line of the file contains an `id` and the optional `created_date` and `modified_date` fields in the beginning of the record.
57+
Each line of the file contains an `id` and the optional `created_date` and `modified_date` fields
58+
in the beginning of the record.
4859
All other fields are contained within the `data` attribute.
4960

5061
```json
@@ -68,4 +79,4 @@ Extracted artifacts can be validated with the `chef-cli` using the following com
6879

6980
```bash
7081
$ chef-cli validate-metadata -m external_domain_metadata.json -r issue < extractor_issues_2.json
71-
```
82+
```

fern/docs/pages/adaas/external-sync-units-extraction.mdx renamed to fern/docs/pages/airdrop/external-sync-units-extraction.mdx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
1-
In the external sync unit extraction phase, the extractor is expected to obtain a list of external sync units
2-
that it can extract with the provided credentials and send it to Airdrop in its response.
1+
In the external sync unit extraction phase, the extractor is expected to obtain a list of external
2+
sync units that it can extract with the provided credentials and send it to Airdrop in its response.
33

44
An _external sync unit_ refers to a single unit in the external system that we are airdropping to DevRev.
5-
In some systems, this is a project; in some it is a repository; in support systems it could be called a brand or an organization.
5+
In some systems, this is a project; in some it is a repository; in support systems it could be
6+
called a brand or an organization.
67
What a unit of data is called and what it represents depends on the external system's domain model.
78
It usually combines contacts, users, work-like items, and comments into a unit of domain objects.
89

910
Some external systems may offer a single unit in their free plans,
1011
while their enterprise plans may offer their clients to operate many separate units.
1112

12-
The external sync unit ID is the identifier of the sync unit (project, repository or similar) in the external system.
13+
The external sync unit ID is the identifier of the sync unit (project, repository or similar)
14+
in the external system.
1315
For GitHub, this would be the repository, for example `cli` in `github.com/devrev/cli`.
1416

1517
## Triggering event
1618

1719
External sync unit extraction is executed only during the initial import.
18-
It extracts external sync units available in the external system,
19-
so that the end user can choose which external sync unit should be airdropped during the creation of an **Import** in the DevRev App.
20+
It extracts external sync units available in the external system, so that the end user can choose
21+
which external sync unit should be airdropped during the creation of an **Import** in the DevRev App.
2022

21-
Airdrop initiates the external sync unit extraction phase by starting the worker with a message with an event of type
22-
`EXTRACTION_EXTERNAL_SYNC_UNITS_START`.
23+
Airdrop initiates the external sync unit extraction phase by starting the worker with a message
24+
with an event of type `EXTRACTION_EXTERNAL_SYNC_UNITS_START`.
2325

24-
The snap-in must respond to Airdrop with a message with an event of type `EXTRACTION_EXTERNAL_SYNC_UNITS_DONE`, which contains
25-
a list of external sync units as a payload, or `EXTRACTION_EXTERNAL_SYNC_UNITS_ERROR` in case of an error.
26+
The snap-in must respond to Airdrop with a message with an event of type
27+
`EXTRACTION_EXTERNAL_SYNC_UNITS_DONE`, which contains a list of external sync units as a payload,
28+
or `EXTRACTION_EXTERNAL_SYNC_UNITS_ERROR` in case of an error.
2629

2730
## Snap-in response
2831

29-
The snap-in provides the list of external sync units in the provided event message `event_data.external_sync_units` containing the following fields:
32+
The snap-in provides the list of external sync units in the provided event message
33+
`event_data.external_sync_units` containing the following fields:
3034
- `id`: The unique identifier in the external system.
3135
- `name`: The human-readable name in the external system.
3236
- `description`: The short description if the external system provides it.
3337
- `item_count`: The number of items (issues, tickets, comments or others) in the external system.
34-
Item count should be provided if it can be obtained in a very lightweight manner, such as by calling an API endpoint.
38+
Item count should be provided if it can be obtained in a very lightweight manner,
39+
such as by calling an API endpoint.
3540
If there is no such way to get it (for example, if the items would need to be extracted to count them),
3641
then the item count should be `-1` to avoid blocking the import with long-running queries.
3742

fern/docs/pages/adaas/extraction-phases.mdx renamed to fern/docs/pages/airdrop/extraction-phases.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Extraction
1+
Airdrop extractions are done in _sync runs_.
2+
A sync run is one execution of an import or sync.
3+
If you do an initial import from the external system to DevRev, that import will be one sync run.
4+
If you then decide to do a reverse sync from DevRev to the external system, that would be another
5+
sync run.
26

3-
Airdrop extractions are done in _sync runs_. A sync run is one execution of an import or sync. If you do an initial import from
4-
the external system to DevRev, that import will be one sync run. If you then decide to do a reverse sync from DevRev to
5-
the external system, that would be another sync run.
6-
7-
Each sync run is comprised out of phases. Phases follow sequentially, and each can consist of one or more invocations
8-
of the snap-in.
7+
Each sync run is comprised out of phases.
8+
Phases follow sequentially, and each can consist of one or more invocations of the snap-in.
99

1010
```mermaid
1111
sequenceDiagram
@@ -84,12 +84,13 @@ An _initial import_ consists of the following phases:
8484
### 1-way sync
8585

8686
A _1-way sync_ refers to any extraction after the initial import has been successfully completed.
87-
An extractor extracts data that was created and/or updated in the external system
88-
after the start of the latest successful forward sync, including any changes that occurred during the
89-
forward sync, but were not picked up by it.
87+
An extractor extracts data that was created and/or updated in the external system after the start
88+
of the latest successful forward sync, including any changes that occurred during the forward sync,
89+
but were not picked up by it.
9090

91-
A snap-in must consult its state to get information on when the last successful forward sync started. Airdrop snap-ins
92-
must maintain their own states that persists between phases in a sync run, as well as between sync runs.
91+
A snap-in must consult its state to get information on when the last successful forward sync started.
92+
Airdrop snap-ins must maintain their own states that persists between phases in a sync run,
93+
as well as between sync runs.
9394

9495
A 1-way sync consists of the following phases:
9596
1. Metadata extraction
@@ -104,4 +105,3 @@ A 1-way sync extracts only the domain objects updated or created since the previ
104105
A _deletion_ consists of the following phases:
105106
1. Data deletion
106107
2. Attachments deletion
107-
File renamed without changes.

fern/docs/pages/adaas/getting-started.mdx renamed to fern/docs/pages/airdrop/getting-started.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Before you begin
22

33
- If you have not created a development organization on DevRev before, create a dedicated
4-
[DevRev organization for development purposes](https://app.devrev.ai/) where you will be publishing your Airdrop snap-in.
4+
[DevRev organization for development purposes](https://app.devrev.ai/) where you will be
5+
publishing your Airdrop snap-in.
56
- Install required tools and packages:
67
- [devrev-cli](https://developer.devrev.ai/snapin-development/references/cli-install) (version 4.7 or higher)
78
- [jq](https://stedolan.github.io/jq)
@@ -10,8 +11,8 @@
1011

1112
## Setting up the snap-in
1213

13-
1. Create a new repo from the [Airdrop template repo](https://github.com/devrev/adaas-template). Select _Use this template_ and
14-
then _Create a new repository_.
14+
1. Create a new repo from the [Airdrop template repo](https://github.com/devrev/adaas-template).
15+
Select _Use this template_ and then _Create a new repository_.
1516
1. Copy `.env.example` to `.env` and fill in the required variables.
1617
1. Configure a keyring for the external system in the `manifest.yaml`.
1718
Refer to [Keyrings](/snapin-development/references/manifest#developer-keyrings) for instructions.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Loading
2+
3+
To be added.

0 commit comments

Comments
 (0)