') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Feature/extract pre commit for airflow core by jscheffl · Pull Request #57310 · apache/airflow · GitHub
Skip to content

Feature/extract pre commit for airflow core - #57310

Merged
jscheffl merged 2 commits into
apache:mainfrom
jscheffl:feature/extract-pre-commit-for-airflow-core
Oct 28, 2025
Merged

Feature/extract pre commit for airflow core#57310
jscheffl merged 2 commits into
apache:mainfrom
jscheffl:feature/extract-pre-commit-for-airflow-core

Conversation

@jscheffl

Copy link
Copy Markdown
Contributor

Following #57181 this is now a batch for all prek hooks that are "just" solely for providers to split out from root:

As prek is supporting monorepo now and go SDK was the front-runner, Airflow-Core is now the next piece that with this PR is proposed to be split-out from global pre-commit hook list into the provider space.

Note: This is the crown and msot probably atm the last thing to move. Careful review please!

@jscheffl

jscheffl commented Oct 26, 2025

Copy link
Copy Markdown
ContributorAuthor

@potiuk ^^^ Careful review please! - sure you were able to read all the text in this lightning speed? Or trusting me and CI? :-D

@potiuk

Copy link
Copy Markdown
Member

Trusting you and CI .. I did took a look "briefly" ....

@potiuk

Copy link
Copy Markdown
Member

Trusting you and CI .. I did took a look "briefly" ....

I.e. I am checking if you are not doing anything "sneaky" - but I belive CI is way better than me to check for actual errors in this case.

@potiuk

Copy link
Copy Markdown
Member

node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

That looks like prek issue with node installing for a sub-folder pre-commit.

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

Parking this PR in regards of
j178/prek#973
as it might need a bit triaging why the constrains generation fails. Super-seeded with another PR and "parking" the leftover.

@potiuk

Copy link
Copy Markdown
Member

Let me try something .. It's strange it would fail like that but maybe ...

@potiuk

Copy link
Copy Markdown
Member

Pushed a possible fixup

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

Pushed a possible fixup

Sounds reasonable... I can confirm I can reproduce it locally but ONLY when I start via breeze release-management, locally the prek hook works - also if I clean the cache prior execution. So might be really a missing dependency int he container (only?). But why when not called in root...

@jscheffljscheffl added full tests needed We need to run full set of tests for this PR to merge all versions If set, the CI build will be forced to use all versions of Python/K8S/DBs labels Oct 26, 2025
@jscheffl

Copy link
Copy Markdown
ContributorAuthor

Just a marker before merge:

  • If this is the fix we should test all version prior merge in my view. Just to be on the safe side. And leave a comment for the future.

@potiuk

Copy link
Copy Markdown
Member

Nope. Does not work...

@potiuk

Copy link
Copy Markdown
Member

libatomic1 is already the newest version (12.2.0-14+deb12u1).
libatomic1 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove an

Libatomic is already installed. It looks like - possibly - somehow the system library path is removed during the installation by prek. I will comment there.

@j178

j178 commented Oct 27, 2025

Copy link
Copy Markdown
Contributor
diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index dfad85b2c7..1b0f28a9d2 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py@@ -272,7 +272,7 @@ PYYAML_VERSION = "6.0.3"
AIRFLOW_BUILD_DOCKERFILE = f"""
# syntax=docker/dockerfile:1.4
FROM python:{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}-slim-{ALLOWED_DEBIAN_VERSIONS[0]}
-RUN apt-get update && apt-get install -y --no-install-recommends git curl+RUN apt-get update && apt-get install -y --no-install-recommends libatomic1 git curl
RUN pip install uv=={UV_VERSION}
RUN --mount=type=cache,id=cache-airflow-build-dockerfile-installation,target=/root/.cache/ \
uv pip install --system ignore pip=={AIRFLOW_PIP_VERSION} hatch=={HATCH_VERSION} \

Could you try this patch? I think the breeze release-management prepare-airflow-distributions command is using this dockerfile that gets generated on the fly, and the “slim” image doesn’t come with libatomic1.

@jscheffl
jschefflforce-pushed the feature/extract-pre-commit-for-airflow-core branch from d14f530 to 4aa3171CompareOctober 27, 2025 21:28
@jscheffl

Copy link
Copy Markdown
ContributorAuthor

Could you try this patch? I think the breeze release-management prepare-airflow-distributions command is using this dockerfile that gets generated on the fly, and the “slim” image doesn’t come with libatomic1.

Thanks @j178 for the fast feedback! Re-based on the leftovers and cleaned the PR, applied the workaround as proposed. Let's see if CI turns green via this.

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

Seems CI failues are unrelated to the PR now and the proposal by @j178 fixes the problem. Unsure why it is working w/o and if defined in the root. @potiuk LGTM?

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

closes: j178/prek#973

@potiuk
potiukforce-pushed the feature/extract-pre-commit-for-airflow-core branch from 4aa3171 to b449dfcCompareOctober 28, 2025 00:33
@potiuk

Copy link
Copy Markdown
Member

Rebased to see. Indeed - release management commands use their own smaller "airflow-build-dockerfile"

@potiuk
potiuk marked this pull request as ready for review October 28, 2025 00:46
@jscheffl
jschefflforce-pushed the feature/extract-pre-commit-for-airflow-core branch from b449dfc to 265159dCompareOctober 28, 2025 20:24
@jscheffl
jschefflforce-pushed the feature/extract-pre-commit-for-airflow-core branch from 265159d to 47ed100CompareOctober 28, 2025 20:48
@jscheffl

Copy link
Copy Markdown
ContributorAuthor

We have no "luck" with this PR but all errors seem unrelated. Same errors on main. Therefore: merging.

THANKS @j178 for the proposed fix!

@jscheffl
jscheffl merged commit a6d3e2d into apache:mainOct 28, 2025
170 of 193 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-1-test. View the failure log Run details

StatusBranchResult
v3-1-testCommit Link

You can attempt to backport this manually by running:

cherry_picker a6d3e2d v3-1-test

This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

As we also did not backport #57315 would also skip here? Or should we?

Lzzz666 pushed a commit to Lzzz666/airflow that referenced this pull request Oct 30, 2025
* Extract prek hooks for Airflow Core
* Implement workaround as proposed by @j178
odaneau-astro pushed a commit to odaneau-astro/airflow that referenced this pull request Mar 18, 2026
* Extract prek hooks for Airflow Core
* Implement workaround as proposed by @j178
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

all versionsIf set, the CI build will be forced to use all versions of Python/K8S/DBsarea:dev-toolsfull tests neededWe need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jscheffl@potiuk@j178