MichalJaroslawKrzywanski-TomTom opened a new pull request, #73427:
URL: https://github.com/apache/airflow/pull/73427

   `GitHook` wrote the `GIT_ASKPASS` (GitHub App auth) and `SSH_ASKPASS` (key 
passphrase) helper scripts with `NamedTemporaryFile(delete=True)` and kept the 
handle open for writing while git or ssh ran. Linux refuses to exec a file that 
is still open for writing (`ETXTBSY`, "Text file busy"), so every 
`GitDagBundle` clone using GitHub App authentication failed with `cannot exec 
'/tmp/tmpXXXX.sh': Text file busy` followed by `could not read Username for 
'https://github.com'`. macOS does not enforce this, which hid the bug.
   
   The fix writes each helper through a small module-level context manager 
(`_executable_script`) that closes the file before yielding its path and 
unlinks it in `finally`; both askpass paths use it. Two tests execute the 
helpers through `configure_hook_env` and assert their output; on Linux they 
fail without the fix.
   
   Verified in `apache/airflow:3.2.2-python3.10` (git 2.39.5): with the patched 
hook, git-style invocations of the `GIT_ASKPASS` script return the username and 
token and the helper is removed on exit. 
`providers/git/tests/unit/git/hooks/test_git.py`: 37 passed. `ruff check` and 
`ruff format` clean.
   
   closes: #73425
   related: #64105 (replaces the askpass mechanism with a credential helper; 
this is the minimal fix for released 0.5.x behaviour)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions).
 The diagnosis, the fix and the tests were reviewed by hand; the ETXTBSY 
reproduction and the test run above were executed by me.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to