Skip to content

Commit

Permalink
Merge branch 'master' into harshith/test-pr-10529
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmullapudi committed Mar 3, 2022
2 parents 1500374 + 7e4e407 commit 4f92246
Show file tree
Hide file tree
Showing 79 changed files with 1,291 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.35.43-alpha
current_version = 0.35.45-alpha
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-[a-z]+)?
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


### SHARED ###
VERSION=0.35.43-alpha
VERSION=0.35.45-alpha

# When using the airbyte-db via default docker image
CONFIG_ROOT=/data
Expand Down
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Frontend code
/airbyte-webapp/ @airbytehq/frontend
/airbyte-webapp-e2e-tests/ @airbytehq/frontend
/airbyte-webapp/ @airbytehq/frontend
## Exclude the package(-lock).json from code ownership to prevent version bump PRs from triggering codeowners review
/airbyte-webapp/package.json
/airbyte-webapp/package-lock.json
4 changes: 2 additions & 2 deletions airbyte-bootloader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ ENV APPLICATION airbyte-bootloader

WORKDIR /app

ADD bin/${APPLICATION}-0.35.43-alpha.tar /app
ADD bin/${APPLICATION}-0.35.45-alpha.tar /app

ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.35.43-alpha/bin/${APPLICATION}"]
ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.35.45-alpha/bin/${APPLICATION}"]
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@
- name: Chargebee
sourceDefinitionId: 686473f1-76d9-4994-9cc7-9b13da46147c
dockerRepository: airbyte/source-chargebee
dockerImageTag: 0.1.9
dockerImageTag: 0.1.10
documentationUrl: https://docs.airbyte.io/integrations/sources/chargebee
icon: chargebee.svg
sourceType: api
- name: Chartmogul
sourceDefinitionId: b6604cbd-1b12-4c08-8767-e140d0fb0877
dockerRepository: airbyte/source-chartmogul
dockerImageTag: 0.1.0
dockerImageTag: 0.1.1
documentationUrl: https://docs.airbyte.io/integrations/sources/chartmogul
icon: chartmogul.svg
sourceType: api
Expand Down
17 changes: 15 additions & 2 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-chargebee:0.1.9"
- dockerImage: "airbyte/source-chargebee:0.1.10"
spec:
documentationUrl: "https://apidocs.chargebee.com/docs/api"
connectionSpecification:
Expand Down Expand Up @@ -1000,7 +1000,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-chartmogul:0.1.0"
- dockerImage: "airbyte/source-chartmogul:0.1.1"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/chartmogul"
connectionSpecification:
Expand All @@ -1009,6 +1009,8 @@
type: "object"
required:
- "api_key"
- "start_date"
- "interval"
additionalProperties: false
properties:
api_key:
Expand All @@ -1024,6 +1026,17 @@
examples:
- "2017-01-25T00:00:00Z"
order: 1
interval:
type: "string"
description: "Some APIs such as <a href=\"https://dev.chartmogul.com/reference/endpoint-overview-metrics-api\"\
>Metrics</a> require intervals to cluster data."
enum:
- "day"
- "week"
- "month"
- "quarter"
default: "month"
order: 2
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ public interface Configs {
*/
int getSyncJobMaxTimeoutDays();

/**
* Defines whether job creation uses connector-specific resource requirements when spawning jobs.
* Works on both Docker and Kubernetes. Defaults to false for ease of use in OSS trials of Airbyte
* but recommended for production deployments.
*/
boolean connectorSpecificResourceDefaultsEnabled();

/**
* Define the job container's minimum CPU usage. Units follow either Docker or Kubernetes, depending
* on the deployment. Defaults to none.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class EnvConfigs implements Configs {
public static final String JOB_KUBE_CURL_IMAGE = "JOB_KUBE_CURL_IMAGE";
public static final String SYNC_JOB_MAX_ATTEMPTS = "SYNC_JOB_MAX_ATTEMPTS";
public static final String SYNC_JOB_MAX_TIMEOUT_DAYS = "SYNC_JOB_MAX_TIMEOUT_DAYS";
private static final String CONNECTOR_SPECIFIC_RESOURCE_DEFAULTS_ENABLED = "CONNECTOR_SPECIFIC_RESOURCE_DEFAULTS_ENABLED";
private static final String MINIMUM_WORKSPACE_RETENTION_DAYS = "MINIMUM_WORKSPACE_RETENTION_DAYS";
private static final String MAXIMUM_WORKSPACE_RETENTION_DAYS = "MAXIMUM_WORKSPACE_RETENTION_DAYS";
private static final String MAXIMUM_WORKSPACE_SIZE_MB = "MAXIMUM_WORKSPACE_SIZE_MB";
Expand Down Expand Up @@ -419,6 +420,11 @@ public int getSyncJobMaxTimeoutDays() {
return Integer.parseInt(getEnvOrDefault(SYNC_JOB_MAX_TIMEOUT_DAYS, "3"));
}

@Override
public boolean connectorSpecificResourceDefaultsEnabled() {
return getEnvOrDefault(CONNECTOR_SPECIFIC_RESOURCE_DEFAULTS_ENABLED, false);
}

/**
* Returns worker pod tolerations parsed from its own environment variable. The value of the env is
* a string that represents one or more tolerations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Slf4j
@Tag("logger-client")
public class GcsLogsTest {

Expand All @@ -34,14 +36,15 @@ private static Storage getClientFactory() {
*/
@Test
public void testRetrieveAllLogs() throws IOException {
final File data = GcsLogs.getFile(getClientFactory(), (new EnvConfigs()).getLogConfigs(), "paginate", 6);

final File data;
data = GcsLogs.getFile(getClientFactory(), (new EnvConfigs()).getLogConfigs(), "paginate", 6);
final var retrieved = new ArrayList<String>();
Files.lines(data.toPath()).forEach(retrieved::add);

final var expected = List.of("Line 0", "Line 1", "Line 2", "Line 3", "Line 4", "Line 5", "Line 6", "Line 7", "Line 8");

assertEquals(expected, retrieved);

}

/**
Expand Down
6 changes: 3 additions & 3 deletions airbyte-container-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ RUN echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] htt
RUN apt-get update && apt-get install -y kubectl

ENV APPLICATION airbyte-container-orchestrator
ENV AIRBYTE_ENTRYPOINT "/app/${APPLICATION}-0.35.43-alpha/bin/${APPLICATION}"
ENV AIRBYTE_ENTRYPOINT "/app/${APPLICATION}-0.35.45-alpha/bin/${APPLICATION}"

WORKDIR /app

# Move orchestrator app
ADD bin/${APPLICATION}-0.35.43-alpha.tar /app
ADD bin/${APPLICATION}-0.35.45-alpha.tar /app

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "/app/${APPLICATION}-0.35.43-alpha/bin/${APPLICATION}"]
ENTRYPOINT ["/bin/bash", "-c", "/app/${APPLICATION}-0.35.45-alpha/bin/${APPLICATION}"]
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ RUN pip install .

ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.9
LABEL io.airbyte.version=0.1.10
LABEL io.airbyte.name=airbyte/source-chargebee
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["updated_at"]
},
{
"stream": {
"name": "credit_note",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["updated_at"],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "incremental",
"destination_sync_mode": "append",
"cursor_field": ["updated_at"]
}
]
}
Loading

1 comment on commit 4f92246

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

SonarQube Report

SonarQube report for Airbyte Connectors Source Woocommerce(#10791)

Measures

Name Value Name Value Name Value
Vulnerabilities 0 Lines to Cover 125 Lines of Code 148
Reliability Rating A Quality Gate Status OK Duplicated Lines (%) 0.0
Code Smells 20 Security Rating A Bugs 0
Duplicated Blocks 0 Coverage 0.0 Blocker Issues 0
Critical Issues 1 Major Issues 0 Minor Issues 19

Detected Issues

Rule File Description Message
python:mypy_import (MINOR) source_woocommerce/source.py:13 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
python:S1192 (CRITICAL) source_woocommerce/source.py:56 String literals should not be duplicated Define a constant instead of duplicating this literal "application/json" 3 times.
python:mypy_index (MINOR) source_woocommerce/source.py:132 Check indexing operations Unsupported target for indexed assignment ("Union[str, Any]") . Code line: record["shop_url"] = self.shop
python:mypy_index (MINOR) source_woocommerce/source.py:136 Check indexing operations Unsupported target for indexed assignment ("Union[str, Any]") . Code line: record["shop_url"] = self.shop
python:mypy_attr_defined (MINOR) source_woocommerce/source.py:72 Check that attribute exists Module has no attribute "parse" . Code line: params.update({"after": pendulum.parse(self.start_date).re...
python:mypy_attr_defined (MINOR) source_woocommerce/source.py:118 Check that attribute exists Module has no attribute "parse" . Code line: start_date = pendulum.parse(start_date).replace(tzinfo...
python:mypy_union_attr (MINOR) source_woocommerce/source.py:135 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "iter" (not iterable) . Code line: for record in records_slice:
python:mypy_valid_type (MINOR) source_woocommerce/source.py:66 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...e: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_pag...
python:mypy_dict_item (MINOR) source_woocommerce/source.py:73 Check dict items in a dict expression {key: value, ...} Dict entry 0 has incompatible type "str": "str"; expected "str": "int" . Code line: params.update({"orderby": self.order_field, "order": "asc"...
python:mypy_dict_item (MINOR) source_woocommerce/source.py:73 Check dict items in a dict expression {key: value, ...} Dict entry 1 has incompatible type "str": "str"; expected "str": "int" . Code line: ... params.update({"orderby": self.order_field, "order": "asc"})
python:mypy_override (MINOR) source_woocommerce/source.py:109 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "WoocommerceStream" . Code line: def request_params(self, stream_state: Mapping[str, Any] = None, n...
python:mypy_arg_type (MINOR) source_woocommerce/source.py:110 Check argument types in calls Argument "stream_state" to "request_params" of "WoocommerceStream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ... params = super().request_params(stream_state=stream_state, next_pa...
python:mypy_union_attr (MINOR) source_woocommerce/source.py:130 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "iter" (not iterable) . Code line: for record in records_slice:
python:mypy_operator (MINOR) source_woocommerce/source.py:131 Check that operator is valid for operands Unsupported operand types for >= ("str" and "None") . Code line: if record[self.cursor_field] >= stream_state.get(self....
python:mypy_index (MINOR) source_woocommerce/source.py:131 Check indexing operations Invalid index type "str" for "Union[str, Any]"; expected type "Union[int, slice]" . Code line: if record[self.cursor_field] >= stream_state.get(self....
python:mypy_override (MINOR) source_woocommerce/source.py:141 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "WoocommerceStream" . Code line: def request_params(self, stream_state: Mapping[str, Any] = None, n...
python:mypy_assignment (MINOR) source_woocommerce/source.py:174 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "bytes", variable has type "str") . Code line: username = username.encode("latin1")
python:mypy_assignment (MINOR) source_woocommerce/source.py:175 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "bytes", variable has type "str") . Code line: password = password.encode("latin1")
python:mypy_arg_type (MINOR) source_woocommerce/source.py:176 Check argument types in calls Argument 1 to "join" of "bytes" has incompatible type "Tuple[str, str]"; expected "Iterable[Union[ByteString, memoryview]]" . Code line: token = b64encode(b":".join((username, password))).strip().dec...
python:mypy_valid_type (MINOR) source_woocommerce/source.py:179 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, any]:

Coverage (0.0%)

File Coverage File Coverage
source_woocommerce/init.py 0.0 source_woocommerce/source.py 0.0

Please sign in to comment.