Skip to content

Commit a3e83c3

Browse files
authored
Source Prestashop: Migrate connector from Alpha (Python) to Beta (YAML) (#18927)
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
1 parent 33575df commit a3e83c3

File tree

18 files changed

+1050
-425
lines changed

18 files changed

+1050
-425
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,14 +1182,14 @@
11821182
documentationUrl: https://docs.airbyte.com/integrations/sources/postmarkapp
11831183
sourceType: api
11841184
releaseStage: alpha
1185-
- name: Prestashop
1185+
- name: PrestaShop
11861186
sourceDefinitionId: d60a46d4-709f-4092-a6b7-2457f7d455f5
11871187
dockerRepository: airbyte/source-prestashop
1188-
dockerImageTag: 0.2.0
1188+
dockerImageTag: 0.3.0
11891189
documentationUrl: https://docs.airbyte.com/integrations/sources/presta-shop
11901190
icon: prestashop.svg
11911191
sourceType: api
1192-
releaseStage: alpha
1192+
releaseStage: beta
11931193
- name: Primetric
11941194
sourceDefinitionId: f636c3c6-4077-45ac-b109-19fc62a283c1
11951195
dockerRepository: airbyte/source-primetric

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11273,25 +11273,38 @@
1127311273
supportsNormalization: false
1127411274
supportsDBT: false
1127511275
supported_destination_sync_modes: []
11276-
- dockerImage: "airbyte/source-prestashop:0.2.0"
11276+
- dockerImage: "airbyte/source-prestashop:0.3.0"
1127711277
spec:
11278-
documentationUrl: "https://docsurl.com"
11278+
documentationUrl: "https://docs.airbyte.com/integrations/sources/presta-shop"
1127911279
connectionSpecification:
1128011280
$schema: "http://json-schema.org/draft-07/schema#"
1128111281
title: "PrestaShop Spec"
1128211282
type: "object"
1128311283
required:
11284-
- "url"
1128511284
- "access_key"
11285+
- "url"
11286+
- "start_date"
1128611287
properties:
11287-
url:
11288-
type: "string"
11289-
description: "Shop URL without trailing slash (domain name or IP address)"
1129011288
access_key:
1129111289
type: "string"
11290+
title: "Access Key"
1129211291
description: "Your PrestaShop access key. See <a href=\"https://devdocs.prestashop.com/1.7/webservice/tutorials/creating-access/#create-an-access-key\"\
1129311292
> the docs </a> for info on how to obtain this."
11293+
order: 0
1129411294
airbyte_secret: true
11295+
url:
11296+
type: "string"
11297+
title: "Shop URL"
11298+
description: "Shop URL without trailing slash."
11299+
order: 1
11300+
start_date:
11301+
type: "string"
11302+
title: "Start date"
11303+
description: "The Start date in the format YYYY-MM-DD."
11304+
pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
11305+
examples:
11306+
- "2022-01-01"
11307+
order: 2
1129511308
supportsNormalization: false
1129611309
supportsDBT: false
1129711310
supported_destination_sync_modes: []

airbyte-integrations/connectors/source-prestashop/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ RUN pip install .
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=0.2.0
15+
LABEL io.airbyte.version=0.3.0
1616
LABEL io.airbyte.name=airbyte/source-prestashop
Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
22
# for more information about how to configure these tests
33
connector_image: airbyte/source-prestashop:dev
4-
tests:
4+
acceptance_tests:
55
spec:
6-
- spec_path: "source_prestashop/spec.json"
7-
# unfortunately timeout plugin takes into account setup code as well (docker setup)
8-
timeout_seconds: 300
6+
tests:
7+
- spec_path: "source_prestashop/spec.yaml"
8+
# unfortunately timeout plugin takes into account setup code as well (docker setup)
9+
timeout_seconds: 300
10+
backward_compatibility_tests_config:
11+
disable_for_version: "0.2.0"
912
connection:
10-
- config_path: "secrets/config.json"
11-
status: "succeed"
12-
- config_path: "integration_tests/invalid_config.json"
13-
status: "failed"
13+
tests:
14+
- config_path: "secrets/config.json"
15+
status: "succeed"
16+
- config_path: "integration_tests/invalid_config.json"
17+
status: "failed"
1418
discovery:
15-
- config_path: "secrets/config.json"
19+
tests:
20+
- config_path: "secrets/config.json"
1621
basic_read:
17-
- config_path: "secrets/config.json"
18-
configured_catalog_path: "integration_tests/configured_catalog.json"
22+
tests:
23+
- config_path: "secrets/config.json"
24+
configured_catalog_path: "integration_tests/configured_catalog.json"
25+
expect_records:
26+
path: "integration_tests/expected_records.txt"
27+
extra_fields: no
28+
exact_order: no
29+
extra_records: yes
1930
incremental:
20-
- config_path: "secrets/config.json"
21-
configured_catalog_path: "integration_tests/configured_catalog.json"
22-
future_state_path: "integration_tests/future_state.json"
31+
tests:
32+
- config_path: "secrets/config.json"
33+
configured_catalog_path: "integration_tests/configured_catalog.json"
34+
future_state:
35+
future_state_path: "integration_tests/abnormal_state.json"
2336
full_refresh:
24-
- config_path: "secrets/config.json"
25-
configured_catalog_path: "integration_tests/configured_catalog.json"
37+
tests:
38+
- config_path: "secrets/config.json"
39+
configured_catalog_path: "integration_tests/configured_catalog.json"
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
[
2+
{
3+
"type": "STREAM",
4+
"stream": {
5+
"stream_descriptor": {
6+
"name": "addresses"
7+
},
8+
"stream_state": {
9+
"date_upd": "2121-06-16 14:13:26"
10+
}
11+
}
12+
},
13+
{
14+
"type": "STREAM",
15+
"stream": {
16+
"stream_descriptor": {
17+
"name": "cart_rules"
18+
},
19+
"stream_state": {
20+
"date_upd": "2121-06-16 14:13:26"
21+
}
22+
}
23+
},
24+
{
25+
"type": "STREAM",
26+
"stream": {
27+
"stream_descriptor": {
28+
"name": "carts"
29+
},
30+
"stream_state": {
31+
"date_upd": "2121-06-16 14:13:26"
32+
}
33+
}
34+
},
35+
{
36+
"type": "STREAM",
37+
"stream": {
38+
"stream_descriptor": {
39+
"name": "categories"
40+
},
41+
"stream_state": {
42+
"date_upd": "2121-06-16 14:13:26"
43+
}
44+
}
45+
},
46+
{
47+
"type": "STREAM",
48+
"stream": {
49+
"stream_descriptor": {
50+
"name": "configurations"
51+
},
52+
"stream_state": {
53+
"date_upd": "2121-06-16 14:13:26"
54+
}
55+
}
56+
},
57+
{
58+
"type": "STREAM",
59+
"stream": {
60+
"stream_descriptor": {
61+
"name": "customer_messages"
62+
},
63+
"stream_state": {
64+
"date_upd": "2121-06-16 14:13:26"
65+
}
66+
}
67+
},
68+
{
69+
"type": "STREAM",
70+
"stream": {
71+
"stream_descriptor": {
72+
"name": "customers"
73+
},
74+
"stream_state": {
75+
"date_upd": "2121-06-16 14:13:26"
76+
}
77+
}
78+
},
79+
{
80+
"type": "STREAM",
81+
"stream": {
82+
"stream_descriptor": {
83+
"name": "customer_threads"
84+
},
85+
"stream_state": {
86+
"date_upd": "2121-06-16 14:13:26"
87+
}
88+
}
89+
},
90+
{
91+
"type": "STREAM",
92+
"stream": {
93+
"stream_descriptor": {
94+
"name": "groups"
95+
},
96+
"stream_state": {
97+
"date_upd": "2121-06-16 14:13:26"
98+
}
99+
}
100+
},
101+
{
102+
"type": "STREAM",
103+
"stream": {
104+
"stream_descriptor": {
105+
"name": "manufacturers"
106+
},
107+
"stream_state": {
108+
"date_upd": "2121-06-16 14:13:26"
109+
}
110+
}
111+
},
112+
{
113+
"type": "STREAM",
114+
"stream": {
115+
"stream_descriptor": {
116+
"name": "messages"
117+
},
118+
"stream_state": {
119+
"date_add": "2121-06-16 14:13:26"
120+
}
121+
}
122+
},
123+
{
124+
"type": "STREAM",
125+
"stream": {
126+
"stream_descriptor": {
127+
"name": "order_carriers"
128+
},
129+
"stream_state": {
130+
"date_add": "2121-06-16 14:13:26"
131+
}
132+
}
133+
},
134+
{
135+
"type": "STREAM",
136+
"stream": {
137+
"stream_descriptor": {
138+
"name": "order_histories"
139+
},
140+
"stream_state": {
141+
"date_add": "2121-06-16 14:13:26"
142+
}
143+
}
144+
},
145+
{
146+
"type": "STREAM",
147+
"stream": {
148+
"stream_descriptor": {
149+
"name": "order_invoices"
150+
},
151+
"stream_state": {
152+
"date_add": "2121-06-16 14:13:26"
153+
}
154+
}
155+
},
156+
{
157+
"type": "STREAM",
158+
"stream": {
159+
"stream_descriptor": {
160+
"name": "order_payments"
161+
},
162+
"stream_state": {
163+
"date_add": "2121-06-16 14:13:26"
164+
}
165+
}
166+
},
167+
{
168+
"type": "STREAM",
169+
"stream": {
170+
"stream_descriptor": {
171+
"name": "orders"
172+
},
173+
"stream_state": {
174+
"date_upd": "2121-06-16 14:13:26"
175+
}
176+
}
177+
},
178+
{
179+
"type": "STREAM",
180+
"stream": {
181+
"stream_descriptor": {
182+
"name": "order_slip"
183+
},
184+
"stream_state": {
185+
"date_upd": "2121-06-16 14:13:26"
186+
}
187+
}
188+
},
189+
{
190+
"type": "STREAM",
191+
"stream": {
192+
"stream_descriptor": {
193+
"name": "products"
194+
},
195+
"stream_state": {
196+
"date_upd": "2121-06-16 14:13:26"
197+
}
198+
}
199+
},
200+
{
201+
"type": "STREAM",
202+
"stream": {
203+
"stream_descriptor": {
204+
"name": "stock_movement_reasons"
205+
},
206+
"stream_state": {
207+
"date_upd": "2121-06-16 14:13:26"
208+
}
209+
}
210+
},
211+
{
212+
"type": "STREAM",
213+
"stream": {
214+
"stream_descriptor": {
215+
"name": "stock_movements"
216+
},
217+
"stream_state": {
218+
"date_add": "2121-06-16 14:13:26"
219+
}
220+
}
221+
},
222+
{
223+
"type": "STREAM",
224+
"stream": {
225+
"stream_descriptor": {
226+
"name": "stores"
227+
},
228+
"stream_state": {
229+
"date_upd": "2121-06-16 14:13:26"
230+
}
231+
}
232+
},
233+
{
234+
"type": "STREAM",
235+
"stream": {
236+
"stream_descriptor": {
237+
"name": "suppliers"
238+
},
239+
"stream_state": {
240+
"date_upd": "2121-06-16 14:13:26"
241+
}
242+
}
243+
},
244+
{
245+
"type": "STREAM",
246+
"stream": {
247+
"stream_descriptor": {
248+
"name": "tax_rule_groups"
249+
},
250+
"stream_state": {
251+
"date_upd": "2121-06-16 14:13:26"
252+
}
253+
}
254+
}
255+
]

airbyte-integrations/connectors/source-prestashop/integration_tests/acceptance.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def create_config_fixture():
2121
secrets_path.mkdir(exist_ok=True)
2222
config_filename = str(secrets_path / "config.json")
2323

24-
config = {"url": "http://localhost:8080", "access_key": "59662QEPFNCJ3KFL3VCT5VNQ4NHVUF4Y", "_allow_http": True}
24+
config = {
25+
"url": "http://localhost:8080",
26+
"_allow_http": True,
27+
"access_key": "59662QEPFNCJ3KFL3VCT5VNQ4NHVUF4Y",
28+
"start_date": "2021-05-25",
29+
}
2530

2631
with open(config_filename, "w+") as fp:
2732
json.dump(obj=config, fp=fp)

0 commit comments

Comments
 (0)