Skip to content

Commit d93fcfd

Browse files
authored
airbyte-ci: reduce required env var when running in CI (fixed) (#37786)
1 parent 48930e4 commit d93fcfd

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

airbyte-ci/connectors/pipelines/README.md

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

746746
| Version | PR | Description |
747747
| ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
748+
| 4.12.4 | [#37786](https://github.com/airbytehq/airbyte/pull/37786) | (fixed 4.12.2): Do not upload dagger log to GCP when no credentials are available. |
748749
| 4.12.3 | [#37783](https://github.com/airbytehq/airbyte/pull/37783) | Revert 4.12.2 |
749750
| 4.12.2 | [#37778](https://github.com/airbytehq/airbyte/pull/37778) | Do not upload dagger log to GCP when no credentials are available. |
750751
| 4.12.1 | [#37765](https://github.com/airbytehq/airbyte/pull/37765) | Relax the required env var to run in CI and handle their absence gracefully. |

airbyte-ci/connectors/pipelines/pipelines/cli/dagger_pipeline_command.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ async def invoke(self, ctx: click.Context) -> None:
5353
sys.exit(1)
5454
finally:
5555
if ctx.obj.get("dagger_logs_path"):
56-
if ctx.obj["is_local"]:
57-
main_logger.info(f"Dagger logs saved to {ctx.obj['dagger_logs_path']}")
58-
if ctx.obj["is_ci"]:
56+
main_logger.info(f"Dagger logs saved to {ctx.obj['dagger_logs_path']}")
57+
if ctx.obj["is_ci"] and ctx.obj["ci_gcs_credentials"] and ctx.obj["ci_report_bucket_name"]:
5958
gcs_uri, public_url = upload_to_gcs(
6059
ctx.obj["dagger_logs_path"], ctx.obj["ci_report_bucket_name"], dagger_logs_gcs_key, ctx.obj["ci_gcs_credentials"]
6160
)

airbyte-ci/connectors/pipelines/pipelines/models/contexts/pipeline_context.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ def github_commit_status(self) -> dict:
187187
"""Build a dictionary used as kwargs to the update_commit_status_check function."""
188188
target_url: Optional[str] = self.gha_workflow_run_url
189189

190-
if self.state not in [ContextState.RUNNING, ContextState.INITIALIZED] and isinstance(self.report, ConnectorReport):
190+
if (
191+
self.remote_storage_enabled
192+
and self.state not in [ContextState.RUNNING, ContextState.INITIALIZED]
193+
and isinstance(self.report, ConnectorReport)
194+
):
191195
target_url = self.report.html_report_url
192196

193197
return {
@@ -219,7 +223,7 @@ def dagger_cloud_url(self) -> Optional[str]:
219223

220224
@property
221225
def remote_storage_enabled(self) -> bool:
222-
return self.is_ci is True and self.ci_report_bucket is not None and self.ci_gcs_credentials_secret is not None
226+
return self.is_ci and bool(self.ci_report_bucket) and bool(self.ci_gcs_credentials)
223227

224228
def get_repo_file(self, file_path: str) -> File:
225229
"""Get a file from the current repository.

airbyte-ci/connectors/pipelines/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pipelines"
7-
version = "4.12.3"
7+
version = "4.12.4"
88
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
99
authors = ["Airbyte <[email protected]>"]
1010

0 commit comments

Comments
 (0)