Skip to content

Commit

Permalink
feat: add ability to opt out of version increment checks (#53238)
Browse files Browse the repository at this point in the history
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and natikgadzhi authored Feb 8, 2025
1 parent b889bcd commit bf4f115
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing import Optional

from pydantic import BaseModel, Extra
from pydantic import BaseModel, Extra, Field
from typing_extensions import Literal


Expand All @@ -16,3 +16,7 @@ class Config:
sl: Optional[Literal[0, 100, 200, 300]] = None
ql: Optional[Literal[0, 100, 200, 300, 400, 500, 600]] = None
isEnterprise: Optional[bool] = False
requireVersionIncrementsInPullRequests: Optional[bool] = Field(
True,
description="When false, version increment checks will be skipped for this connector",
)
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ class Config:
sl: Optional[Literal[0, 100, 200, 300]] = None
ql: Optional[Literal[0, 100, 200, 300, 400, 500, 600]] = None
isEnterprise: Optional[bool] = False
requireVersionIncrementsInPullRequests: Optional[bool] = Field(
True,
description="When false, version increment checks will be skipped for this connector",
)


class PyPi(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class Config:
sl: Optional[Literal[0, 100, 200, 300]] = None
ql: Optional[Literal[0, 100, 200, 300, 400, 500, 600]] = None
isEnterprise: Optional[bool] = False
requireVersionIncrementsInPullRequests: Optional[bool] = Field(
True,
description="When false, version increment checks will be skipped for this connector",
)


class GitInfo(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ class Config:
sl: Optional[Literal[0, 100, 200, 300]] = None
ql: Optional[Literal[0, 100, 200, 300, 400, 500, 600]] = None
isEnterprise: Optional[bool] = False
requireVersionIncrementsInPullRequests: Optional[bool] = Field(
True,
description="When false, version increment checks will be skipped for this connector",
)


class GitInfo(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class Config:
sl: Optional[Literal[0, 100, 200, 300]] = None
ql: Optional[Literal[0, 100, 200, 300, 400, 500, 600]] = None
isEnterprise: Optional[bool] = False
requireVersionIncrementsInPullRequests: Optional[bool] = Field(
True,
description="When false, version increment checks will be skipped for this connector",
)


class GitInfo(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class Config:
sl: Optional[Literal[0, 100, 200, 300]] = None
ql: Optional[Literal[0, 100, 200, 300, 400, 500, 600]] = None
isEnterprise: Optional[bool] = False
requireVersionIncrementsInPullRequests: Optional[bool] = Field(
True,
description="When false, version increment checks will be skipped for this connector",
)


class GitInfo(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ properties:
isEnterprise:
type: boolean
default: false
requireVersionIncrementsInPullRequests:
type: boolean
default: true
description: When false, version increment checks will be skipped for this connector
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def test_transform_to_json_does_not_mutate_keys(valid_metadata_upload_files, val
"data.releases.rolloutConfiguration.advanceDelayMinutes",
"data.releases.breakingChanges.2.0.0.deadlineAction",
"data.ab_internal.isEnterprise",
"data.ab_internal.requireVersionIncrementsInPullRequests",
]

for file_path in all_valid_metadata_files:
Expand Down
1 change: 1 addition & 0 deletions airbyte-ci/connectors/pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ airbyte-ci connectors --language=low-code migrate-to-manifest-only
## Changelog

| Version | PR | Description |
| 5.1.0 | [#53238](https://github.com/airbytehq/airbyte/pull/53238) | Add ability to opt out of version increment checks via metadata flag |
| 5.0.1 | [#52664](https://github.com/airbytehq/airbyte/pull/52664) | Update Python version requirement from 3.10 to 3.11. |
| ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| 4.49.4 | [#52104](https://github.com/airbytehq/airbyte/pull/52104) | Stream Gradle task output to the step logger |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ class VersionIncrementCheck(VersionCheck):

@property
def should_run(self) -> bool:
# Skip if connector opts out of version checks
if self.context.metadata and self.context.metadata.get("ab_internal", {}).get("requireVersionIncrementsInPullRequests") is False:
return False

for filename in self.context.modified_files:
relative_path = str(filename).replace(str(self.context.connector.code_directory) + "/", "")
if not any([relative_path.startswith(to_bypass) for to_bypass in self.BYPASS_CHECK_FOR]):
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/pipelines/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pipelines"
version = "5.0.1"
version = "5.1.0"
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
authors = ["Airbyte <[email protected]>"]

Expand Down

0 comments on commit bf4f115

Please sign in to comment.