Skip to content

Commit 902c913

Browse files
committed
Migrate entities definitions to separate pages.
1 parent 21c2dea commit 902c913

File tree

7 files changed

+141
-118
lines changed

7 files changed

+141
-118
lines changed

fern/docs/pages/adaas/extracting-attachments.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
For the Attachment Extraction phase of the import process,
44
the Extractor has to upload each attachment to DevRev’s S3 using the `S3Interact` API.
55

6-
After uploading an attachment or a batch of attachments, the Extractor also has to prepare and upload an SSOR attachment file.
7-
It should contain the DevRev IDs of the extracted attachments, along with the parent and actor IDs from the External System.
8-
This needs to be done because only the Extractor knows to what the attachment was attached in the External system.
9-
The SSOR attachment file should then be sent just like any normal Artifact, but with the `ssor_attachment` item type.
6+
After uploading an attachment or a batch of attachments, the extractor also has to prepare and upload a file specifying
7+
the extracted and uploaded attachments.
8+
9+
It should contain the DevRev IDs of the extracted and uploaded attachments, along with the parent domain object ID
10+
from the external system and the actor ID from the external system.
11+
12+
The uploaded artifact is structured like a normal artifact containing extracted data in JSON Lines format with specifying the
13+
`ssor_attachment` as an item type.
1014

1115
## Examples
1216

fern/docs/pages/adaas/extracting-external-sync-units.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ In the External Sync Unit extraction phase, the Extractor is expected to get the
44
(whatever the equivalent of those is called in the External System)
55
that it can extract with the provided credentials and send it to Airdrop in its response.
66

7+
An External Sync Unit refers to a single unit in the [External System](#external-system) that we are airdropping to DevRev.
8+
In some systems, this is a project, in some it is a repository, in support systems this External Sync Unit could be called a brand or an organization.
9+
What a unit of data is called, and what it represents depends on the [External System](#external-system)'s domain model.
10+
It usually combines contacts, users, work-like items, and comments into a unit of domain objects.
11+
12+
Some [External Systems](#external-system) may offer a single unit in their free plans,
13+
while their enterprise plans may offer their clients to operate many separate units.
14+
15+
The External Sync Unit ID is the identifier of the project, repository, etc. in the [External System](#external-system).
16+
For GitHub, this would be the repository, for example `cli` in `github.com/devrev/cli`.
17+
718
The most important structure in the message is the list of External Sync Units (event_data.external_sync_units in JSON),
819
which contains the following fields:
920
- ID: This is the unique identifier in the External System
1021
- Name: This is the human-readable name in the External System
1122
- Description: A short description if the External System provides it
1223
- Item count (item_count): The number of items (issues, tickets, comments, etc.) in the External System,
1324
if it can be obtained in a very lightweight manner, such as by calling a special API endpoint.
14-
If there is no such way to get it, i.e., the items would need to be extracted to count them,
25+
If there is no such way to get it, for example, the items would need to be extracted to count them,
1526
then the item count should be `-1`, to avoid blocking the import with long-running queries.
1627

1728
Example:

fern/docs/pages/adaas/extracting-metadata.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ and upload it as an Artifact with item type `initial_domain_mapping`.
55

66
The file provides mappings between External System domain entities and DevRev domain entities.
77

8-
For each extracted domain entity from the External System,
9-
the Extractor must provide at least one mapping to a DevRev domain entity.
8+
For each extracted domain entity from the External System, the Extractor must provide at least one mapping to a DevRev domain entity.
109

1110
If two or more possible mappings are provided within `possible_targets`, end-users will be able to select
1211
to what DevRev domain entity they would like to have it transformed during the mapping phase of the extraction.

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Extraction phases
22

3-
Airdrop extractions are done in phases.
4-
Phases follow sequentially, and each can consist of one or more invocations of the Worker.
5-
6-
A Worker has the responsibility of maintaining its own state that persists between phases in a Sync Run,
7-
as well as between Sync Runs.
3+
Airdrop extractions are done in sync runs, and each sync run is comprised out of phases.
4+
Phases follow sequentially, and each can consist of one or more invocations of the worker.
85

96
```mermaid
107
---
@@ -76,10 +73,12 @@ A 1-way Sync consists of the following phases:
7673
A 1-way Sync extracts only the domain objects updated and/or created since the previous successful Sync Run.
7774

7875
A Deletion Sync consists of the following phases:
79-
- Delete data,
80-
- Delete attachments.
76+
- Data deletion,
77+
- Attachments deletion.
78+
79+
## Event types per extraction phases
8180

82-
## External sync unit extraction
81+
### External sync unit extraction
8382

8483
External Sync Unit Extraction is an extraction phase, executed only during the Initial Import.
8584
It extracts External Sync Units available in the External System,
@@ -91,7 +90,7 @@ Airdrop initiates the External Sync Unit Extraction phase by starting the Worker
9190
The Worker must respond to Airdrop with a message with eventType `EXTRACTION_EXTERNAL_SYNC_UNITS_DONE`
9291
with a list of External Sync Units as a payload, or `EXTRACTION_EXTERNAL_SYNC_UNITS_ERROR` in case of an error.
9392

94-
## Metadata extraction
93+
### Metadata extraction
9594

9695
Airdrop initiates the Metadata Extraction by starting the Worker with a message with eventType: `EXTRACTION_METADATA_START`.
9796

@@ -102,7 +101,7 @@ to prepare and upload the Initial Domain Mapping to DevRev.
102101
The Worker must respond to Airdrop with a message with eventType `EXTRACTION_METADATA_DONE` when done,
103102
or `EXTRACTION_METADATA_ERROR` in case of an error.
104103

105-
## Data extraction
104+
### Data extraction
106105

107106
Airdrop initiates Data Extraction by starting the Worker with a message with eventType `EXTRACTION_DATA_START`
108107
when transitioning to the Data Extraction phase.
@@ -124,7 +123,7 @@ Once the Data Extraction is done, the Worker must respond to Airdrop with a mess
124123

125124
If Data Extraction failed in any moment of extraction, the Worker must respond to Airdrop with a message with eventType `EXTRACTION_DATA_ERROR`.
126125

127-
## Attachments extraction
126+
### Attachments extraction
128127

129128
Airdrop initiates the Attachment Extraction by starting the Worker with a message with eventType `EXTRACTION_ATTACHMENTS_START`
130129
when transitioning to the Data Extraction phase.
@@ -146,7 +145,7 @@ Once the Attachment Extraction phase is done, the Worker must respond to Airdrop
146145

147146
If Attachment Extraction failed, the Worker must respond to Airdrop with a message with eventType `EXTRACTION_ATTACHMENTS_ERROR`.
148147

149-
## Delete data
148+
### Data deletion
150149

151150
Airdrop initiates the Data Delete phase when the Sync is deleted from DevRev.
152151
It is started by sending the Worker a message with eventType: `EXTRACTION_DATA_DELETE`.
@@ -156,7 +155,7 @@ In the most common extraction use cases, there is nothing to do and Workers may
156155

157156
The Worker must respond to Airdrop with a message with eventType `EXTRACTION_DATA_DELETE_DONE` when done or `EXTRACTION_DATA_DELETE_ERROR` in case of an error.
158157

159-
## Delete attachments
158+
### Attachments deletion
160159

161160
Airdrop initiates the Attachments Delete phase when the Sync is deleted from DevRev.
162161
It is started by sending the Worker a message with eventType: `EXTRACTION_ATTACHMENTS_DELETE`.

fern/docs/pages/adaas/getting-started.mdx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ See [Creating a Keyring](https://www.notion.so/Creating-a-Keyring-aa497671dc1b42
2121

2222
## Creating keyrings
2323

24-
Keyrings are a DevRev-specific mechanism for managing authentication for External Systems.
25-
They are called Connections in the DevRev app.
24+
Keyrings are a DevRev-specific mechanism for managing authentication to external systems.
25+
They are called **Connections** in the DevRev app.
2626

27-
They provide a secure way to store and manage credentials within your DevRev Snap-In.
27+
Keyrings provide a secure way to store and manage credentials within your DevRev Snap-In.
2828
This eliminates the need to expose sensitive information like passwords
2929
or access tokens directly within your code or configuration files, enhancing overall security.
3030

31-
Read more about Keyrings in the [developer documentation](https://developer.devrev.ai/snapin-development/references/keyrings).
31+
A keyring is used by a worker to authenticate to the external system in API calls. They includes the key (for example,
32+
a PAT token or API key), its type, the organization ID for which a key is valid, and in some cases the organization name.
33+
34+
Read more about keyrings in the [developer documentation](/snapin-development/references/keyrings).
3235

3336

3437
## Observability
@@ -38,4 +41,4 @@ Workers are snap-ins, and they inherit observability methodology from snap-ins.
3841
To observe logs from your Worker in your development environment use `devrev snap_in_package logs | jq`.
3942
To open logs in your favorite editor use `devrev snap_in_package logs | code -`
4043

41-
See also: https://developer.devrev.ai/snapin-development/debugging
44+
See also [debugging snap-in](/snapin-development/debugging).

fern/docs/pages/adaas/overview.mdx

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
# Airdrop-as-a-Service (ADaaS)
22

3-
Airdrop-as-a-Service (ADaaS) as a system consists of the internal Airdrop components and a Worker (Extractor or Loader),
4-
which is a Snap-In with a predefined structure.
5-
These Workers (Extractors and Loaders) can be built by anyone, not just DevRevelers.
6-
7-
This section explains how ADaaS works at a high level.
8-
Message protocols and other specifics can be found in the Extractor and Loader sections.
9-
10-
Airdrop uses its own AWS S3 structure
11-
(and its own buckets) and that only Airdrop components have access to it.
12-
This means that Workers can’t access these buckets directly,
13-
which is why all their data has to be uploaded to DevRev through S3Interact.
14-
15-
For clarity, Artifact API and Airdrop are shown as separate entities,
16-
even though they are both accessed through DevRev’s API.
17-
Worker is shown as external, to clarify that it is developed by third parties,
18-
even though it runs on DevRev’s infrastructure.
19-
20-
```mermaid
21-
---
22-
title: ADaaS architecture high-level overview
23-
---
24-
graph TB
25-
externalSystem[External system]
26-
worker([Worker])
27-
s3interact[s3interact]
28-
airdrop[Airdrop]
29-
s3[(AWS S3)]
30-
31-
externalSystem <-- Get/create users, issues, ... --> worker
32-
33-
worker <-- Exchange artifact upload/download URLs --> s3interact
34-
worker <-- Upload/download artifacts --> s3
35-
worker <-- ADaaS messages and REST API --> airdrop
36-
37-
38-
subgraph DevRev
39-
s3interact <-- Prepare upload/download URL --> s3
40-
airdrop <-- Download/upload artifacts --> s3
41-
end
42-
```
3+
Airdrop is DevRev’s solution to migrate data. It allows our customers to bring in their existing data from
4+
external systems and, data back to external systems, and keep data in sync between DevRev and the external systems.
5+
You can read more about Airdrop in the [general documentation](https://docs.devrev.ai/import#airdrop-features).
6+
7+
Airdrop-as-a-Service (ADaaS) gives snap-in developers the ability to integrate with DevRev’s Airdrop functionality.
8+
It enables developers to create external workers, extractors and loaders to bring data from various external systems.
9+
10+
![ADaaS architecture](../../img/adaas/adaas-architecture.svg)
11+
12+
An extractor is an function in an ADaaS-capable snap-in responsible for extracting data from an external system, such as Jira, Zendesk,
13+
HubSpot, etc. It uses a standardized communication protocol for talking to Airdrop and a standardized
14+
data structure for all the files it extracts and processes, so that they can be seamlessly imported into DevRev.
15+
16+
## Sync runs
17+
18+
Airdrop functions are executed in the context of sync runs, which is a directed operation that spans over many invocations
19+
of ADaaS snap-in to bring the data to DevRev or load the data to the external system.
20+
21+
A forward sync run is a sync from an external system to DevRev. An extractor is used to extract the created and/or
22+
updated data from the external system, such as Jira, Zendesk, HubSpot, etc. to DevRev. An extractor function
23+
in the snap-in is responsible for extracting data from the external system. It uses standardized communication protocol
24+
for talking to [Airdrop](https://docs.devrev.ai/import#airdrop-features) and a standardized data structure for all the files
25+
it extracts and processes, so that they can be transformed, deduplicated and seamlessly imported into DevRev.
26+
27+
A reverse sync run is a sync from DevRev to an external system. It uses a loader function, to create and/or update data
28+
in the external system.
29+
30+
## Sync modes
31+
32+
### Initial import
33+
34+
An initial import is the first import of data from the external system to DevRev.
35+
It is triggered manually by the end user in DevRev's Imports UI.
36+
37+
## 1-way sync
38+
39+
A 1-way sync refers to any extraction after the initial import has been successfully completed.
40+
An extractor extracts data that was created and/or updated in the external system
41+
after the start of the latest successful forward sync, including any changes that occurred during the
42+
forward sync, but were not picked up by it.
43+
44+
A snap-in must consult its state to get information on when the last successful forward sync started. ADaaS snap-ins
45+
must maintain its own state that persists between phases in a sync run, as well as between sync runs.
46+
47+
48+
49+

0 commit comments

Comments
 (0)