Skip to content

Commit 0523afd

Browse files
Extract migration to separate page
1 parent 3b13e23 commit 0523afd

File tree

3 files changed

+117
-119
lines changed

3 files changed

+117
-119
lines changed

docs/more/development/integration-questions/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ There are two ways of how we can connect |project_name| to these services:
2121
:maxdepth: 1
2222

2323
API<integration-api>
24+
Migration<migration>
2425
Widget<integration-widget>

docs/more/development/integration-questions/integration-api.rst

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -106,125 +106,6 @@ Advance Response Configuration
106106

107107
The Advance response configuration allows to set **Response Item Template for Selection** which can be used to define how the selection of items from the integration will be presented before selection.
108108

109-
110-
Migration from Legacy API Integration
111-
*************************************
112-
113-
To migrate a knowledge model from API Integration Legacy to API Integration v2, we need to recreate the integration and connect it to the respective questions. To do that, open the knowledge model Editor. There, navigate to the existing integrations. The best practice is to create the integration from scratch. You can follow this :ref:`configuration guide<integration-api-configuration>`.
114-
115-
We recommend recreating the integration to keep the original one as a reference. This allows you to copy the configuration from it and identify which questions are using the legacy integration so you can connect them to the new one.
116-
117-
Once the new API Integration v2 instances are successfully created and the integration questions are connected to them, you can delete the old integrations and release the knowledge model. Then you can migrate projects.
118-
119-
.. NOTE::
120-
121-
If you somehow manage to lose the content of the integrations before they are recreated, you can always create a new knowledge model editor.
122-
123-
During the migration from API Integration Legacy to API Integration v2, the existing integration replies in projects are migrated automatically. However, there are differences in how the data is stored. The following sections describe how the data is handled in each state:
124-
- Legacy API Integration
125-
- Migrated to API Integration v2 (legacy data)
126-
- New API Integration v2 with “raw = HTTP response”
127-
128-
**State A — Legacy API Integration (ApiLegacyIntegration)**
129-
130-
This is how API Integration Legacy stores the data.
131-
132-
**What is stored:**
133-
134-
``IntegrationReply.value`` contains:
135-
136-
- an ``id`` (the selected item identifier)
137-
- a ``type``: ``IntegrationLegacyType``
138-
- a ``value`` (the rendered markdown or text displayed in the UI)
139-
140-
.. code:: json
141-
142-
{
143-
"type": "IntegrationReply",
144-
"value": {
145-
"id": "0000-0003-3856-1682",
146-
"type": "IntegrationLegacyType",
147-
"value": "**Kryštof** **Komanec** \nORCID: **0000-0003-3856-1682** \n\n\n*Czech Technical University in Prague* \n*Prague University of Economics and Business* \n "
148-
}
149-
}
150-
151-
152-
**State B — Migrated to API Integration v2 (existing data)**
153-
154-
After migrating to API Integration v2, the existing data is stored differently.
155-
156-
**What changes compared to Legacy:**
157-
158-
- ``id`` is **removed**
159-
- ``raw`` is introduced but remains empty: ``"raw": {}``
160-
- ``type`` becomes ``IntegrationType`` instead of ``IntegrationLegacyType``
161-
- ``value`` remains the same (the markdown reply rendered in the UI)
162-
163-
.. code:: json
164-
165-
{
166-
"type": "IntegrationReply",
167-
"value": {
168-
"raw": {},
169-
"type": "IntegrationType",
170-
"value": "**Kryštof** **Komanec** \nORCID: **0000-0003-3856-1682** \n\n\n*Czech Technical University in Prague* \n*Prague University of Economics and Business* \n "
171-
}
172-
}
173-
174-
175-
**State C — New API Integration v2 with IntegrationType reply**
176-
177-
If you delete the old answer and provide a new one, or if you answer a new integration question using API Integration v2, the data is stored differently. The semantics of the stored data also change. The ``raw`` field now contains the raw HTTP response from the API, which can be used in the answer template.
178-
179-
**What is stored:**
180-
181-
- ``raw`` = the actual integration HTTP response item or body, which serves as the source of truth
182-
- ``type`` = ``IntegrationType``
183-
- ``value`` = custom text entered by the user or rendered template output, generated from the ``raw`` data using the answer template
184-
185-
.. code:: json
186-
187-
{
188-
"type": "IntegrationReply",
189-
"value": {
190-
"raw": {
191-
"credit-name": null,
192-
"email": [],
193-
"family-names": "Komanec",
194-
"given-names": "Kryštof",
195-
"institution-name": [
196-
"Czech Technical University in Prague",
197-
"Prague University of Economics and Business"
198-
],
199-
"orcid-id": "0000-0003-3856-1682",
200-
"other-name": []
201-
},
202-
"type": "IntegrationType",
203-
"value": "**Kryštof** **Komanec** \nORCID: [**0000-0003-3856-1682**](https://orcid.org/0000-0003-3856-1682)\n\n"
204-
}
205-
}
206-
207-
208-
**State D - New API Integration v2 with PlainType reply**
209-
210-
If custom reply is enabled in the integration configuration, the answer to an integration question can also be a plain text. In that case, the data is stored as follows.
211-
212-
**What is stored:**
213-
214-
- ``type`` = ``PlainType``
215-
- ``value`` = the plain text answer provided by the user.
216-
217-
.. code:: json
218-
219-
{
220-
"type": "IntegrationReply",
221-
"value": {
222-
"type": "PlainType",
223-
"value": "https://orcid.org/0000-0003-3856-1682"
224-
}
225-
}
226-
227-
228109
Integration Question - API (Legacy)
229110
***********************************
230111

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
.. _integration-migration:
2+
3+
Migration from Legacy API Integration
4+
*************************************
5+
6+
To migrate a knowledge model from API Integration Legacy to API Integration v2, we need to recreate the integration and connect it to the respective questions. To do that, open the knowledge model Editor. There, navigate to the existing integrations. The best practice is to create the integration from scratch. You can follow this :ref:`configuration guide<integration-api-configuration>`.
7+
8+
We recommend recreating the integration to keep the original one as a reference. This allows you to copy the configuration from it and identify which questions are using the legacy integration so you can connect them to the new one.
9+
10+
Once the new API Integration v2 instances are successfully created and the integration questions are connected to them, you can delete the old integrations and release the knowledge model. Then you can migrate projects.
11+
12+
.. NOTE::
13+
14+
If you somehow manage to lose the content of the integrations before they are recreated, you can always create a new knowledge model editor.
15+
16+
During the migration from API Integration Legacy to API Integration v2, the existing integration replies in projects are migrated automatically. However, there are differences in how the data is stored. The following sections describe how the data is handled in each state:
17+
- Legacy API Integration
18+
- Migrated to API Integration v2 (legacy data)
19+
- New API Integration v2 with “raw = HTTP response”
20+
21+
**State A — Legacy API Integration (ApiLegacyIntegration)**
22+
23+
This is how API Integration Legacy stores the data.
24+
25+
**What is stored:**
26+
27+
- an ``id`` (the selected item identifier)
28+
- a ``type``: ``IntegrationLegacyType``
29+
- a ``value`` (the rendered markdown or text displayed in the UI)
30+
31+
.. code:: json
32+
33+
{
34+
"type": "IntegrationReply",
35+
"value": {
36+
"id": "0000-0003-3856-1682",
37+
"type": "IntegrationLegacyType",
38+
"value": "**Kryštof** **Komanec** \nORCID: **0000-0003-3856-1682** \n\n\n*Czech Technical University in Prague* \n*Prague University of Economics and Business* \n "
39+
}
40+
}
41+
42+
43+
**State B — Migrated to API Integration v2 (existing data)**
44+
45+
After migrating to API Integration v2, the existing data is stored differently.
46+
47+
**What changes compared to Legacy:**
48+
49+
- ``id`` is **removed**
50+
- ``raw`` is introduced but remains empty: ``"raw": {}``
51+
- ``type`` becomes ``IntegrationType`` instead of ``IntegrationLegacyType``
52+
- ``value`` remains the same (the markdown reply rendered in the UI)
53+
54+
.. code:: json
55+
56+
{
57+
"type": "IntegrationReply",
58+
"value": {
59+
"raw": {},
60+
"type": "IntegrationType",
61+
"value": "**Kryštof** **Komanec** \nORCID: **0000-0003-3856-1682** \n\n\n*Czech Technical University in Prague* \n*Prague University of Economics and Business* \n "
62+
}
63+
}
64+
65+
66+
**State C — New API Integration v2 with IntegrationType reply**
67+
68+
If you delete the old answer and provide a new one, or if you answer a new integration question using API Integration v2, the data is stored differently. The semantics of the stored data also change. The ``raw`` field now contains the raw HTTP response from the API, which can be used in the answer template.
69+
70+
**What is stored:**
71+
72+
- ``raw`` = the actual integration HTTP response item or body, which serves as the source of truth
73+
- ``type`` = ``IntegrationType``
74+
- ``value`` = custom text entered by the user or rendered template output, generated from the ``raw`` data using the answer template
75+
76+
.. code:: json
77+
78+
{
79+
"type": "IntegrationReply",
80+
"value": {
81+
"raw": {
82+
"credit-name": null,
83+
"email": [],
84+
"family-names": "Komanec",
85+
"given-names": "Kryštof",
86+
"institution-name": [
87+
"Czech Technical University in Prague",
88+
"Prague University of Economics and Business"
89+
],
90+
"orcid-id": "0000-0003-3856-1682",
91+
"other-name": []
92+
},
93+
"type": "IntegrationType",
94+
"value": "**Kryštof** **Komanec** \nORCID: [**0000-0003-3856-1682**](https://orcid.org/0000-0003-3856-1682)\n\n"
95+
}
96+
}
97+
98+
99+
**State D - New API Integration v2 with PlainType reply**
100+
101+
If custom reply is enabled in the integration configuration, the answer to an integration question can also be a plain text. In that case, the data is stored as follows.
102+
103+
**What is stored:**
104+
105+
- ``type`` = ``PlainType``
106+
- ``value`` = the plain text answer provided by the user.
107+
108+
.. code:: json
109+
110+
{
111+
"type": "IntegrationReply",
112+
"value": {
113+
"type": "PlainType",
114+
"value": "https://orcid.org/0000-0003-3856-1682"
115+
}
116+
}

0 commit comments

Comments
 (0)