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

   ## Summary
   
   Add the lychee link checker as a prek hook in **offline mode** so we catch
   broken intra-repo Markdown links before they land, and fix the 13
   existing broken internal links the hook surfaced on `main`.
   
   ### The hook
   
   Configured in `.pre-commit-config.yaml`:
   
   ```yaml
   - repo: https://github.com/lycheeverse/lychee
     rev: e85aaf5524b2f808e63bae55e594c843220f10f2  # frozen: lychee-v0.24.2
     hooks:
       - id: lychee
         types: [markdown]
         args:
           - LYCHEE_VERSION=0.24.2
           - --offline
           - --no-progress
           - --root-dir
           - .
         exclude: |
           (?x)
           ^clients/python/|
           ^.*/openapi-gen/|
           ^.*/node_modules/|
           ^\.build/|
           ^generated/
   ```
   
   Notes:
   - `--offline` means lychee skips every HTTP/HTTPS link and only validates
     on-disk references (relative paths, anchors, `file://` links).
   - `--root-dir .` makes root-relative GitHub-style links like
     `[X](/contributing-docs/X.rst)` resolve from the repo root.
   - `LYCHEE_VERSION=0.24.2` is passed as the first arg because lychee's
     pre-commit script otherwise requires the `rev` field to be a version
     tag, but airflow's convention is to pin SHAs. The arg keeps both
     happy. When bumping lychee, update both the `rev` SHA and the version
     string together.
   - Auto-generated content is excluded (the Python OpenAPI client docs
     under `clients/python/`, JS `node_modules/`, `openapi-gen` output,
     `.build/`, the `generated/` dir).
   
   ### The 13 broken links fixed
   
   - **Missing locale guides** (6 hits across 2 tables): added one-line stub
     files for `ar`, `it`, `tr` under
     `.github/skills/airflow-translations/locales/`. They are listed in the
     `airflow-translations` SKILL.md table because those locales are active
     in the UI i18n directory; until a full style-guide is authored each
     stub redirects the reader at the parent SKILL.md global rules.
   - **`airflow-core/src/airflow/_shared/{AGENTS,README}.md`**: the
     `[shared folder](../../shared)` link resolved inside `airflow-core/`
     rather than at the repo root. Fixed to `../../../../shared`.
   - **`airflow-core/src/airflow/api_fastapi/execution_api/AGENTS.md`**:
     one missing `../` segment; the `contributing-docs/...` link was
     resolving to `airflow-core/contributing-docs/` instead of the repo
     root. Fixed.
   - **`airflow-core/src/airflow/ui/tests/e2e/README.md`**: the
     `dag-trigger.spec.ts` example referenced no longer exists; pointed
     at the existing `dag-runs.spec.ts` instead.
   - **`dev/breeze/doc/ci/02_images.md`**: docs moved from
     `docs/docker-stack/` to `docker-stack-docs/`; link updated.
   - **`dev/README_RELEASE_HELM_CHART.md`**: helm-chart docs moved from
     `docs/helm-chart/` to `chart/docs/`; link updated.
   - **`dev/system_tests/README.md`**: dropped the dangling reference to
     a `dev/requirements.txt` that no longer exists; replaced with a
     `uv run --with PyGithub --with rich-click --with rich` invocation
     that picks up the script's actual dependencies.
   
   ## Test plan
   
   - [ ] `prek run lychee --all-files` passes (verified locally — 13
         errors on `main` → 0 errors after this PR).
   - [ ] `prek run insert-license lint-markdown --all-files` still passes
         across the touched files.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.7)
   
   Generated-by: Claude Code (Opus 4.7) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


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