-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: git clone on Windows #26105
Fix: git clone on Windows #26105
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
Good idea to add a test for it :). But you will also need to fix some tests to make it works I am afraid. BTW. That will be really helpful (and should be part of #windows - which I tihnk very soon (pending few more PRs to complete https://github.com/apache/airflow/projects/13 ) will finally be possible. |
That's clear. I'm working on that. |
@potiuk after investigation it looks like the root of the problem is in FileTaskHandler as it writes logs to paths containing dates in ISO 8601format. But ISO 8601format won't work on Windows. Rewrite Breeze and CI in Python project has no issue to use another date format to make log directory structure Windows-compatible. Probably it's because the project aimed at Breeze rewriting, not at been able to run Airflow on Windows. Changing The class (customized |
I commented elsewhere. Since this actually affects Windows support (which we want to achieve at some point), the root cause should also be fixed. I would suggest the following steps:
|
@uranusjr I like your suggestion, the only problem I see is that it's not possible to run So if it's ok to have in |
@uranusjr I have came to an idea that to fix git clone on Windows it would be enough to fix points 2 and 3:
While point 1 could be fixed in another PR:
|
My proposal is not to make FileTaskHandler work on Windows, only to modify it in a way that is in line to the changes we want to make if we want to make it work. This makes the work more meaningful; the current patch you proposes will basically all be deleted when Windows support is implemented, which is more wasteful than just implement the proper logic in the first place. |
Yeah. Agree with @uranusjr that this is the right way. Regarding generation of the files, it might even be as simple as zipping the log files that are used for test and have two .zip files "windows" / "posix" - and decompress the one that is relevant for the OS that you are running the tests on. This way you could add the different behaviours in FileTaskHandler too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Very nice approach :). |
@uranusjr - WDYT? |
tests/www/views/test_views_log.py
Outdated
# delete logs to minimize tests interference | ||
shutil.rmtree(log_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, pytest tracks tmp_path_factory
and cleans things it creates automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uranusjr pytest cleans directories after exiting defined scope. log_path
fixture requires module
scope to be used by log_app
fixture (which also has module
scope). But log_path
should be cleared after each test, because almost all tests reference to the same Dag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks. Would it be a good idea to only delete the generated log file instead though? (And add a comment explaining why)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uranusjr in the PR I tried not to make any assumptions regarding log file name. I will add a comment describing why manual log file deletion is required and will find more clear to delete created log file.
@kokrin - your goal is to make it green. And whether to do it is something that you shoud be able to assess yourself I think
I think this is a good recipe and I wonder if following it will help in this case (I am using this a bit of a testing ground and if it works I will try to make contributors aware of this "approach" they should use - I am looking for a ways to scale the PR process better. Let me know @kokorin - and maybe if you have other suggestions how to improve the "process" that woudl be awesome. |
What I mean, if you already did points 1) 2) 3) - just mention it and when you ask if this is a failure just point to the other similar issues :) . Try to put. your self in our shoes. When you ask such question and you do not mention that you already looked at it, the first assumption I have is .. that you are lazy and you have not checked just try to offload the check to us :). a) @potiuk @uranus - should I fix it ? vs. b) It looks like the error here is similar to error in #26162 , and it does not loook related to my changes. @potiuk @uranusjr - can you help please? The first looks like you have not made any effort to check and you are lazy. The second shows that you've "done your part". Context is everything. My reaction to b) is vastly different than a) :). Hope no hard feelings - just wantted to show you how it looks like if you are too brief. |
CI steps "Build CI Images" fail with
Probably, it's not related to changes in this MR. Please, let me know if it's not true. |
The CI images job is failing for some other PRs as well, so perhaps it is related to some issues in GitHub. I have restarted the job to see if the issue is temporary. |
Yeah. I think GitHub had a rough day yesterday ... Many things were failing here and there |
I fixed the K8S test problems in #26235 . 🤞 |
Rebased to re-run. |
In such cases, you can always rebase the PR to check (it's as easy as choosing "rebase" at the bottom right of the PR if there are no conflicts). I did it - but next time you can rebase yourself without waiting/pinging us (let's see if it succeed - please watch this and check and ping me if it does, otherwise I will come back to this one next time when I go through about 100/200 mails so it might take some time). |
@potiuk all tests passed |
Awesome work, congrats on your first merged pull request! |
Cool! |
(cherry picked from commit 9aa589e)
(cherry picked from commit 9aa589e)
Airflow repository can't be cloned on Windows due to some files containing symbols restricted on Windows.
closes: #24596
related to: #25865
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.