Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Jun 14, 2025

Running pre-commits for typescript compilation, linting formatting is currently very slow. The pre-commit that is doing it took more than 2.5 minutes - always, independently which files changed. Also, no matter whether UI or simple auth manager UI changed, both were compiled.

This is the first iteration of speeding up the pre-commit especially for incremental changes.

The following changes were implemented:

  • the scripts were split into ui and simple-auth-manager-ui
  • timing information and verbose commands displayed so that we can measure which commands take how much time
  • the pre-commmit now passes all the files as input (and pre-commit is serialized) - which means that some commands can only be run on the subset of files that changed
  • tsc step is modified to only run on a subset of .ts and .tsx files that were changed (via dynamic extension of the project)

Overall when just few files change, the pre-commit should now complete in less than 10-20 seconds

Still some optimisations are possible in the future. (cherry picked from commit 52be0dd)


^ 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 airflow-core/newsfragments.

Running pre-commits for typescript compilation, linting formatting is
currently very slow. The pre-commit that is doing it took more than 2.5
minutes - always, independently which files changed. Also, no matter
whether UI or simple auth manager UI changed, both were compiled.

This is the first iteration of speeding up the pre-commit especially
for incremental changes.

The following changes were implemented:

* the scripts were split into ui and simple-auth-manager-ui
* timing information and verbose commands displayed so that
  we can measure which commands take how much time
* the pre-commmit now passes all the files as input (and pre-commit
  is serialized) - which means that some commands can only be run
  on the subset of files that changed
* tsc step is modified to only run on a subset of .ts and .tsx files
  that were changed (via dynamic extension of the project)

Overall when just few files change, the pre-commit should now complete
in less than 10-20 seconds

Still some optimisations are possible in the future.
(cherry picked from commit 52be0dd)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@potiuk potiuk merged commit 1b5d32e into apache:v3-0-test Jun 14, 2025
60 checks passed
@potiuk potiuk deleted the backport-52be0dd-v3-0-test branch June 14, 2025 13:56
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks Jarek! Yes that hook is too long :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants