kaxil opened a new pull request, #73539:
URL: https://github.com/apache/airflow/pull/73539

   The `sync-java-sdk-supervisor-schema` prek hook starts a full Gradle build 
on every run to check whether the bundled Supervisor Schema matches 
`airflowSupervisorSchemaVersion` in `java-sdk/gradle.properties`. In the CI 
`Static checks` job that costs 83 s per pull request 
([example](https://github.com/apache/airflow/actions/runs/35700940143/job/106662807685),
 a docs-only PR), because `--all-files` selects the hook whenever its two 
target files exist, which is always. Almost all of that time is the wrapper 
download, JVM start and plugin resolution on a cold runner; the comparison 
itself is two strings.
   
   The hook entry is now a Python script that does the same comparison the 
Gradle task does: read `api_version` from `java-sdk/sdk/schema/schema.json` and 
compare it with the configured version. When they match it exits in about 30 
ms. When they differ, or the schema file is missing or unparseable, it runs the 
original `./java-sdk/gradlew -p ./java-sdk :sdk:syncSupervisorSchema`, so the 
download-and-replace path is unchanged. The Gradle task keeps its own 
short-circuit, so a match is decided identically whichever side checks first.
   
   One gotcha: the fast path reads only the repo's `gradle.properties`. A 
developer overriding `airflowSupervisorSchemaVersion` through `-P` or a 
user-level Gradle properties file would see "up-to-date" from the hook while 
Gradle would have re-synced. The hook never passed such overrides before, so 
nothing in the repo relies on them.
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.
   


-- 
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