Skip to content

Commit b25dbb3

Browse files
committed
add auto-merge condition
1 parent 0b6b05c commit b25dbb3

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

airbyte-ci/connectors/pipelines/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch:
767767

768768
| Version | PR | Description |
769769
| ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
770-
| 4.24.3 | [#42040](https://github.com/airbytehq/airbyte/pull/42040) | Always send regression test approval status check. |
770+
| 4.24.3 | [#42040](https://github.com/airbytehq/airbyte/pull/42040) | Always send regression test approval status check; skip on auto-merge PRs. |
771771
| 4.24.2 | [#41676](https://github.com/airbytehq/airbyte/pull/41676) | Send regression test approval status check when skipped. |
772772
| 4.24.1 | [#41642](https://github.com/airbytehq/airbyte/pull/41642) | Use the AIRBYTE_GITHUB_REPO environment variable to run airbyte-ci in other repos. |
773773
| 4.24.0 | [#41627](https://github.com/airbytehq/airbyte/pull/41627) | Require manual regression test approval for certified connectors |

airbyte-ci/connectors/pipelines/pipelines/hacks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import asyncclick as click
1313
from connector_ops.utils import ConnectorLanguage # type: ignore
1414
from pipelines import consts
15-
from pipelines.helpers.github import update_commit_status_check
15+
from pipelines.helpers.github import is_automerge_pull_request, update_commit_status_check
1616

1717
if TYPE_CHECKING:
1818
from dagger import Container
@@ -86,7 +86,7 @@ def do_regression_test_status_check(ctx: click.Context, status_check_name: str,
8686
run_url = ctx.obj["gha_workflow_run_url"]
8787
should_send = ctx.obj.get("ci_context") == consts.CIContext.PULL_REQUEST
8888

89-
if any(
89+
if is_automerge_pull_request(ctx.obj["pull_request"]) and any(
9090
[
9191
(connector.language == ConnectorLanguage.PYTHON and connector.support_level == "certified")
9292
for connector in ctx.obj["selected_connectors_with_modified_files"]

airbyte-ci/connectors/pipelines/pipelines/helpers/github.py

+7
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,10 @@ def create_or_update_github_pull_request(
220220
logger.info(f"Added label {label} to pull request")
221221

222222
return pull_request
223+
224+
225+
def is_automerge_pull_request(pull_request: Optional[github_sdk.PullRequest.PullRequest]) -> bool:
226+
labels = [label.name for label in pull_request.get_labels()] if pull_request else []
227+
if labels and "auto-merge" in labels:
228+
return True
229+
return False

0 commit comments

Comments
 (0)