Skip to content

Commit 29de4db

Browse files
set primary keys back, testing showed non unique ids
1 parent 34308a5 commit 29de4db

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

tap_circle_ci/streams/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Context(CollaborationMixin, FullTableStream):
1818

1919
stream = "context"
2020
tap_stream_id = "context"
21-
key_properties = ["id"]
21+
key_properties = ["id", "organization_id"]
2222
url_endpoint = "https://circleci.com/api/v2/context?owner-id={organization_id}&owner-type=organization"
2323
project = None
2424
parent_stream = "collaborations"

tap_circle_ci/streams/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Deploy(CollaborationMixin, IncrementalStream):
1818

1919
stream = "deploy"
2020
tap_stream_id = "deploy"
21-
key_properties = ["id"]
21+
key_properties = ["id", "organization_id"]
2222
replication_key = "updated_at"
2323
valid_replication_keys = ["updated_at"]
2424
url_endpoint = "https://circleci.com/api/v2/deploy/environments?org-id={organization_id}&page-size={page_size}"

tap_circle_ci/streams/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Jobs(FullTableStream):
2222

2323
stream = "jobs"
2424
tap_stream_id = "jobs"
25-
key_properties = ["id"]
25+
key_properties = ["id", "_workflow_id"]
2626
url_endpoint = "https://circleci.com/api/v2/workflow/WORKFLOW_ID/job"
2727
project = None
2828

tap_circle_ci/streams/pipeline_definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PipelineDefinition(FullTableStream):
1818

1919
stream = "pipeline_definition"
2020
tap_stream_id = "pipeline_definition"
21-
key_properties = ["id"]
21+
key_properties = ["id", "project_id", "organization_id"]
2222
url_endpoint = "https://circleci.com/api/v2/projects/{project_id}/pipeline-definitions"
2323
parent_stream = "project"
2424
requires_project = False

tap_circle_ci/streams/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Project(CollaborationMixin, FullTableStream):
1717

1818
stream = "project"
1919
tap_stream_id = "project"
20-
key_properties = ["id"]
20+
key_properties = ["id", "organization_id"]
2121
url_endpoint = "https://circleci.com/api/private/project?organization-id={organization_id}"
2222
parent_stream = "collaborations"
2323
requires_project = False

tap_circle_ci/streams/trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Trigger(FullTableStream):
1818

1919
stream = "trigger"
2020
tap_stream_id = "trigger"
21-
key_properties = ["id"]
21+
key_properties = ["id", "project_id", "pipeline_definition_id"]
2222
parent_stream = "pipeline_definition"
2323
requires_project = False
2424

tests/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ def expected_metadata(self):
6565
self.OBEYS_START_DATE: True,
6666
},
6767
"jobs": {
68-
self.PRIMARY_KEYS: {"id"},
68+
self.PRIMARY_KEYS: {"id", "_workflow_id"},
6969
self.REPLICATION_METHOD: self.FULL_TABLE,
7070
self.OBEYS_START_DATE: False,
7171
},
7272
"context": {
73-
self.PRIMARY_KEYS: {"id"},
73+
self.PRIMARY_KEYS: {"id", "organization_id"},
7474
self.REPLICATION_METHOD: self.FULL_TABLE,
7575
self.OBEYS_START_DATE: False,
7676
self.PARENT_TAP_STREAM_ID: "collaborations",
7777
},
7878
"deploy": {
79-
self.PRIMARY_KEYS: {"id"},
79+
self.PRIMARY_KEYS: {"id", "organization_id"},
8080
self.REPLICATION_METHOD: self.INCREMENTAL,
8181
self.REPLICATION_KEYS: {"updated_at"},
8282
self.OBEYS_START_DATE: True,
@@ -89,13 +89,13 @@ def expected_metadata(self):
8989
self.PARENT_TAP_STREAM_ID: "collaborations",
9090
},
9191
"pipeline_definition": {
92-
self.PRIMARY_KEYS: {"id"},
92+
self.PRIMARY_KEYS: {"id", "project_id", "organization_id"},
9393
self.REPLICATION_METHOD: self.FULL_TABLE,
9494
self.OBEYS_START_DATE: False,
9595
self.PARENT_TAP_STREAM_ID: "project",
9696
},
9797
"project": {
98-
self.PRIMARY_KEYS: {"id"},
98+
self.PRIMARY_KEYS: {"id", "organization_id"},
9999
self.REPLICATION_METHOD: self.FULL_TABLE,
100100
self.OBEYS_START_DATE: False,
101101
self.PARENT_TAP_STREAM_ID: "collaborations",
@@ -108,7 +108,7 @@ def expected_metadata(self):
108108
self.PARENT_TAP_STREAM_ID: "project",
109109
},
110110
"trigger": {
111-
self.PRIMARY_KEYS: {"id"},
111+
self.PRIMARY_KEYS: {"id", "project_id", "pipeline_definition_id"},
112112
self.REPLICATION_METHOD: self.FULL_TABLE,
113113
self.OBEYS_START_DATE: False,
114114
self.PARENT_TAP_STREAM_ID: "pipeline_definition",

0 commit comments

Comments
 (0)