Skip to content

Comments

Fix public repository access in GitDagBundle#61343

Merged
amoghrajesh merged 4 commits intoapache:mainfrom
astronomer:fix-githook-issue-public-repos
Feb 4, 2026
Merged

Fix public repository access in GitDagBundle#61343
amoghrajesh merged 4 commits intoapache:mainfrom
astronomer:fix-githook-issue-public-repos

Conversation

@amoghrajesh
Copy link
Contributor


Was generative AI tooling used to co-author this PR?
  • No

Problem

#59084 broke public repository support in GitDagBundle. When we tried to configure public repositories without authentication, the bundle initialization would fail with and error like this:

AirflowNotFoundException: The conn_id git_default isn't defined

This was affecting all users using public repos with dag bundles.

The root cause was that the linked PR changed error handling to reraise all GitHook creation exceptions to provide clearer error messages. However, this broke the valid use case where users configure a public repo with explicit repo_url which lead to Githook creation failing error being reraised due to which the entire bundle would be killed, making dag bundles unusable. In other words, no dags would be seen on the Airflow UI.

Fix

The fix is to make the git connection optional when repo_url is explicitly provided:

  • If repo_url is NOT provided: Connection is required (to get the repo URL) and exception if any, is raised.
  • if repo_url IS provided: Connection is optional and exception is caught, bundle continues without authentication

This is a middle ground which allows public repositories to work without any connection configuration, while still maintaining clear error messages that the linked PR fixed earlier.

Testing

Configure the git bundle:

export AIRFLOW__DAG_PROCESSOR__DAG_BUNDLE_CONFIG_LIST='[{"name": "git_repo", "classpath": "airflow.providers.git.bundles.git.GitDagBundle", "kwargs": {"tracking_ref": "main", "subdir": "examples", "repo_url": "https://github.com/AmFlint/test-af.git"}}]'

Earlier this would be seen:

image (64)

After the fix, this is what we see:

image (65)
  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@amoghrajesh amoghrajesh requested a review from Lee-W February 2, 2026 11:38
@amoghrajesh amoghrajesh merged commit 027c7cf into apache:main Feb 4, 2026
129 checks passed
@amoghrajesh amoghrajesh deleted the fix-githook-issue-public-repos branch February 4, 2026 11:30
Alok-kumar-priyadarshi pushed a commit to Alok-kumar-priyadarshi/airflow that referenced this pull request Feb 5, 2026
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
Ratasa143 pushed a commit to Ratasa143/airflow that referenced this pull request Feb 15, 2026
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.

5 participants