Skip to content

Conversation

LucasRoesler
Copy link
Contributor

When the config.core.base_url has a subpath, this path should be copied to the execution_api_server_url as a path-prefix.

For example, when base_url=http://example.com/airflow, then the execution_api_server_url=http://name-api-server:8080/airflow/execution

The chart behavior is unchanged if

  • the base_url is empty
  • the base_url does not have a subpath
  • the execution_api_server_url is already set in the config

This can easily be tested using helm template, here are the 4 cases I considered

  1. No config overrides will produce the current behavior

    $ helm template local ./  -s templates/configmaps/configmap.yaml | grep "execution_api_server_url"
        execution_api_server_url = http://local-api-server:8080/execution/
  2. Adding a base_url with a sub-path shows the new behavior of copying the subpath to the execution url

    $ helm template local ./ --set config.api.base_url="http://example.com/airflow"  -s templates/configmaps/configmap.yaml | grep "execution_api_server_url"
        execution_api_server_url = http://local-api-server:8080/airflow/execution/
  3. Adding a base_url without a subpath also preserves the existing behavior

    $ helm template local ./ --set config.api.base_url="http://example.com/"  -s templates/configmaps/configmap.yaml | grep "execution_api_server_url"
        execution_api_server_url = http://local-api-server:8080/execution/
  4. Finallly, even adding a subpath to the base url, if the execution url is directly set, this is preserved

    $ helm template local ./ --set config.api.base_url="http://example.com/airflow" --set config.core.execution_api_server_url="http://service:9090/execution/"  -s templates/configmaps/configmap.yaml
     | grep "execution_api_server_url"
        execution_api_server_url = http://service:9090/execution/

Closes: #51450


@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Jun 5, 2025
@eladkal eladkal requested a review from romsharon98 June 7, 2025 07:33
@romsharon98
Copy link
Contributor

Can you add some tests with those examples you written?

@LucasRoesler
Copy link
Contributor Author

Sure thing, I initially missed the tests here: https://github.com/apache/airflow/blob/main/helm-tests%2Ftests%2Fhelm_tests%2Fairflow_core%2Ftest_api_server.py

I will add a new test case today.

@LucasRoesler
Copy link
Contributor Author

@romsharon98 done, i add 4 cases for airflow > v3 and one for <v3. Let me know if there are other cases we want to include.

@LucasRoesler LucasRoesler force-pushed the fix-execution-url-when-base-url-has-subpath branch from 6e0fbdf to 9866707 Compare June 10, 2025 11:30
@eladkal eladkal added this to the Airflow Helm Chart 1.17.0 milestone Jun 11, 2025
@LucasRoesler
Copy link
Contributor Author

The test failure seems unrelated

Check and fix default value of default_deferrable...........................Failed
- hook id: check-deferrable-default
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/work/airflow/airflow/./scripts/ci/pre_commit/check_deferrable_default.py", line 29, in <module>
    from libcst.codemod import CodemodContext
  File "/home/runner/.cache/pre-commit/repodmrse7ww/py_env-python3/lib/python3.9/site-packages/libcst/codemod/__init__.py", line 6, in <module>
    from libcst.codemod._cli import (
  File "/home/runner/.cache/pre-commit/repodmrse7ww/py_env-python3/lib/python3.9/site-packages/libcst/codemod/_cli.py", line 29, in <module>
    from libcst.codemod._dummy_pool import DummyExecutor
  File "/home/runner/.cache/pre-commit/repodmrse7ww/py_env-python3/lib/python3.9/site-packages/libcst/codemod/_dummy_pool.py", line 14, in <module>
    from typing_extensions import ParamSpec
ModuleNotFoundError: No module named 'typing_extensions'

When the `config.core.base_url` has a subpath, this path should be
copied to the `execution_api_server_url` as a path-prefix.

For example, when `base_url=http://example.com/airflow`, then the
`execution_api_server_url=http://name-api-server:8080/airflow/execution`

The chart behavior is unchanged if
- the `base_url` is empty
- the `base_url` does _not_ have a subpath
- the `execution_api_server_url` is already set in the config

Signed-off-by: Lucas Roesler <[email protected]>
@eladkal eladkal force-pushed the fix-execution-url-when-base-url-has-subpath branch from 136e7fe to 3ab8304 Compare June 13, 2025 19:57
@romsharon98 romsharon98 merged commit 8edbf34 into apache:main Jun 17, 2025
66 checks passed
Copy link

boring-cyborg bot commented Jun 17, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm chart sets the incorrect execution_api_server_url when the base_url contains a subpath
3 participants