Skip to content

Fall back for empty console domain#70067

Open
suyua9 wants to merge 2 commits into
apache:mainfrom
suyua9:fix/empty-high-value-cookie-domain
Open

Fall back for empty console domain#70067
suyua9 wants to merge 2 commits into
apache:mainfrom
suyua9:fix/empty-high-value-cookie-domain

Conversation

@suyua9

@suyua9 suyua9 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What changed

Treat an empty GOOGLE_CLOUD_HIGH_VALUE_COOKIE_DOMAIN value as the default google.com domain. This prevents the Google provider's sovereign-console link helpers from emitting https://console.cloud. when the variable is present but empty.

The change adds direct coverage for unset, empty, and custom values.

Tests

  • ruff format --check (changed files)
  • ruff check (changed files)
  • python3 -m compileall (changed files)
  • Targeted pytest was attempted with the repository-required uv 0.11.8, but dependency resolution could not build pykerberos because this machine's xcrun Command Line Tools library has an architecture mismatch. GitHub CI should run the added test in the project toolchain.

Was generative AI tooling used to co-author this PR?
  • Yes (Codex)

@suyua9
suyua9 requested a review from shahar1 as a code owner July 18, 2026 08:01
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Jul 18, 2026

@SameerMesiah97 SameerMesiah97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just one nit. Also, fix the commit message as that is causing CI to fail.

@staticmethod
def get_high_value_cookie_domain() -> str:
return os.getenv("GOOGLE_CLOUD_HIGH_VALUE_COOKIE_DOMAIN", "google.com")
return os.getenv("GOOGLE_CLOUD_HIGH_VALUE_COOKIE_DOMAIN") or "google.com"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This works but it could be clearer. Please see the below:

domain = os.getenv("GOOGLE_CLOUD_HIGH_VALUE_COOKIE_DOMAIN")
return "google.com" if domain in (None, "") else domain

@suyua9 suyua9 changed the title fix(providers/google): fall back for empty console domain Fall back for empty console domain Jul 21, 2026
@suyua9
suyua9 force-pushed the fix/empty-high-value-cookie-domain branch from e094cfd to 12c8f3e Compare July 21, 2026 07:32
@suyua9

suyua9 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback and refreshed the branch onto the current main:

  • read the environment value into a local domain variable before handling the unset/empty fallback;
  • retained the existing unset, empty, and custom-value regression coverage;
  • changed the PR title to the repository-required non-Conventional-Commits form.

Validation run:

  • git diff --check
  • ruff format --check providers/google/src/airflow/providers/google/common/hooks/base_google.py
  • ruff check providers/google/src/airflow/providers/google/common/hooks/base_google.py
  • python3 -m compileall -q providers/google/src/airflow/providers/google/common/hooks/base_google.py

The targeted pytest command could not run locally because this checkout requires uv >=0.11.8 while the installed version is 0.10.8; CI will cover the existing targeted regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants