-
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
Finish refactoring of breeze-dependent pre-commits to use breeze shell #35830
Finish refactoring of breeze-dependent pre-commits to use breeze shell #35830
Conversation
87d1c6b
to
4f68a1e
Compare
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.
As a bonus MyPy output is now coloured (also when run as part of git commit).
cool!
4f68a1e
to
be2a572
Compare
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.
Uff, I was looking over this and needed to make a break after ~15min of reading. This PR is quite complex and changes a lot of things in one batch.
I would have preferred to split the refactoring and changes into separate commits to be able to better understand the features or even make rather (3?) smaller PRs.
But unfortunately it is all a single commit.
Before shooting in the wild, can you help (the reviewer) a bit what you have tested and what specifically during review we should take a look for? Critical things to test to ensure it does not only "work on my machine"?
Sure - yeah. good idea. I will split it. It grew quite a bit more than initial refactor, but I think I can split it to logical chunks. It started from the idea that it will be a "small refactor" but when I did it, I found out that I need to add a lot more options to Let me turn it into a draft and start separating out things. |
That is also a good idea as a "learning" exercise for those who will be reviewing it - i will try to turn it into more of a |
56b210b
to
95de8ba
Compare
5105105
to
5df59ee
Compare
OK. Merged #35862 so made it ready for review. |
BTW. If this is still too big I am happy to move pre-commit by pre-commit separately . |
I started to separate things out #35873 |
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.
I see one problem during review and actually I see a "real" problem that the pipeline in your run did not turn red. Because in my local run it failed in pre-commit run -a
in:
scripts/ci/pre_commit/pre_commit_update_er_diagram.py:31: error: Argument
"project_name" to "run_command_via_breeze_shell" has incompatible type "None";
expected "str" [arg-type]
project_name=None,
^~~~
Found 1 error in 1 file (checked 205 source files)
Error 1 returned
...and doing the manual check I can confirm that the (not changed) ER update script sets a None
as parameter whereas the utils function requires a str
as type.
Why has this not been catched in your CI run? Actually the CI also executes with breeze static-checks --all-files
- is there another (hidden) bug that this was not blocking?
04e5959
to
7ee1bf4
Compare
7ee1bf4
to
2dcd210
Compare
OK. only one last pre-commit (and removal of old code) will remain here once we merge #35878 |
2dcd210
to
e611334
Compare
This is what's left :) ... Should be small to complete the change :) |
e611334
to
c047a9a
Compare
@@ -382,28 +380,6 @@ def check_if_image_exists(image: str) -> bool: | |||
return cmd_result.returncode == 0 | |||
|
|||
|
|||
def get_ci_image_for_pre_commits() -> str: |
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 any more after this last PR from the series .
Some of our pre-commits were using code from Breeze in rather complex way - by inserting PYTHONPATH and importing code from there. That was complex and brittle and with recent changes of ShelParam apache#35801 those precommits required more and more dependencies to be added to their pre-commit virtualenvs. The reason that it was done this way was the assumption that someone might want to run pre-commits locally without having breeze installed, but this assumption and use case is rather unlikely, becasue breeze becomes more and more useful and used so we can safely assume that anyone who wants to do pre-commits will also have breeze installed and on path. And anyway to run those pre-commits you need to have breeze CI image pulled and built, so you should generally have breeze to run them. This PR finishes the series of PRs implementing the refactor and completes the refactor.
c047a9a
to
0a1e6fa
Compare
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.
Thanks! LGTM!
#35830) Some of our pre-commits were using code from Breeze in rather complex way - by inserting PYTHONPATH and importing code from there. That was complex and brittle and with recent changes of ShelParam #35801 those precommits required more and more dependencies to be added to their pre-commit virtualenvs. The reason that it was done this way was the assumption that someone might want to run pre-commits locally without having breeze installed, but this assumption and use case is rather unlikely, becasue breeze becomes more and more useful and used so we can safely assume that anyone who wants to do pre-commits will also have breeze installed and on path. And anyway to run those pre-commits you need to have breeze CI image pulled and built, so you should generally have breeze to run them. This PR finishes the series of PRs implementing the refactor and completes the refactor. (cherry picked from commit 8a67e15)
ome of our pre-commits were using code from Breeze in rather complex
way - by inserting PYTHONPATH and importing code from there. That was
complex and brittle and with recent changes of ShelParam #35801 those
precommits required more and more dependencies to be added to their
pre-commit virtualenvs.
The reason that it was done this way was the assumption that someone
might want to run pre-commits locally without having breeze installed,
but this assumption and use case is rather unlikely, becasue breeze
becomes more and more useful and used so we can safely assume that
anyone who wants to do pre-commits will also have breeze installed and
on path. And anyway to run those pre-commits you need to have breeze
CI image pulled and built, so you should generally have breeze to run
them.
This PR finishes the series of PRs implementing the refactor and
completes the refactor.
^ Add meaningful description above
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.