Skip to content

fix: write Airflow dependency file as runtime user#135

Open
Haihan-Jiang wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
Haihan-Jiang:codex/composer-install-deps-run-as-user
Open

fix: write Airflow dependency file as runtime user#135
Haihan-Jiang wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
Haihan-Jiang:codex/composer-install-deps-run-as-user

Conversation

@Haihan-Jiang
Copy link
Copy Markdown

Summary

Fixes #134.

install_airflow_deps now creates and appends to requirements_with_airflow_version.txt through /home/airflow/run_as_user.sh. This keeps the generated requirements file owned/writable by the runtime Airflow user when local dev containers are configured to run as the host user.

A new unit test executes the install_airflow_deps shell function with stubbed run_as_user and sudo commands, then verifies the requirements file content and that the copy/append operations were delegated through run_as_user.

Validation

  • .venv/bin/python -m pytest tests/unit/test_entrypoint.py -q
  • .venv/bin/python -m pytest tests/unit -q
  • bash -n composer_local_dev/docker_files/entrypoint.sh
  • python3 -m py_compile tests/unit/test_entrypoint.py

@Haihan-Jiang Haihan-Jiang marked this pull request as ready for review May 23, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install_airflow_deps fails when COMPOSER_HOST_USER_NAME=True

1 participant