Skip to content

Commit

Permalink
airbyte-ci: reduce required env var when running in CI (fixed) (#37786)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed May 3, 2024
1 parent 48930e4 commit d93fcfd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions airbyte-ci/connectors/pipelines/README.md
Expand Up @@ -745,6 +745,7 @@ E.G.: running Poe tasks on the modified internal packages of the current branch:

| Version | PR | Description |
| ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| 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. |
| 4.12.3 | [#37783](https://github.com/airbytehq/airbyte/pull/37783) | Revert 4.12.2 |
| 4.12.2 | [#37778](https://github.com/airbytehq/airbyte/pull/37778) | Do not upload dagger log to GCP when no credentials are available. |
| 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. |
Expand Down
Expand Up @@ -53,9 +53,8 @@ async def invoke(self, ctx: click.Context) -> None:
sys.exit(1)
finally:
if ctx.obj.get("dagger_logs_path"):
if ctx.obj["is_local"]:
main_logger.info(f"Dagger logs saved to {ctx.obj['dagger_logs_path']}")
if ctx.obj["is_ci"]:
main_logger.info(f"Dagger logs saved to {ctx.obj['dagger_logs_path']}")
if ctx.obj["is_ci"] and ctx.obj["ci_gcs_credentials"] and ctx.obj["ci_report_bucket_name"]:
gcs_uri, public_url = upload_to_gcs(
ctx.obj["dagger_logs_path"], ctx.obj["ci_report_bucket_name"], dagger_logs_gcs_key, ctx.obj["ci_gcs_credentials"]
)
Expand Down
Expand Up @@ -187,7 +187,11 @@ def github_commit_status(self) -> dict:
"""Build a dictionary used as kwargs to the update_commit_status_check function."""
target_url: Optional[str] = self.gha_workflow_run_url

if self.state not in [ContextState.RUNNING, ContextState.INITIALIZED] and isinstance(self.report, ConnectorReport):
if (
self.remote_storage_enabled
and self.state not in [ContextState.RUNNING, ContextState.INITIALIZED]
and isinstance(self.report, ConnectorReport)
):
target_url = self.report.html_report_url

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

@property
def remote_storage_enabled(self) -> bool:
return self.is_ci is True and self.ci_report_bucket is not None and self.ci_gcs_credentials_secret is not None
return self.is_ci and bool(self.ci_report_bucket) and bool(self.ci_gcs_credentials)

def get_repo_file(self, file_path: str) -> File:
"""Get a file from the current repository.
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/pipelines/pyproject.toml
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pipelines"
version = "4.12.3"
version = "4.12.4"
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
authors = ["Airbyte <contact@airbyte.io>"]

Expand Down

0 comments on commit d93fcfd

Please sign in to comment.