Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Prestashop: Migrate connector from Alpha (Python) to Beta (YAML) #18927

Merged
merged 61 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f3ae381
bump 0.2.1
grubberr Nov 3, 2022
337bb50
prestashop.yaml added
grubberr Nov 3, 2022
fe34587
all streams added
grubberr Nov 4, 2022
b12bf9a
bump 0.3.0
grubberr Nov 4, 2022
da45248
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 4, 2022
8c22b76
data_key added
grubberr Nov 4, 2022
5e4f99c
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 4, 2022
dad71fa
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 4, 2022
7aa5cfc
moved primary_key to base_stream
grubberr Nov 4, 2022
cbe04b4
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 5, 2022
2bed075
LimitOffsetPaginator added
grubberr Nov 5, 2022
780e3d4
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 7, 2022
7c965e1
NoSlicer added
grubberr Nov 7, 2022
f16a8bd
stream_cursor_field added
grubberr Nov 7, 2022
5cc8e8c
_filter_params added
grubberr Nov 7, 2022
8f83178
abnormal_state.json added
grubberr Nov 7, 2022
06cd8d0
releaseStage alpha -> beta
grubberr Nov 7, 2022
d8d08dd
migrated acceptance-test-config.yml
grubberr Nov 7, 2022
d0a12f3
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 8, 2022
fa6eb15
presta-shop.md updated
grubberr Nov 8, 2022
f67316c
_validate_and_transform added
grubberr Nov 8, 2022
866e92c
expected_records.txt added
grubberr Nov 8, 2022
730a754
spec change order: "access_key", "url"
grubberr Nov 8, 2022
1452bb6
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 8, 2022
12956a4
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 9, 2022
8e7bfbe
Prestashop -> PrestaShop
grubberr Nov 9, 2022
58eff96
presta-shop.md updated
grubberr Nov 9, 2022
d209d3f
simplify https check
grubberr Nov 9, 2022
bad78f5
timeout_seconds: 300 - removed from spec
grubberr Nov 9, 2022
3ffd091
integration_tests/spec.json -> source_prestashop/spec.yaml
grubberr Nov 9, 2022
8f46497
ConfigException added
grubberr Nov 9, 2022
96f8802
revert back timeout_seconds: 300 for spec
grubberr Nov 9, 2022
f9ce677
revert back exception -> failed
grubberr Nov 9, 2022
59afc13
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 9, 2022
6c56fe5
test_limit_offset_paginator added
grubberr Nov 9, 2022
fc17ca0
test_no_slicer added
grubberr Nov 9, 2022
ace763d
setup.py updated
grubberr Nov 9, 2022
48d37a4
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 10, 2022
95d031d
documentationUrl updated
grubberr Nov 10, 2022
57c3307
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 10, 2022
d74988e
checkpoint_interval: 500 added
grubberr Nov 10, 2022
78e7f55
move checkpoint_interval to incremental
grubberr Nov 10, 2022
710f537
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 11, 2022
9896ad8
switch to DatetimeStreamSlicer
grubberr Nov 11, 2022
28fa4d1
step 10y -> 1y
grubberr Nov 12, 2022
de84b57
start_date: 2020-07-01 -> 2021-05-25
grubberr Nov 12, 2022
c825adf
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 12, 2022
44c1d1b
start_date title added
grubberr Nov 12, 2022
62208f5
presta-shop.md updated
grubberr Nov 12, 2022
33aaa21
switch to DefaultPaginator
grubberr Nov 12, 2022
f5ac515
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 14, 2022
fee0181
use default paginator
grubberr Nov 14, 2022
f46b862
integration_tests/catalog.json removed
grubberr Nov 14, 2022
e836e61
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 14, 2022
73f10bd
disable_for_version: 0.1.0 -> 0.2.0
grubberr Nov 14, 2022
0997f4c
revert me
grubberr Nov 14, 2022
20c5045
Revert "revert me"
grubberr Nov 14, 2022
e4f4a0f
fix bad symbols
grubberr Nov 14, 2022
6f4431e
expected_records.txt fixed
grubberr Nov 14, 2022
cf8ae2b
Merge branch 'master' into grubberr/18710-source-prestashop
grubberr Nov 15, 2022
0392abc
auto-bump connector version
octavia-squidington-iii Nov 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1182,14 +1182,14 @@
documentationUrl: https://docs.airbyte.com/integrations/sources/postmarkapp
sourceType: api
releaseStage: alpha
- name: Prestashop
- name: PrestaShop
sourceDefinitionId: d60a46d4-709f-4092-a6b7-2457f7d455f5
dockerRepository: airbyte/source-prestashop
dockerImageTag: 0.2.0
dockerImageTag: 0.3.0
documentationUrl: https://docs.airbyte.com/integrations/sources/presta-shop
icon: prestashop.svg
sourceType: api
releaseStage: alpha
releaseStage: beta
- name: Primetric
sourceDefinitionId: f636c3c6-4077-45ac-b109-19fc62a283c1
dockerRepository: airbyte/source-primetric
Expand Down
25 changes: 19 additions & 6 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11273,25 +11273,38 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-prestashop:0.2.0"
- dockerImage: "airbyte/source-prestashop:0.3.0"
spec:
documentationUrl: "https://docsurl.com"
documentationUrl: "https://docs.airbyte.com/integrations/sources/presta-shop"
connectionSpecification:
$schema: "http://json-schema.org/draft-07/schema#"
title: "PrestaShop Spec"
type: "object"
required:
- "url"
- "access_key"
- "url"
- "start_date"
properties:
url:
type: "string"
description: "Shop URL without trailing slash (domain name or IP address)"
access_key:
type: "string"
title: "Access Key"
description: "Your PrestaShop access key. See <a href=\"https://devdocs.prestashop.com/1.7/webservice/tutorials/creating-access/#create-an-access-key\"\
> the docs </a> for info on how to obtain this."
order: 0
airbyte_secret: true
url:
type: "string"
title: "Shop URL"
description: "Shop URL without trailing slash."
order: 1
start_date:
type: "string"
title: "Start date"
description: "The Start date in the format YYYY-MM-DD."
pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
examples:
- "2022-01-01"
order: 2
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.0
LABEL io.airbyte.version=0.3.0
LABEL io.airbyte.name=airbyte/source-prestashop
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-prestashop:dev
tests:
acceptance_tests:
spec:
- spec_path: "source_prestashop/spec.json"
# unfortunately timeout plugin takes into account setup code as well (docker setup)
timeout_seconds: 300
tests:
- spec_path: "source_prestashop/spec.yaml"
# unfortunately timeout plugin takes into account setup code as well (docker setup)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by docker setup? build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in really from previous developer
good catch I just removed it
it seems we don't need it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted back, we need it while docker containers with PrestaShop will up

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's so special about this connector so it takes 5 minutes to go up? this is not a common issue, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. spec test starts with timer = 0
  2. fixture connector_setup runs docker containers
  3. spec tests try to validate spec but 10 seconds already passed because of (2)

timeout_seconds: 300
backward_compatibility_tests_config:
disable_for_version: "0.2.0"
connection:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
tests:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
tests:
- config_path: "secrets/config.json"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
expect_records:
path: "integration_tests/expected_records.txt"
extra_fields: no
exact_order: no
extra_records: yes
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
future_state_path: "integration_tests/future_state.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
future_state:
future_state_path: "integration_tests/abnormal_state.json"
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
[
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "addresses"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "cart_rules"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "carts"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "categories"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "configurations"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "customer_messages"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "customers"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "customer_threads"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "groups"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "manufacturers"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "messages"
},
"stream_state": {
"date_add": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "order_carriers"
},
"stream_state": {
"date_add": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "order_histories"
},
"stream_state": {
"date_add": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "order_invoices"
},
"stream_state": {
"date_add": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "order_payments"
},
"stream_state": {
"date_add": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "orders"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "order_slip"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "products"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "stock_movement_reasons"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "stock_movements"
},
"stream_state": {
"date_add": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "stores"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "suppliers"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
},
{
"type": "STREAM",
"stream": {
"stream_descriptor": {
"name": "tax_rule_groups"
},
"stream_state": {
"date_upd": "2121-06-16 14:13:26"
}
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ def create_config_fixture():
secrets_path.mkdir(exist_ok=True)
config_filename = str(secrets_path / "config.json")

config = {"url": "http://localhost:8080", "access_key": "59662QEPFNCJ3KFL3VCT5VNQ4NHVUF4Y", "_allow_http": True}
config = {
"url": "http://localhost:8080",
"_allow_http": True,
"access_key": "59662QEPFNCJ3KFL3VCT5VNQ4NHVUF4Y",
"start_date": "2021-05-25",
}

with open(config_filename, "w+") as fp:
json.dump(obj=config, fp=fp)
Expand Down
Loading