-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
AIP-79 Generate assets for Flask application in FAB provider (#44744) #45060
Open
vincbeck
wants to merge
4
commits into
apache:main
Choose a base branch
from
aws-mwaa:vincbeck/compile_assets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−7
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0fcbcfe
AIP-79 Generate assets for Flask application in FAB provider (#44744)
vincbeck 2dd804e
Merge branch 'main' into vincbeck/compile_assets
vincbeck 976d0f0
Fix static checks
vincbeck e78c987
Merge branch 'main' into vincbeck/compile_assets
vincbeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 am not sure whether this will work. because airflow and providers are not installed in pre-commit.
But as you can be sure the source tree is checked-out, how about checking if source tree is available?
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.
But when you install, the sources are not available, are not they? So
is_fab_provider_installed
will returnFalse
in this case? Although we wan do want to generate assets for FAB as well. As for thepre-commit
, since Airflow is not installed,is_fab_provider_installed
will returnFalse
.I am not 100% sure I understand everything correctly here so I might be wrong :)
EDIT: what I meant is, it is okay to not generate the assets for FAB in the CI, however, when Airflow is installed, we definitely should generate them
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 thought from the point of lifecycle. The pre-commit hook will be called in CI and locally... at build time. Source tree will be there. And it needs to be called at build-time to create the static JS content as dist folder to be packaged into the wheel.
The check you are referring to is at runtime At
pip install apache-airflow-providers-fab
time the wheel is only un-packed to site-packages. There will no pre-commit be executed as well as you need to assume that at point of install no yarn will be available (might be the user installing is even offline w/o internet).Otherwise - not being an expert - if the wheel install need to compile/bind/do something at point of install you need to define this in package meta data - not in a pre-commit script that is not available at install time.
You can see this also for airflow/www - the pre-commit is making the package before the sdist/wheel is built and then the dist is packed into the wheel.
So if the check now makes it more safe... I assume the dist will just not be created during build then and only the TS/TSX source tree will be packaged into the wheel.
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.
Alright. Following this approach I am at the exact same point as in #45058. I dont quite get the error. Will re-try later
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.
@bbovenzi or @pierrejeambrun can you help here? yarn is not really successfully compiling www assets. I assume the yarn lock file is somewhat "different" but I am not an expert why the compile fails. (Still I suspect that loading airflow a Py module is not correct because at CI/compile time the packahe is not installed (chicken+egg))