diff --git a/.agents/skills/airflow-translations/locales/zh-TW.md b/.agents/skills/airflow-translations/locales/zh-TW.md index df413a4e9945e..5f5d5d0dbad85 100644 --- a/.agents/skills/airflow-translations/locales/zh-TW.md +++ b/.agents/skills/airflow-translations/locales/zh-TW.md @@ -158,20 +158,36 @@ word order: "title": "標記 {{類型}} 為 {{狀態}}" ``` -## Terminology Reference - -The established zh-TW translations are defined in the existing locale files. -Before translating, **read the existing zh-TW JSON files** to learn the -established terminology: - -``` -airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/ -``` - -Use the translations found in these files as the authoritative glossary. When -translating a term, check how it has been translated elsewhere in the locale -to maintain consistency. If a term has not been translated yet, refer to the -English source in `en/` and apply the rules in this document. +## Translation Workflow + +Work through these steps in order before settling on a wording. + +1. **Understand the string.** Decide what it denotes: an action, an object, a + status, or a field value. What it denotes decides the wording. A state or + field name should be checked against its backend definition rather than + guessed from the label. + +2. **Find where it is used.** Follow the key from the `en/` locale file to the + component that renders it, and note how it is shown — a button, a heading, a + tooltip, a filter option, or a state label. Check the commit that added the + string to `en/`; it usually carries the component change as well. If the key + is composed at runtime from a prefix and a variable, search for the prefix + and work out which values the variable can take; the component tests often + render one of them. If the key does not appear in the UI at all, fall back + to the neighboring keys. + +3. **Reuse existing zh-TW wording.** Search the locale files under + `airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/` for the same or + similar terms; they are the authoritative glossary. + +4. **Translate from the English source** in `en/`, the primary reference for + meaning. + +5. **Compare with the other locales.** Check how the same key was translated + in the other `locales/` folders. A different approach there is not a reason + to switch on its own, but it is a reason to think again: go back to the + English string and decide whether the difference points at something you + missed. ### Additional Terminology diff --git a/.github/actions/breeze/action.yml b/.github/actions/breeze/action.yml index 9fe5b55109612..d7c780e06e023 100644 --- a/.github/actions/breeze/action.yml +++ b/.github/actions/breeze/action.yml @@ -22,6 +22,11 @@ inputs: python-version: description: 'Python version to use' default: "3.11" + free-space: + description: >- + Whether to free disk space on the runner. It needs swap control and docker, which the ubuntu-slim + container runner does not have, so jobs on ubuntu-slim pass "false". + default: "true" outputs: host-python-version: description: Python version used in host @@ -55,6 +60,7 @@ runs: env: PYTHON_VERSION: "${{ inputs.python-version }}" - name: "Free space" + if: inputs.free-space == 'true' shell: bash run: breeze ci free-space env: diff --git a/.github/actions/prepare_breeze_and_image/action.yml b/.github/actions/prepare_breeze_and_image/action.yml index 263db0346d444..7cad3d170337a 100644 --- a/.github/actions/prepare_breeze_and_image/action.yml +++ b/.github/actions/prepare_breeze_and_image/action.yml @@ -71,6 +71,11 @@ runs: else ./scripts/tools/free_up_disk_space.sh fi + - name: "Configure runner for parallel tests" + shell: bash + run: ./scripts/ci/configure_runner_for_parallel_tests.sh + # Only self-hosted runners are large enough to run more test types at once than the default pools fit. + if: runner.environment == 'self-hosted' - name: "Install Breeze" uses: ./.github/actions/breeze id: breeze diff --git a/.github/actions/runs-on-cost-summary/action.yml b/.github/actions/runs-on-cost-summary/action.yml index fd0d2007f103c..d31493ae7462f 100644 --- a/.github/actions/runs-on-cost-summary/action.yml +++ b/.github/actions/runs-on-cost-summary/action.yml @@ -19,7 +19,7 @@ # Puts the job's EC2 cost next to the GitHub-hosted price in the job summary. Used by every job # that can run on RunsOn: through the breeze action, or directly by jobs that do not install Breeze. name: 'RunsOn cost summary' -description: 'Add the EC2 cost of a RunsOn job to its summary; a no-op elsewhere.' +description: 'Add the EC2 cost and CPU and memory use of a RunsOn job to its summary; a no-op elsewhere.' runs: using: 'composite' steps: @@ -28,3 +28,5 @@ runs: uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0 with: show_costs: summary + # Charts the job's CPU and memory use in its summary, to size its runner class from measurements. + metrics: cpu,memory diff --git a/.github/workflows/additional-prod-image-tests.yml b/.github/workflows/additional-prod-image-tests.yml index a0109fb65a642..5df6fd20f000d 100644 --- a/.github/workflows/additional-prod-image-tests.yml +++ b/.github/workflows/additional-prod-image-tests.yml @@ -76,6 +76,10 @@ on: # yamllint disable-line rule:truthy description: "Whether to run TypeScript SDK e2e tests (true/false)" required: true type: string + run-yaml-dag-e2e-tests: + description: "Whether to run YAML Dag e2e tests (true/false)" + required: true + type: string providers-compatibility-tests-matrix: description: "JSON matrix of released Airflow versions for the OpenLineage e2e compat tests." required: true @@ -201,7 +205,7 @@ jobs: timeout-minutes: 60 name: "Docker Compose quick start with PROD image verifying" if: inputs.run-generic-prod-image-tests == 'true' - runs-on: ${{ format(fromJSON(inputs.runners)[0], '32+64', '128+256') }} + runs-on: ${{ format(fromJSON(inputs.runners)[0], '8+16', '32+64') }} env: PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}" GITHUB_REPOSITORY: ${{ github.repository }} @@ -331,7 +335,7 @@ jobs: uses: ./.github/workflows/airflow-e2e-tests.yml with: workflow-name: "Event driven e2e test" - runners: ${{ format(inputs.runners, '32+64', '128+256') }} + runners: ${{ format(inputs.runners, '8+16', '32+64') }} platform: ${{ inputs.platform }} default-python-version: "${{ inputs.default-python-version }}" use-uv: ${{ inputs.use-uv }} @@ -359,7 +363,7 @@ jobs: uses: ./.github/workflows/airflow-e2e-tests.yml with: workflow-name: "Go SDK e2e test" - runners: ${{ format(inputs.runners, '32+64', '128+256') }} + runners: ${{ format(inputs.runners, '8+16', '32+64') }} platform: ${{ inputs.platform }} default-python-version: "${{ inputs.default-python-version }}" use-uv: ${{ inputs.use-uv }} @@ -373,7 +377,7 @@ jobs: uses: ./.github/workflows/airflow-e2e-tests.yml with: workflow-name: "TypeScript SDK e2e test" - runners: ${{ format(inputs.runners, '32+64', '128+256') }} + runners: ${{ format(inputs.runners, '8+16', '32+64') }} platform: ${{ inputs.platform }} default-python-version: "${{ inputs.default-python-version }}" use-uv: ${{ inputs.use-uv }} @@ -382,6 +386,20 @@ jobs: (inputs.canary-run == 'true' && inputs.run-generic-prod-image-tests == 'true') || inputs.run-ts-sdk-e2e-tests == 'true' + test-e2e-integration-tests-yaml-dag: + name: "YAML Dag e2e tests with PROD image" + uses: ./.github/workflows/airflow-e2e-tests.yml + with: + workflow-name: "YAML Dag e2e test" + runners: ${{ format(inputs.runners, '8+16', '32+64') }} + platform: ${{ inputs.platform }} + default-python-version: "${{ inputs.default-python-version }}" + use-uv: ${{ inputs.use-uv }} + e2e_test_mode: "yaml_dag" + if: >- + (inputs.canary-run == 'true' && inputs.run-generic-prod-image-tests == 'true') || + inputs.run-yaml-dag-e2e-tests == 'true' + test-e2e-integration-tests-openlineage: name: "OpenLineage e2e tests with PROD image" uses: ./.github/workflows/airflow-e2e-tests.yml diff --git a/.github/workflows/airflow-e2e-tests.yml b/.github/workflows/airflow-e2e-tests.yml index 2b33bdf894827..184eeb6ac7330 100644 --- a/.github/workflows/airflow-e2e-tests.yml +++ b/.github/workflows/airflow-e2e-tests.yml @@ -49,7 +49,7 @@ on: # yamllint disable-line rule:truthy type: string required: true e2e_test_mode: - description: "Test mode - basic, remote_log, remote_log_elasticsearch, remote_log_opensearch, xcom_object_storage, event_driven, java_sdk, go_sdk, or ts_sdk" # yamllint disable-line rule:line-length + description: "Test mode - basic, remote_log, remote_log_elasticsearch, remote_log_opensearch, xcom_object_storage, event_driven, java_sdk, go_sdk, ts_sdk, or yaml_dag" # yamllint disable-line rule:line-length type: string default: "basic" java-sdk-version: @@ -84,7 +84,7 @@ on: # yamllint disable-line rule:truthy type: string default: "" e2e_test_mode: - description: "Test mode - basic, remote_log, remote_log_elasticsearch, remote_log_opensearch, xcom_object_storage, event_driven, java_sdk, go_sdk, or ts_sdk" # yamllint disable-line rule:line-length + description: "Test mode - basic, remote_log, remote_log_elasticsearch, remote_log_opensearch, xcom_object_storage, event_driven, java_sdk, go_sdk, ts_sdk, or yaml_dag" # yamllint disable-line rule:line-length type: string default: "basic" java-sdk-version: @@ -157,13 +157,13 @@ jobs: # separate version pin to keep in sync; cache: false because the explicit # restore/save pair below persists the module + build caches even on red runs. - name: "Setup Go for the Go SDK build" - if: inputs.e2e_test_mode == 'go_sdk' + if: inputs.e2e_test_mode == 'go_sdk' || inputs.e2e_test_mode == 'yaml_dag' uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go-sdk/go.mod cache: false - name: "Restore Go SDK module + build cache" - if: inputs.e2e_test_mode == 'go_sdk' + if: inputs.e2e_test_mode == 'go_sdk' || inputs.e2e_test_mode == 'yaml_dag' id: go-cache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: @@ -191,7 +191,7 @@ jobs: env: DOCKER_IMAGE: "${{ inputs.docker-image-tag }}" E2E_TEST_MODE: "${{ inputs.e2e_test_mode }}" - LANG_SDK_NATIVE_TOOLCHAIN: "${{ (inputs.e2e_test_mode == 'java_sdk' || inputs.e2e_test_mode == 'go_sdk' || inputs.e2e_test_mode == 'ts_sdk') && 'true' || 'false' }}" # yamllint disable-line rule:line-length + LANG_SDK_NATIVE_TOOLCHAIN: "${{ (inputs.e2e_test_mode == 'java_sdk' || inputs.e2e_test_mode == 'go_sdk' || inputs.e2e_test_mode == 'ts_sdk' || inputs.e2e_test_mode == 'yaml_dag') && 'true' || 'false' }}" # yamllint disable-line rule:line-length - name: "Save Java SDK Gradle dependency cache" # Saved even when the e2e tests fail: the Gradle warm-up is independent of # test outcome, and actions/cache's post step would drop it on every red run. @@ -207,7 +207,7 @@ jobs: key: ${{ steps.gradle-cache.outputs.cache-primary-key }} - name: "Save Go SDK module + build cache" # Saved even when the e2e tests fail, for the same reason as the Gradle cache above. - if: always() && inputs.e2e_test_mode == 'go_sdk' && steps.go-cache.outputs.cache-hit != 'true' + if: always() && (inputs.e2e_test_mode == 'go_sdk' || inputs.e2e_test_mode == 'yaml_dag') && steps.go-cache.outputs.cache-hit != 'true' # yamllint disable-line rule:line-length uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index d1b84c5a1567d..86f59d5f1ac35 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -148,7 +148,7 @@ jobs: # Without a pin uv picks the runner's system Python, which can be older than Airflow supports. UV_PYTHON: "${{ inputs.default-python-version }}" SHARED_DISTRIBUTIONS: ${{ join(fromJSON(inputs.shared-distributions-as-json), ' ') }} - runs-on: ${{ format(fromJSON(inputs.runners)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(inputs.runners)[0], '4+8', '16+32') }} steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -255,7 +255,7 @@ jobs: check-translation-completness: timeout-minutes: 15 name: "Check translation completeness" - runs-on: ${{ format(fromJSON(inputs.runners)[0], '32+64', '128+256') }} + runs-on: ${{ format(fromJSON(inputs.runners)[0], '4+8', '16+32') }} steps: - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/ci-amd.yml b/.github/workflows/ci-amd.yml index 75c3ff8edc4f1..31f81ea7df2c3 100644 --- a/.github/workflows/ci-amd.yml +++ b/.github/workflows/ci-amd.yml @@ -165,8 +165,9 @@ jobs: # Fork CI gate (AIP-120): decides whether project CI runs for this event. Configuration and # code come from the base branch so a pull request cannot change its own eligibility. See # dev/breeze/doc/ci/08_fork_ci_for_external_contributors.md. A pull request whose CI runs - # in the contributor's fork and changes this job, or how build-info depends on it, is closed - # by the fork CI monitor ("Gate protection" in that document). + # in the contributor's fork and changes this job, how build-info depends on it, any job that + # runs when it skips build-info (such as ci-passed), or the name of any job is closed by the + # fork CI monitor ("Gate protection" in that document). name: "Fork CI gate" runs-on: ["ubuntu-slim"] timeout-minutes: 5 @@ -263,8 +264,9 @@ jobs: if: >- needs.gate.outputs.project-ci == 'true' && needs.check-run-needed.outputs.run-needed == 'true' - # At build-info stage we do not yet have outputs so we need to hard-code the runs-on to public runners - runs-on: ["ubuntu-22.04"] + # At build-info stage we do not yet have outputs so the runs-on is hard-coded. ubuntu-slim is enough: + # it only installs breeze and runs selective checks, which need neither docker nor freeing disk space. + runs-on: ["ubuntu-slim"] outputs: all-python-versions-list-as-string: >- ${{ steps.selective-checks.outputs.all-python-versions-list-as-string }} @@ -303,6 +305,7 @@ jobs: kubernetes-versions-list-as-string: >- ${{ steps.selective-checks.outputs.kubernetes-versions-list-as-string }} kustomize-overlay-names: ${{ steps.selective-checks.outputs.kustomize-overlay-names }} + lang-sdk-conformance-sdks: ${{ steps.selective-checks.outputs.lang-sdk-conformance-sdks }} run-kustomize-overlays-tests: ${{ steps.selective-checks.outputs.run-kustomize-overlays-tests }} latest-versions-only: ${{ steps.selective-checks.outputs.latest-versions-only }} mysql-exclude: ${{ steps.selective-checks.outputs.mysql-exclude }} @@ -319,6 +322,10 @@ jobs: ${{ steps.selective-checks.outputs.providers-compatibility-tests-matrix }} providers-test-types-list-as-strings-in-json: >- ${{ steps.selective-checks.outputs.providers-test-types-list-as-strings-in-json }} + providers-split-test-types-list-as-strings-in-json: >- + ${{ steps.selective-checks.outputs.providers-split-test-types-list-as-strings-in-json }} + providers-xdist-test-types-list-as-strings-in-json: >- + ${{ steps.selective-checks.outputs.providers-xdist-test-types-list-as-strings-in-json }} pull-request-labels: ${{ steps.source-run-info.outputs.pr-labels }} python-versions-list-as-string: ${{ steps.selective-checks.outputs.python-versions-list-as-string }} python-versions: ${{ steps.selective-checks.outputs.python-versions }} @@ -347,6 +354,7 @@ jobs: run-openlineage-e2e-tests: ${{ steps.selective-checks.outputs.run-openlineage-e2e-tests }} run-openlineage-e2e-compat-tests: ${{ steps.selective-checks.outputs.run-openlineage-e2e-compat-tests }} run-ts-sdk-e2e-tests: ${{ steps.selective-checks.outputs.run-ts-sdk-e2e-tests }} + run-yaml-dag-e2e-tests: ${{ steps.selective-checks.outputs.run-yaml-dag-e2e-tests }} run-system-tests: ${{ steps.selective-checks.outputs.run-system-tests }} run-task-sdk-tests: ${{ steps.selective-checks.outputs.run-task-sdk-tests }} run-task-sdk-integration-tests: ${{ steps.selective-checks.outputs.run-task-sdk-integration-tests }} @@ -372,9 +380,6 @@ jobs: upgrade-to-newer-dependencies: ${{ steps.selective-checks.outputs.upgrade-to-newer-dependencies }} is-uv-lock-update: ${{ steps.selective-checks.outputs.is-uv-lock-update }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -397,6 +402,8 @@ jobs: || echo "::warning::Could not fetch ${PUSH_BASE_COMMIT}, all tests will run" - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" id: breeze - name: "Save github context to file" # The github context can be very large for PRs that touch many files (e.g. Dependabot @@ -797,7 +804,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '8+16', '32+128') }} + runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '32+64', '128+256') }} platform: ${{ needs.build-info.outputs.platform }} backend: "postgres" test-name: "Postgres" @@ -808,7 +815,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.postgres-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-migration-tests: "true" run-coverage: ${{ needs.build-info.outputs.run-coverage }} @@ -856,7 +863,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '8+16', '32+128') }} + runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '32+64', '128+256') }} platform: ${{ needs.build-info.outputs.platform }} backend: "mysql" test-name: "MySQL" @@ -867,7 +874,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.mysql-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} run-migration-tests: "true" @@ -916,7 +923,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '8+16', '32+128') }} + runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '32+64', '128+256') }} platform: ${{ needs.build-info.outputs.platform }} backend: "sqlite" test-name: "Sqlite" @@ -929,7 +936,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.sqlite-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} run-migration-tests: "true" @@ -990,7 +997,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.sqlite-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-xdist-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} debug-resources: ${{ needs.build-info.outputs.debug-resources }} @@ -1020,6 +1027,8 @@ jobs: ${{ needs.build-info.outputs.core-test-types-list-as-strings-in-json }} providers-test-types-list-as-strings-in-json: > ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + providers-split-test-types-list-as-strings-in-json: > + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} default-python-version: "${{ needs.build-info.outputs.default-python-version }}" python-versions: ${{ needs.build-info.outputs.python-versions }} @@ -1169,6 +1178,7 @@ jobs: providers-compatibility-tests-matrix: > ${{ needs.build-info.outputs.providers-compatibility-tests-matrix }} run-ts-sdk-e2e-tests: ${{ needs.build-info.outputs.run-ts-sdk-e2e-tests }} + run-yaml-dag-e2e-tests: ${{ needs.build-info.outputs.run-yaml-dag-e2e-tests }} use-uv: ${{ needs.build-info.outputs.use-uv }} run-ui-e2e-tests: ${{ needs.build-info.outputs.run-ui-e2e-tests }} run-airflow-ctl-integration-tests: ${{ needs.build-info.outputs.run-airflow-ctl-integration-tests }} @@ -1206,7 +1216,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.runner-type, '32+64', '128+256') }} + runners: ${{ format(needs.build-info.outputs.runner-type, '8+16', '32+64') }} platform: ${{ needs.build-info.outputs.platform }} default-python-version: "${{ needs.build-info.outputs.default-python-version }}" python-versions: ${{ needs.build-info.outputs.python-versions }} @@ -1291,7 +1301,7 @@ jobs: tests-ts-sdk: name: "TypeScript SDK tests" needs: [build-info] - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '4+8', '16+32') }} timeout-minutes: 15 permissions: contents: read @@ -1327,7 +1337,7 @@ jobs: tests-java-sdk: name: "Java SDK tests" needs: [build-info] - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '32+64', '128+256') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} timeout-minutes: 15 permissions: contents: read @@ -1356,10 +1366,64 @@ jobs: working-directory: ./java-sdk run: ./gradlew test + tests-lang-sdk-conformance: + name: "Lang SDK serialization conformance (${{ matrix.sdk }})" + needs: [build-info] + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + timeout-minutes: 20 + permissions: + contents: read + strategy: + fail-fast: false + matrix: + sdk: ${{ fromJSON(needs.build-info.outputs.lang-sdk-conformance-sdks) }} + if: needs.build-info.outputs.lang-sdk-conformance-sdks != '[]' + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: "RunsOn cost summary" + uses: ./.github/actions/runs-on-cost-summary + # Serializes the same Dags with Airflow, from airflow-core's sources, to compare them. + - name: "Install uv" + uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0 + with: + python-version: "${{ needs.build-info.outputs.default-python-version }}" + - name: Setup Go + if: matrix.sdk == 'go' + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: go-sdk/go.mod + cache-dependency-path: go-sdk/go.sum + - name: Setup Java + if: matrix.sdk == 'java' + uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 + with: + distribution: 'temurin' + java-version: ${{ env.JAVA_VERSION }} + - name: Setup pnpm + if: matrix.sdk == 'ts' + uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + with: + package_json_file: ts-sdk/package.json + run_install: false + - name: Setup node + if: matrix.sdk == 'ts' + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: "24.19.0" + cache: 'pnpm' + cache-dependency-path: ts-sdk/pnpm-lock.yaml + - name: "Check the ${{ matrix.sdk }} SDK serializes Dags the way Airflow does" + env: + SDK: ${{ matrix.sdk }} + run: python3 "scripts/ci/lang_sdk_serialization/check_${SDK}_sdk.py" + build-java-sdk-docs: name: "Java SDK docs" needs: [build-info] - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '4+8', '16+32') }} timeout-minutes: 30 permissions: contents: read @@ -1495,6 +1559,7 @@ jobs: - tests-go-sdk - tests-java-sdk - tests-ts-sdk + - tests-lang-sdk-conformance - build-java-sdk-docs - build-ts-sdk-docs - tests-with-lowest-direct-resolution-core @@ -1548,6 +1613,7 @@ jobs: - tests-java-sdk - tests-kubernetes - tests-kustomize-overlays + - tests-lang-sdk-conformance - tests-mysql-core - tests-mysql-providers - tests-non-db-core @@ -1615,6 +1681,7 @@ jobs: - tests-java-sdk - tests-kubernetes - tests-kustomize-overlays + - tests-lang-sdk-conformance - tests-mysql-core - tests-mysql-providers - tests-non-db-core @@ -1772,7 +1839,7 @@ jobs: - tests-special - tests-with-lowest-direct-resolution-core - tests-with-lowest-direct-resolution-providers - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '4+8', '16+32') }} if: needs.build-info.outputs.run-unit-tests == 'true' steps: - name: "Cleanup repo" diff --git a/.github/workflows/ci-arm.yml b/.github/workflows/ci-arm.yml index 341e1e021603e..09b0967b49040 100644 --- a/.github/workflows/ci-arm.yml +++ b/.github/workflows/ci-arm.yml @@ -144,8 +144,9 @@ jobs: name: "Build info" needs: [check-run-needed] if: needs.check-run-needed.outputs.run-needed == 'true' - # At build-info stage we do not yet have outputs so we need to hard-code the runs-on to public runners - runs-on: ["ubuntu-22.04"] + # At build-info stage we do not yet have outputs so the runs-on is hard-coded. ubuntu-slim is enough: + # it only installs breeze and runs selective checks, which need neither docker nor freeing disk space. + runs-on: ["ubuntu-slim"] outputs: all-python-versions-list-as-string: >- ${{ steps.selective-checks.outputs.all-python-versions-list-as-string }} @@ -184,6 +185,7 @@ jobs: kubernetes-versions-list-as-string: >- ${{ steps.selective-checks.outputs.kubernetes-versions-list-as-string }} kustomize-overlay-names: ${{ steps.selective-checks.outputs.kustomize-overlay-names }} + lang-sdk-conformance-sdks: ${{ steps.selective-checks.outputs.lang-sdk-conformance-sdks }} run-kustomize-overlays-tests: ${{ steps.selective-checks.outputs.run-kustomize-overlays-tests }} latest-versions-only: ${{ steps.selective-checks.outputs.latest-versions-only }} mysql-exclude: ${{ steps.selective-checks.outputs.mysql-exclude }} @@ -200,6 +202,10 @@ jobs: ${{ steps.selective-checks.outputs.providers-compatibility-tests-matrix }} providers-test-types-list-as-strings-in-json: >- ${{ steps.selective-checks.outputs.providers-test-types-list-as-strings-in-json }} + providers-split-test-types-list-as-strings-in-json: >- + ${{ steps.selective-checks.outputs.providers-split-test-types-list-as-strings-in-json }} + providers-xdist-test-types-list-as-strings-in-json: >- + ${{ steps.selective-checks.outputs.providers-xdist-test-types-list-as-strings-in-json }} pull-request-labels: ${{ steps.source-run-info.outputs.pr-labels }} python-versions-list-as-string: ${{ steps.selective-checks.outputs.python-versions-list-as-string }} python-versions: ${{ steps.selective-checks.outputs.python-versions }} @@ -228,6 +234,7 @@ jobs: run-openlineage-e2e-tests: ${{ steps.selective-checks.outputs.run-openlineage-e2e-tests }} run-openlineage-e2e-compat-tests: ${{ steps.selective-checks.outputs.run-openlineage-e2e-compat-tests }} run-ts-sdk-e2e-tests: ${{ steps.selective-checks.outputs.run-ts-sdk-e2e-tests }} + run-yaml-dag-e2e-tests: ${{ steps.selective-checks.outputs.run-yaml-dag-e2e-tests }} run-system-tests: ${{ steps.selective-checks.outputs.run-system-tests }} run-task-sdk-tests: ${{ steps.selective-checks.outputs.run-task-sdk-tests }} run-task-sdk-integration-tests: ${{ steps.selective-checks.outputs.run-task-sdk-integration-tests }} @@ -253,9 +260,6 @@ jobs: upgrade-to-newer-dependencies: ${{ steps.selective-checks.outputs.upgrade-to-newer-dependencies }} is-uv-lock-update: ${{ steps.selective-checks.outputs.is-uv-lock-update }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -278,6 +282,8 @@ jobs: || echo "::warning::Could not fetch ${PUSH_BASE_COMMIT}, all tests will run" - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" id: breeze - name: "Save github context to file" # The github context can be very large for PRs that touch many files (e.g. Dependabot @@ -678,7 +684,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '8+16', '32+128') }} + runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '32+64', '128+256') }} platform: ${{ needs.build-info.outputs.platform }} backend: "postgres" test-name: "Postgres" @@ -689,7 +695,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.postgres-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-migration-tests: "true" run-coverage: ${{ needs.build-info.outputs.run-coverage }} @@ -737,7 +743,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '8+16', '32+128') }} + runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '32+64', '128+256') }} platform: ${{ needs.build-info.outputs.platform }} backend: "mysql" test-name: "MySQL" @@ -748,7 +754,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.mysql-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} run-migration-tests: "true" @@ -797,7 +803,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '8+16', '32+128') }} + runners: ${{ format(needs.build-info.outputs.in-memory-runner-type, '32+64', '128+256') }} platform: ${{ needs.build-info.outputs.platform }} backend: "sqlite" test-name: "Sqlite" @@ -810,7 +816,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.sqlite-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} run-migration-tests: "true" @@ -871,7 +877,7 @@ jobs: excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }} excludes: ${{ needs.build-info.outputs.sqlite-exclude }} test-types-as-strings-in-json: > - ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + ${{ needs.build-info.outputs.providers-xdist-test-types-list-as-strings-in-json }} include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} debug-resources: ${{ needs.build-info.outputs.debug-resources }} @@ -901,6 +907,8 @@ jobs: ${{ needs.build-info.outputs.core-test-types-list-as-strings-in-json }} providers-test-types-list-as-strings-in-json: > ${{ needs.build-info.outputs.providers-test-types-list-as-strings-in-json }} + providers-split-test-types-list-as-strings-in-json: > + ${{ needs.build-info.outputs.providers-split-test-types-list-as-strings-in-json }} run-coverage: ${{ needs.build-info.outputs.run-coverage }} default-python-version: "${{ needs.build-info.outputs.default-python-version }}" python-versions: ${{ needs.build-info.outputs.python-versions }} @@ -1050,6 +1058,7 @@ jobs: providers-compatibility-tests-matrix: > ${{ needs.build-info.outputs.providers-compatibility-tests-matrix }} run-ts-sdk-e2e-tests: ${{ needs.build-info.outputs.run-ts-sdk-e2e-tests }} + run-yaml-dag-e2e-tests: ${{ needs.build-info.outputs.run-yaml-dag-e2e-tests }} use-uv: ${{ needs.build-info.outputs.use-uv }} run-ui-e2e-tests: ${{ needs.build-info.outputs.run-ui-e2e-tests }} run-airflow-ctl-integration-tests: ${{ needs.build-info.outputs.run-airflow-ctl-integration-tests }} @@ -1087,7 +1096,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(needs.build-info.outputs.runner-type, '32+64', '128+256') }} + runners: ${{ format(needs.build-info.outputs.runner-type, '8+16', '32+64') }} platform: ${{ needs.build-info.outputs.platform }} default-python-version: "${{ needs.build-info.outputs.default-python-version }}" python-versions: ${{ needs.build-info.outputs.python-versions }} @@ -1172,7 +1181,7 @@ jobs: tests-ts-sdk: name: "TypeScript SDK tests" needs: [build-info] - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '4+8', '16+32') }} timeout-minutes: 15 permissions: contents: read @@ -1208,7 +1217,7 @@ jobs: tests-java-sdk: name: "Java SDK tests" needs: [build-info] - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '32+64', '128+256') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} timeout-minutes: 15 permissions: contents: read @@ -1237,10 +1246,64 @@ jobs: working-directory: ./java-sdk run: ./gradlew test + tests-lang-sdk-conformance: + name: "Lang SDK serialization conformance (${{ matrix.sdk }})" + needs: [build-info] + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + timeout-minutes: 20 + permissions: + contents: read + strategy: + fail-fast: false + matrix: + sdk: ${{ fromJSON(needs.build-info.outputs.lang-sdk-conformance-sdks) }} + if: needs.build-info.outputs.lang-sdk-conformance-sdks != '[]' + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: "RunsOn cost summary" + uses: ./.github/actions/runs-on-cost-summary + # Serializes the same Dags with Airflow, from airflow-core's sources, to compare them. + - name: "Install uv" + uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0 + with: + python-version: "${{ needs.build-info.outputs.default-python-version }}" + - name: Setup Go + if: matrix.sdk == 'go' + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: go-sdk/go.mod + cache-dependency-path: go-sdk/go.sum + - name: Setup Java + if: matrix.sdk == 'java' + uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 + with: + distribution: 'temurin' + java-version: ${{ env.JAVA_VERSION }} + - name: Setup pnpm + if: matrix.sdk == 'ts' + uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + with: + package_json_file: ts-sdk/package.json + run_install: false + - name: Setup node + if: matrix.sdk == 'ts' + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: "24.19.0" + cache: 'pnpm' + cache-dependency-path: ts-sdk/pnpm-lock.yaml + - name: "Check the ${{ matrix.sdk }} SDK serializes Dags the way Airflow does" + env: + SDK: ${{ matrix.sdk }} + run: python3 "scripts/ci/lang_sdk_serialization/check_${SDK}_sdk.py" + build-java-sdk-docs: name: "Java SDK docs" needs: [build-info] - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '4+8', '16+32') }} timeout-minutes: 30 permissions: contents: read @@ -1376,6 +1439,7 @@ jobs: - tests-go-sdk - tests-java-sdk - tests-ts-sdk + - tests-lang-sdk-conformance - build-java-sdk-docs - build-ts-sdk-docs - tests-with-lowest-direct-resolution-core @@ -1428,6 +1492,7 @@ jobs: - tests-java-sdk - tests-kubernetes - tests-kustomize-overlays + - tests-lang-sdk-conformance - tests-mysql-core - tests-mysql-providers - tests-non-db-core @@ -1494,6 +1559,7 @@ jobs: - tests-java-sdk - tests-kubernetes - tests-kustomize-overlays + - tests-lang-sdk-conformance - tests-mysql-core - tests-mysql-providers - tests-non-db-core @@ -1651,7 +1717,7 @@ jobs: - tests-special - tests-with-lowest-direct-resolution-core - tests-with-lowest-direct-resolution-providers - runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '4+8', '16+32') }} if: needs.build-info.outputs.run-unit-tests == 'true' steps: - name: "Cleanup repo" diff --git a/.github/workflows/finalize-tests.yml b/.github/workflows/finalize-tests.yml index 9715a8cfc6124..d9d5c463b154f 100644 --- a/.github/workflows/finalize-tests.yml +++ b/.github/workflows/finalize-tests.yml @@ -80,7 +80,7 @@ permissions: contents: read jobs: update-constraints: - runs-on: ${{ format(fromJSON(inputs.runners)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(inputs.runners)[0], '4+8', '16+32') }} timeout-minutes: 80 name: "Update constraints" permissions: diff --git a/.github/workflows/generate-constraints.yml b/.github/workflows/generate-constraints.yml index 17a460aaa6889..fc801924ccda9 100644 --- a/.github/workflows/generate-constraints.yml +++ b/.github/workflows/generate-constraints.yml @@ -53,6 +53,14 @@ on: # yamllint disable-line rule:truthy required: false default: "false" type: string + fail-on-pending-provider-candidates: + description: > + Fail the PyPI constraints when a provider's newest version is a release candidate that was + neither released nor yanked (true/false). Set when constraints are cut for a final release, + which must not pin a candidate nor silently pass over one. + required: false + default: "false" + type: string pypi-providers-only: description: > Resolve against providers exactly as published on PyPI (true/false). Skips building the @@ -168,9 +176,12 @@ jobs: # both paths set it would make it unclear which one is in force. Empty on a normal run, # so the unquoted expansion below contributes no argument at all. PRE_RELEASE_FLAG: ${{ inputs.allow-pre-releases == 'true' && '--allow-pre-releases' || '' }} + PENDING_CANDIDATES_FLAG: >- + ${{ inputs.fail-on-pending-provider-candidates == 'true' + && '--fail-on-pending-provider-candidates' || '' }} run: | breeze release-management generate-constraints --airflow-constraints-mode constraints \ - --answer yes --python "${PYTHON_VERSION}" ${PRE_RELEASE_FLAG} + --answer yes --python "${PYTHON_VERSION}" ${PRE_RELEASE_FLAG} ${PENDING_CANDIDATES_FLAG} if: inputs.generate-pypi-constraints == 'true' - name: "Check for provider downgrade alert" id: downgrade-alert @@ -191,6 +202,7 @@ jobs: if: always() && steps.downgrade-alert.outputs.notify == 'true' uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0 with: + method: chat.postMessage token: ${{ secrets.SLACK_BOT_TOKEN }} payload-file-path: ${{ steps.downgrade-alert.outputs.message-file }} - name: "Upload constraint artifacts" diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index cf140b98c623e..f8000a7c4dd19 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -98,7 +98,7 @@ jobs: tests-helm-release: timeout-minutes: 80 name: "Release Helm" - runs-on: ${{ format(fromJSON(inputs.runners)[0], '8+16', '32+64') }} + runs-on: ${{ format(fromJSON(inputs.runners)[0], '4+8', '16+32') }} env: PYTHON_MAJOR_MINOR_VERSION: "${{inputs.default-python-version}}" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration-system-tests.yml b/.github/workflows/integration-system-tests.yml index 8b24223a55f93..e61e4070e0c1b 100644 --- a/.github/workflows/integration-system-tests.yml +++ b/.github/workflows/integration-system-tests.yml @@ -75,7 +75,7 @@ jobs: timeout-minutes: 30 if: inputs.testable-core-integrations != '[]' name: "Integration core ${{ matrix.integration }}" - runs-on: ${{ format(fromJSON(inputs.runners)[0], '32+64', '128+256') }} + runs-on: ${{ format(fromJSON(inputs.runners)[0], '8+16', '32+64') }} strategy: fail-fast: false max-parallel: 20 diff --git a/.github/workflows/mirror-hardened-base-images.yml b/.github/workflows/mirror-hardened-base-images.yml index b7eac54c31806..cfba2ab849b85 100644 --- a/.github/workflows/mirror-hardened-base-images.yml +++ b/.github/workflows/mirror-hardened-base-images.yml @@ -27,31 +27,80 @@ name: Mirror hardened base images # # `docker buildx imagetools create` copies the multi-platform manifest between registries without # pulling the layers into the runner, so a refresh of all Python versions is cheap. +# +# The builds do not use these moving tags: they are pinned to digests that only "breeze ci upgrade" +# moves, in a PR that has to pass the full CI. Docker rebuilds the images in place and moves the +# dhi.io apt repository on together with them, so a pin left behind soon stops matching what apt +# installs. A run that moves a tag past its pin therefore triggers that upgrade check, and the pins +# follow Docker's rebuilds within hours. on: # yamllint disable-line rule:truthy workflow_dispatch: + inputs: + trigger-upgrade-check: + description: >- + Run the main upgrade check when a tag moves past its pin. "breeze ci upgrade" for main turns + it off, as it is the upgrade that pins the images. + type: boolean + default: true schedule: - # Docker rebuilds the hardened images as CVEs are fixed, keeping the same tags. Re-running - # weekly is what picks those rebuilds up. - - cron: '27 4 * * 1' + - cron: '27 */6 * * *' permissions: contents: read concurrency: group: mirror-hardened-base-images cancel-in-progress: false jobs: + # Picks the runner the way CI does: RunsOn in apache/airflow, public runners when the repository + # variable USE_PUBLIC_RUNNERS is "true". + build-info: + name: "Build info" + runs-on: ["ubuntu-slim"] + timeout-minutes: 10 + if: github.repository == 'apache/airflow' && github.ref == 'refs/heads/main' + permissions: + contents: read + outputs: + runner-type: ${{ steps.selective-checks.outputs.runner-type }} + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + persist-credentials: false + - name: "Install Breeze" + uses: ./.github/actions/breeze + with: + free-space: "false" + - name: "Save github context to file" + # Same as in ci-amd.yml: a scheduled or dispatched run has no attacker-controlled context, and + # the single-quoted heredoc disables every shell expansion of the JSON anyway. + shell: bash + run: | # zizmor: ignore[template-injection] + cat > "${RUNNER_TEMP}/github_context.json" << '__GITHUB_CONTEXT_END__' + ${{ toJson(github) }} + __GITHUB_CONTEXT_END__ + - name: "Selective checks" + id: selective-checks + env: + COMMIT_REF: "${{ github.sha }}" + VERBOSE: "false" + GITHUB_CONTEXT_INPUT: "${{ runner.temp }}/github_context.json" + PLATFORM: "linux/amd64" + USE_PUBLIC_RUNNERS: "${{ vars.USE_PUBLIC_RUNNERS }}" + run: breeze ci selective-check 2>> ${GITHUB_OUTPUT} mirror: name: "Mirror hardened base images" - runs-on: ["ubuntu-22.04"] + needs: [build-info] + # Copies manifests registry-to-registry without pulling layers, so the smallest class is enough. + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '2+4', '8+16') }} + timeout-minutes: 30 # Never runs on forks - they have neither the credentials nor the package to push to. Only main - # and the v3-*-test release branches may push: the mirror is the default BASE_IMAGE of every - # build, so a manual dispatch from any other branch must not be able to replace it. - if: >- - github.repository == 'apache/airflow' && ( - github.ref == 'refs/heads/main' || ( - startsWith(github.ref, 'refs/heads/v3-') && endsWith(github.ref, '-test') - ) - ) + # pushes: the mirror is the default BASE_IMAGE of every build, so a manual dispatch from any other + # branch must not be able to replace it. Main mirrors every Python version an active release + # branch still builds on, so the release branches need no runs of their own. + if: github.repository == 'apache/airflow' && github.ref == 'refs/heads/main' permissions: + actions: write contents: read packages: write steps: @@ -77,4 +126,15 @@ jobs: ACTOR: ${{ github.actor }} run: echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${ACTOR}" --password-stdin - name: "Mirror base images" + id: mirror run: breeze release-management mirror-base-images + # Only main's pins: release branches move theirs on their own upgrade schedule. Also after a + # failed mirror step: a tag it moved before failing stays moved, so a re-run would not see it + # move again. + - name: "Trigger the upgrade check to move the pinned base images" + if: >- + !cancelled() && steps.mirror.outputs.moved-past-pins == 'true' && + (github.event_name == 'schedule' || inputs.trigger-upgrade-check) + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh workflow run scheduled-upgrade-check-main.yml --repo "${GITHUB_REPOSITORY}" --ref main diff --git a/.github/workflows/publish-docs-to-s3.yml b/.github/workflows/publish-docs-to-s3.yml index b039ff9674739..8cc9f6829fd16 100644 --- a/.github/workflows/publish-docs-to-s3.yml +++ b/.github/workflows/publish-docs-to-s3.yml @@ -75,7 +75,7 @@ jobs: build-info: timeout-minutes: 10 name: "Build Info" - runs-on: ["ubuntu-24.04"] + runs-on: ["ubuntu-slim"] env: VERBOSE: true REF: ${{ inputs.ref }} @@ -113,6 +113,7 @@ jobs: image-stash-ref: "publish-docs-${{ inputs.ref }}" registry-providers: ${{ steps.derive_registry_inputs.outputs.registry-providers }} registry-full-build: ${{ steps.derive_registry_inputs.outputs.registry-full-build }} + docs-kind: ${{ steps.docs_kind.outputs.docs-kind }} if: contains(fromJSON('[ "ashb", "bugraoz93", @@ -178,6 +179,26 @@ jobs: exit 0 fi python3 dev/registry/derive_wave_providers.py + - name: "Classify the published docs" + id: docs_kind + env: + INCLUDE_DOCS: ${{ inputs.include-docs }} + shell: bash + # Provider and Airflow docs land in different paths of the bucket, so the publish job + # serialises each kind separately. A full build or a mixed list counts as `airflow`. + # Same non-provider list as the registry step above. + run: | + NON_PROVIDER_TOKENS=("all" "apache-airflow" "apache-airflow-ctl" "apache-airflow-mypy" "task-sdk" "java-sdk" "ts-sdk" "helm-chart" "docker-stack") + kind=providers + for token in $INCLUDE_DOCS; do + for np in "${NON_PROVIDER_TOKENS[@]}"; do + if [[ "$token" == "$np" ]]; then + kind=airflow + fi + done + done + echo "Publishing ${kind} docs ('${INCLUDE_DOCS}')." + echo "docs-kind=${kind}" >> "${GITHUB_OUTPUT}" - name: "Derive the default Python version" id: default_python shell: bash @@ -585,6 +606,14 @@ jobs: needs.build-ts-sdk-docs.result == 'success' && needs.update-registry.result != 'failure' name: "Publish documentation to S3" + outputs: + docs-synced: ${{ steps.sync_docs.outcome == 'success' }} + # Keyed on the resolved destination rather than the `destination` input, whose `auto` stands + # for either bucket, and on the kind of docs, so provider and Airflow publishes do not wait + # for each other. The bucket-wide packages-metadata.json is left to update-packages-metadata. + concurrency: + group: publish-docs-${{ needs.build-info.outputs.destination }}-${{ needs.build-info.outputs.docs-kind }} + cancel-in-progress: false permissions: id-token: write contents: read @@ -697,6 +726,7 @@ jobs: aws-secret-access-key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }} aws-region: us-east-2 - name: "Syncing docs to S3" + id: sync_docs env: DESTINATION_LOCATION: "${{ needs.build-info.outputs.destination-location }}" SOURCE_DIR_PATH: "/mnt/airflow-site/docs-archive/" @@ -705,7 +735,8 @@ jobs: run: | breeze release-management publish-docs-to-s3 --source-dir-path ${SOURCE_DIR_PATH} \ --destination-location ${DESTINATION_LOCATION} --stable-versions \ - --exclude-docs "${EXCLUDE_DOCS}" --overwrite ${SKIP_WRITE_TO_STABLE_FOLDER} + --exclude-docs "${EXCLUDE_DOCS}" --overwrite ${SKIP_WRITE_TO_STABLE_FOLDER} \ + --skip-packages-metadata - name: "Download schema artifacts" if: needs.build-info.outputs.publish-execution-api-schema == 'true' || needs.build-info.outputs.publish-supervisor-schema == 'true' || needs.build-info.outputs.publish-dag-schema == 'true' uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 @@ -735,6 +766,45 @@ jobs: breeze release-management publish-schemas-to-s3 \ --destination-location "${SCHEMAS_DESTINATION}" "${args[@]}" + update-packages-metadata: + needs: [build-info, publish-docs-to-s3] + # Keyed on the sync step rather than the job, so a schema publish failing after a complete sync + # still gets its docs into the metadata, while a partial sync is not advertised. + if: ${{ !cancelled() && needs.publish-docs-to-s3.outputs.docs-synced == 'true' }} + name: "Update packages metadata in S3" + # packages-metadata.json is rebuilt from a scan of every package in the bucket, so provider and + # Airflow publishes share it. One group per bucket keeps a scan from missing a version another + # run is still writing; a pending run cancelled by a later one loses nothing, as that later run + # rescans the whole bucket. + concurrency: + group: publish-docs-metadata-${{ needs.build-info.outputs.destination }} + cancel-in-progress: false + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: "Cleanup repo" + shell: bash + run: sudo rm -rf ${GITHUB_WORKSPACE}/* + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: "Install Breeze" + uses: ./.github/actions/breeze + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 + with: + aws-access-key-id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-2 + - name: "Regenerate packages-metadata.json" + env: + DESTINATION_LOCATION: "${{ needs.build-info.outputs.destination-location }}" + run: > + breeze release-management publish-docs-to-s3 + --destination-location ${DESTINATION_LOCATION} --packages-metadata-only + update-registry: # Runs alongside the docs build rather than after it: the registry reads nothing the docs # build produces, so ordering the two only added its whole duration to the wait. The publish diff --git a/.github/workflows/refresh-image-registry-cache.yml b/.github/workflows/refresh-image-registry-cache.yml index e133222cf2d62..2eb1821f4742d 100644 --- a/.github/workflows/refresh-image-registry-cache.yml +++ b/.github/workflows/refresh-image-registry-cache.yml @@ -65,7 +65,7 @@ jobs: build-info: name: "Build info" # No outputs yet at this stage, so the runner has to be hard-coded to a public one. - runs-on: ["ubuntu-22.04"] + runs-on: ["ubuntu-slim"] outputs: default-branch: ${{ steps.selective-checks.outputs.default-branch }} default-constraints-branch: ${{ steps.selective-checks.outputs.default-constraints-branch }} @@ -75,15 +75,14 @@ jobs: python-versions: ${{ steps.selective-checks.outputs.python-versions }} use-uv: ${{ steps.selective-checks.outputs.force-pip == 'true' && 'false' || 'true' }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" - name: Selective checks id: selective-checks env: diff --git a/.github/workflows/registry-backfill.yml b/.github/workflows/registry-backfill.yml index e47631e2d19dc..6dd2967594a02 100644 --- a/.github/workflows/registry-backfill.yml +++ b/.github/workflows/registry-backfill.yml @@ -283,6 +283,12 @@ jobs: needs: [prepare, backfill] runs-on: ubuntu-latest name: "Publish versions.json" + # Shares registry-build.yml's group, so it never runs alongside a registry publish to the same + # bucket. Only this job: the backfill matrix writes per-version paths of its own, and putting + # a matrix in one group would cancel all but two of its entries. + concurrency: + group: registry-publish-${{ inputs.destination }} + cancel-in-progress: false steps: - name: "Checkout repository" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/registry-build.yml b/.github/workflows/registry-build.yml index afc3fa59ae3c8..7afc284682f60 100644 --- a/.github/workflows/registry-build.yml +++ b/.github/workflows/registry-build.yml @@ -93,6 +93,15 @@ jobs: build-and-publish-registry: timeout-minutes: 45 name: "Build & Publish Registry" + # An incremental build downloads the bucket's providers.json and modules.json, merges its own + # providers in and syncs them back, so two publishes to one bucket at once lose whichever + # finishes first. Shared with registry-backfill.yml's publish job; set on the job because this + # workflow is also called from publish-docs-to-s3.yml. GitHub keeps one pending run per group, + # so a third publish cancels the waiting one: that run shows as cancelled and is re-run, which + # beats the silent loss this replaces. + concurrency: + group: registry-publish-${{ inputs.destination }} + cancel-in-progress: false # On a dispatch this enforces the committer allowlist below; on the `workflow_call` path the # caller has already gated on its own allowlist, so this must not re-check it against a # second, separately-maintained copy. diff --git a/.github/workflows/release-constraints.yml b/.github/workflows/release-constraints.yml index fe74f5527f7d4..cceb80cd5ee25 100644 --- a/.github/workflows/release-constraints.yml +++ b/.github/workflows/release-constraints.yml @@ -52,7 +52,7 @@ jobs: build-info: timeout-minutes: 10 name: "Build info" - runs-on: ["ubuntu-22.04"] + runs-on: ["ubuntu-slim"] if: contains(fromJSON('[ "ashb", "eladkal", @@ -74,9 +74,6 @@ jobs: target-branch: ${{ steps.stage.outputs.target-branch }} allow-pre-releases: ${{ steps.stage.outputs.allow-pre-releases }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ inputs.ref }}" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -85,6 +82,8 @@ jobs: persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" id: breeze - name: "Save github context to file" # See ci-amd.yml for the full rationale: avoids ARG_MAX on big PRs by writing the @@ -188,6 +187,9 @@ jobs: # the constraints, which is exactly the version the release needed pinned. pypi-providers-only: "true" allow-pre-releases: ${{ needs.build-info.outputs.allow-pre-releases }} + # A final must not be cut while a provider candidate is still neither released nor yanked. + fail-on-pending-provider-candidates: >- + ${{ needs.build-info.outputs.allow-pre-releases == 'true' && 'false' || 'true' }} debug-resources: "false" checkout-ref: ${{ inputs.ref }} use-uv: "true" @@ -199,6 +201,11 @@ jobs: timeout-minutes: 20 name: "Publish and tag constraints" needs: [build-info, generate-constraints] + # Shared with the publish jobs of update-constraints-on-push.yml and + # update-constraints-on-push-stable.yml, so they never push to the same constraints branch at once. + concurrency: + group: constraints-publish-${{ needs.build-info.outputs.target-branch }} + cancel-in-progress: false permissions: contents: write packages: read diff --git a/.github/workflows/release_dockerhub_image.yml b/.github/workflows/release_dockerhub_image.yml index 4c65a55381588..dad4ac52f7ea1 100644 --- a/.github/workflows/release_dockerhub_image.yml +++ b/.github/workflows/release_dockerhub_image.yml @@ -35,7 +35,7 @@ permissions: contents: read packages: read concurrency: - group: ${{ github.event.inputs.airflowVersion }} + group: release-dockerhub-image-${{ github.event.inputs.airflowVersion }} cancel-in-progress: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -44,7 +44,7 @@ jobs: build-info: timeout-minutes: 10 name: "Build Info" - runs-on: ["ubuntu-24.04"] + runs-on: ["ubuntu-slim"] outputs: pythonVersions: ${{ steps.determine-python-versions.outputs.python-versions }} platformMatrix: ${{ steps.determine-matrix.outputs.platformMatrix }} @@ -81,17 +81,14 @@ jobs: echo "Airflow version: '${AIRFLOW_VERSION}'" echo "AMD only: '${AMD_ONLY}'" echo "Limit python versions: '${LIMIT_PYTHON_VERSIONS}'" - - name: "Cleanup repo" - shell: bash - run: > - sudo rm -rf ${GITHUB_WORKSPACE}/* - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" - name: "Save github context to file" # See ci-amd.yml for the full rationale: avoids ARG_MAX on big PRs by writing the # github context to a file, and the single-quoted heredoc makes the zizmor diff --git a/.github/workflows/scheduled-legacy-prod-image-canary.yml b/.github/workflows/scheduled-legacy-prod-image-canary.yml index ad395431d0fc9..db8b8a154eb8e 100644 --- a/.github/workflows/scheduled-legacy-prod-image-canary.yml +++ b/.github/workflows/scheduled-legacy-prod-image-canary.yml @@ -36,7 +36,7 @@ concurrency: jobs: build-info: name: "Build info" - runs-on: ["ubuntu-22.04"] + runs-on: ["ubuntu-slim"] if: github.repository == 'apache/airflow' || github.event_name == 'workflow_dispatch' timeout-minutes: 15 outputs: @@ -68,12 +68,10 @@ jobs: run-remote-logging-s3-e2e-tests: ${{ steps.selective-checks.outputs.run-remote-logging-s3-e2e-tests }} run-task-sdk-integration-tests: ${{ steps.selective-checks.outputs.run-task-sdk-integration-tests }} run-ts-sdk-e2e-tests: ${{ steps.selective-checks.outputs.run-ts-sdk-e2e-tests }} + run-yaml-dag-e2e-tests: ${{ steps.selective-checks.outputs.run-yaml-dag-e2e-tests }} run-ui-e2e-tests: ${{ steps.selective-checks.outputs.run-ui-e2e-tests }} use-uv: ${{ steps.selective-checks.outputs.force-pip == 'true' && 'false' || 'true' }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -81,6 +79,8 @@ jobs: persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" - name: "Save github context to file" # Same as in ci-amd.yml: a scheduled or dispatched run has no attacker-controlled context, and # the single-quoted heredoc disables every shell expansion of the JSON anyway. @@ -236,6 +236,7 @@ jobs: providers-compatibility-tests-matrix: > ${{ needs.build-info.outputs.providers-compatibility-tests-matrix }} run-ts-sdk-e2e-tests: ${{ needs.build-info.outputs.run-ts-sdk-e2e-tests }} + run-yaml-dag-e2e-tests: ${{ needs.build-info.outputs.run-yaml-dag-e2e-tests }} use-uv: ${{ needs.build-info.outputs.use-uv }} run-ui-e2e-tests: ${{ needs.build-info.outputs.run-ui-e2e-tests }} run-airflow-ctl-integration-tests: ${{ needs.build-info.outputs.run-airflow-ctl-integration-tests }} diff --git a/.github/workflows/scheduled-upgrade-check-main.yml b/.github/workflows/scheduled-upgrade-check-main.yml index 1c828f86b0368..ee0ab72a15ab3 100644 --- a/.github/workflows/scheduled-upgrade-check-main.yml +++ b/.github/workflows/scheduled-upgrade-check-main.yml @@ -25,6 +25,8 @@ on: # yamllint disable-line rule:truthy permissions: contents: write pull-requests: write + # Only the job of upgrade-check.yml that dispatches the "Mirror hardened base images" workflow gets it. + actions: write jobs: upgrade-main: name: "[main] Upgrade" diff --git a/.github/workflows/scheduled-upgrade-check-v3-4-test.yml b/.github/workflows/scheduled-upgrade-check-v3-4-test.yml index 604fcb2ed8f97..9d51e87cec49d 100644 --- a/.github/workflows/scheduled-upgrade-check-v3-4-test.yml +++ b/.github/workflows/scheduled-upgrade-check-v3-4-test.yml @@ -25,6 +25,8 @@ on: # yamllint disable-line rule:truthy permissions: contents: write pull-requests: write + # Only the job of upgrade-check.yml that dispatches the "Mirror hardened base images" workflow gets it. + actions: write jobs: upgrade-v3-4-test: name: "[v3-4-test] Upgrade" diff --git a/.github/workflows/special-tests.yml b/.github/workflows/special-tests.yml index 09658246df9a6..1b47ac5259a47 100644 --- a/.github/workflows/special-tests.yml +++ b/.github/workflows/special-tests.yml @@ -44,6 +44,10 @@ on: # yamllint disable-line rule:truthy description: "The list of providers test types to run separated by spaces" required: true type: string + providers-split-test-types-list-as-strings-in-json: + description: "The providers test types for the jobs running them in parallel in the CI image" + required: true + type: string run-coverage: description: "Whether to run coverage or not (true/false)" required: true @@ -123,7 +127,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(inputs.in-memory-runners, '8+16', '32+128') }} + runners: ${{ format(inputs.in-memory-runners, '32+64', '128+256') }} platform: ${{ inputs.platform }} downgrade-sqlalchemy: "true" test-name: "MinSQLAlchemy-Postgres" @@ -134,7 +138,7 @@ jobs: backend-versions: "['${{ inputs.default-postgres-version }}']" excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }} excludes: "[]" - test-types-as-strings-in-json: ${{ inputs.providers-test-types-list-as-strings-in-json }} + test-types-as-strings-in-json: ${{ inputs.providers-split-test-types-list-as-strings-in-json }} run-coverage: ${{ inputs.run-coverage }} debug-resources: ${{ inputs.debug-resources }} skip-providers-tests: ${{ inputs.skip-providers-tests }} @@ -173,7 +177,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(inputs.in-memory-runners, '8+16', '32+128') }} + runners: ${{ format(inputs.in-memory-runners, '32+64', '128+256') }} platform: ${{ inputs.platform }} upgrade-sqlalchemy: "true" test-name: "LatestSQLAlchemy-Postgres" @@ -184,7 +188,7 @@ jobs: backend-versions: "['${{ inputs.default-postgres-version }}']" excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }} excludes: "[]" - test-types-as-strings-in-json: ${{ inputs.providers-test-types-list-as-strings-in-json }} + test-types-as-strings-in-json: ${{ inputs.providers-split-test-types-list-as-strings-in-json }} run-coverage: ${{ inputs.run-coverage }} debug-resources: ${{ inputs.debug-resources }} skip-providers-tests: ${{ inputs.skip-providers-tests }} @@ -224,7 +228,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(inputs.in-memory-runners, '8+16', '32+128') }} + runners: ${{ format(inputs.in-memory-runners, '32+64', '128+256') }} platform: ${{ inputs.platform }} upgrade-boto: "true" test-name: "LatestBoto-Postgres" @@ -235,7 +239,7 @@ jobs: backend-versions: "['${{ inputs.default-postgres-version }}']" excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }} excludes: "[]" - test-types-as-strings-in-json: ${{ inputs.providers-test-types-list-as-strings-in-json }} + test-types-as-strings-in-json: ${{ inputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ inputs.include-success-outputs }} run-coverage: ${{ inputs.run-coverage }} debug-resources: ${{ inputs.debug-resources }} @@ -276,7 +280,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(inputs.in-memory-runners, '8+16', '32+128') }} + runners: ${{ format(inputs.in-memory-runners, '32+64', '128+256') }} platform: ${{ inputs.platform }} downgrade-pendulum: "true" test-name: "Pendulum2-Postgres" @@ -287,7 +291,7 @@ jobs: backend-versions: "['${{ inputs.default-postgres-version }}']" excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }} excludes: "[]" - test-types-as-strings-in-json: ${{ inputs.providers-test-types-list-as-strings-in-json }} + test-types-as-strings-in-json: ${{ inputs.providers-split-test-types-list-as-strings-in-json }} include-success-outputs: ${{ inputs.include-success-outputs }} run-coverage: ${{ inputs.run-coverage }} debug-resources: ${{ inputs.debug-resources }} @@ -352,7 +356,7 @@ jobs: contents: read packages: read with: - runners: ${{ format(inputs.runners, '32+64', '128+256') }} + runners: ${{ format(inputs.runners, '8+16', '32+64') }} platform: ${{ inputs.platform }} test-name: "SystemTest" test-scope: "System" diff --git a/.github/workflows/update-constraints-on-push-stable.yml b/.github/workflows/update-constraints-on-push-stable.yml index 744ee4bc93fff..b4904dbed5470 100644 --- a/.github/workflows/update-constraints-on-push-stable.yml +++ b/.github/workflows/update-constraints-on-push-stable.yml @@ -35,7 +35,7 @@ env: jobs: build-info: name: "Build info" - runs-on: ["ubuntu-22.04"] + runs-on: ["ubuntu-slim"] outputs: default-branch: ${{ steps.selective-checks.outputs.default-branch }} default-constraints-branch: ${{ steps.selective-checks.outputs.default-constraints-branch }} @@ -43,9 +43,6 @@ jobs: python-versions: ${{ steps.selective-checks.outputs.python-versions }} python-versions-list-as-string: ${{ steps.selective-checks.outputs.python-versions-list-as-string }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -58,6 +55,8 @@ jobs: persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" id: breeze - name: "Save github context to file" # See ci-amd.yml for the full rationale: avoids ARG_MAX on big PRs by writing the @@ -119,6 +118,10 @@ jobs: timeout-minutes: 20 name: "Commit and push constraints" needs: [build-info, generate-constraints] + # Shared with the other constraints publishers, so they never push to one branch at once. + concurrency: + group: constraints-publish-${{ needs.build-info.outputs.default-constraints-branch }} + cancel-in-progress: false permissions: contents: write packages: read diff --git a/.github/workflows/update-constraints-on-push.yml b/.github/workflows/update-constraints-on-push.yml index ba55e09d9eb2e..6dbce8cbac40f 100644 --- a/.github/workflows/update-constraints-on-push.yml +++ b/.github/workflows/update-constraints-on-push.yml @@ -73,7 +73,7 @@ env: jobs: build-info: name: "Build info" - runs-on: ["ubuntu-22.04"] + runs-on: ["ubuntu-slim"] # Automatic uv.lock-push runs are unrestricted; manual (workflow_dispatch) # runs are limited to release managers (same allowlist as the prod image # release workflow) because they push to the protected constraints-* branches. @@ -99,10 +99,8 @@ jobs: default-python-version: ${{ steps.selective-checks.outputs.default-python-version }} python-versions: ${{ steps.selective-checks.outputs.python-versions }} python-versions-list-as-string: ${{ steps.selective-checks.outputs.python-versions-list-as-string }} + constraints-baseline-sha: ${{ steps.constraints-baseline.outputs.sha }} steps: - - name: "Cleanup repo" - shell: bash - run: sudo rm -rf ${GITHUB_WORKSPACE}/* - name: "Checkout ${{ inputs.ref || github.ref }} ( ${{ inputs.ref || github.sha }} )" uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -111,6 +109,8 @@ jobs: persist-credentials: false - name: "Install Breeze" uses: ./.github/actions/breeze + with: + free-space: "false" id: breeze - name: "Save github context to file" # See ci-amd.yml for the full rationale: avoids ARG_MAX on big PRs by writing the @@ -129,6 +129,19 @@ jobs: VERBOSE: "false" GITHUB_CONTEXT_INPUT: "${{ runner.temp }}/github_context.json" run: breeze ci selective-check 2>> ${GITHUB_OUTPUT} + # Recorded before the constraints are generated, so any commit landing on the branch while + # this run works - a release candidate's constraints above all - stops the publish below + # instead of being overwritten by pins resolved against the older baseline. + - name: "Record the constraints baseline" + id: constraints-baseline + shell: bash + env: + CONSTRAINTS_BRANCH: ${{ steps.selective-checks.outputs.default-constraints-branch }} + run: | + sha="$(git ls-remote "/${GITHUB_REPOSITORY}" \ + "refs/heads/${CONSTRAINTS_BRANCH}" | cut -f1)" + echo "sha=${sha}" >> "${GITHUB_OUTPUT}" + echo "Constraints baseline: ${CONSTRAINTS_BRANCH} @ ${sha:-}" - name: "Parameters summary" shell: bash env: @@ -196,6 +209,11 @@ jobs: timeout-minutes: 20 name: "Commit and push constraints" needs: [build-info, generate-constraints] + # Shared with the other constraints publishers. The baseline check below still decides + # whether this run may publish at all; this only stops the two pushes overlapping. + concurrency: + group: constraints-publish-${{ needs.build-info.outputs.default-constraints-branch }} + cancel-in-progress: false permissions: contents: write packages: read @@ -217,6 +235,20 @@ jobs: ref: ${{ env.CONSTRAINTS_BRANCH }} persist-credentials: true fetch-depth: 0 + - name: "Check ${{ env.CONSTRAINTS_BRANCH }} did not move while the constraints were generated" + working-directory: "constraints" + env: + BASELINE_SHA: ${{ needs.build-info.outputs.constraints-baseline-sha }} + run: | + current_sha="$(git rev-parse HEAD)" + if [[ -n "${BASELINE_SHA}" && "${current_sha}" != "${BASELINE_SHA}" ]]; then + echo "::error::${CONSTRAINTS_BRANCH} moved from ${BASELINE_SHA} to ${current_sha}" \ + "while this run generated its constraints. Publishing would overwrite those commits" \ + "with pins resolved against the older baseline. Re-run the workflow so it starts" \ + "from the current branch." + git log --oneline "${BASELINE_SHA}..${current_sha}" || true + exit 1 + fi - name: "Download constraints from the generate-constraints job" uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/upgrade-check.yml b/.github/workflows/upgrade-check.yml index 1a5747d3c7b59..791fd58d925d5 100644 --- a/.github/workflows/upgrade-check.yml +++ b/.github/workflows/upgrade-check.yml @@ -30,18 +30,89 @@ on: # yamllint disable-line rule:truthy description: "Slack bot token for notifications" required: true permissions: - contents: write - pull-requests: write + contents: read env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} TARGET_BRANCH: ${{ inputs.target-branch }} jobs: + # Picks the runner of the upgrade the way CI does: RunsOn in apache/airflow, public runners in forks + # or when the repository variable USE_PUBLIC_RUNNERS is "true". + build-info: + name: >- + [${{ inputs.target-branch }}] Build info + runs-on: ["ubuntu-slim"] + timeout-minutes: 10 + permissions: + contents: read + outputs: + runner-type: ${{ steps.selective-checks.outputs.runner-type }} + steps: + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 2 + persist-credentials: false + - name: "Install Breeze" + uses: ./.github/actions/breeze + with: + free-space: "false" + - name: "Save github context to file" + # Same as in ci-amd.yml: a scheduled or dispatched run has no attacker-controlled context, and + # the single-quoted heredoc disables every shell expansion of the JSON anyway. + shell: bash + run: | # zizmor: ignore[template-injection] + cat > "${RUNNER_TEMP}/github_context.json" << '__GITHUB_CONTEXT_END__' + ${{ toJson(github) }} + __GITHUB_CONTEXT_END__ + - name: "Selective checks" + id: selective-checks + env: + COMMIT_REF: "${{ github.sha }}" + VERBOSE: "false" + GITHUB_CONTEXT_INPUT: "${{ runner.temp }}/github_context.json" + PLATFORM: "linux/amd64" + USE_PUBLIC_RUNNERS: "${{ vars.USE_PUBLIC_RUNNERS }}" + run: breeze ci selective-check 2>> ${GITHUB_OUTPUT} + # A job of its own, so the token that may dispatch workflows never reaches the upgrade job, which + # runs the third-party tools and hooks it upgrades. It only dispatches the mirror and waits for it. + mirror-base-images: + timeout-minutes: 30 + name: >- + [${{ inputs.target-branch }}] Mirror hardened base images + runs-on: ["ubuntu-slim"] + permissions: + actions: write + contents: read + steps: + - name: >- + [${{ inputs.target-branch }}] Checkout main + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: main + persist-credentials: false + - name: >- + [${{ inputs.target-branch }}] Install Breeze + uses: ./.github/actions/breeze + with: + free-space: "false" + # The upgrade for main is the one the mirror would otherwise start a second time. + - name: >- + [${{ inputs.target-branch }}] Mirror the base images and wait for the run + env: + TRIGGER_UPGRADE_CHECK_FLAG: >- + ${{ inputs.target-branch == 'main' && '--no-trigger-upgrade-check' || '--trigger-upgrade-check' }} + run: breeze workflow-run mirror-base-images "${TRIGGER_UPGRADE_CHECK_FLAG}" createupgrade-check: timeout-minutes: 45 name: >- [${{ inputs.target-branch }}] Upgrade checks and PR - runs-on: ["ubuntu-22.04"] + # Builds the CI image for the uv.lock refresh and runs every hook, like the CI image builds. + runs-on: ${{ format(fromJSON(needs.build-info.outputs.runner-type)[0], '8+16', '32+64') }} + needs: [build-info, mirror-base-images] + permissions: + contents: write + pull-requests: write steps: - name: >- [${{ inputs.target-branch }}] Cleanup repo @@ -85,6 +156,7 @@ jobs: --switch-to-base --no-k8s-schema-sync --latest-package-managers + --no-mirror-base-images --answer yes - name: >- [${{ inputs.target-branch }}] Find upgrade PR diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92e716ce9b35b..45c3a6d87aa85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,6 +27,8 @@ default_env: # the committed ones. Hooks in nested configs do not inherit this and must pass --frozen to uv themselves. UV_FROZEN: "1" exclude: ^.*/.*_vendor/ +# Hooks with `priority: 1000` run in parallel, after every other hook in this file. Only the hooks +# listed in scripts/ci/prek/check_prek_parallel_hooks.py may set a priority. repos: - repo: meta hooks: @@ -251,6 +253,19 @@ repos: ^scripts/ci/license-templates/ - repo: local hooks: + # Hooks with `priority: 1000` start in the order they appear in this file. This hook takes the + # longest of them, so it comes first. Because it needs the CI image, it would normally go in the + # CI image section at the end of this file. Its priority still makes it run after every hook that + # has no priority. + - id: check-template-fields-valid + name: Check templated fields mapped in operators/sensors + env: + PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 + language: python + entry: ./scripts/ci/prek/check_template_fields.py + files: ^(providers/[^/]+|airflow-core)/src/airflow/(.*/)?(sensors|operators)/.*\.py$ + require_serial: true - id: check-min-python-version name: Check minimum Python version env: @@ -500,62 +515,6 @@ repos: ^scripts/ci/prek/check_go_sdk_generated_drift\.py$ pass_filenames: false require_serial: true - # check-ts-sdk-serialization-conformance in ts-sdk/ covers the SDK's own files; this runs the same - # check when the shared harness or Airflow's serializer changes, which that project cannot see. - - id: check-ts-sdk-serialization-conformance-shared - name: Check the TS SDK serializes Dags the way Airflow does, after a shared change - env: - PYTHONPYCACHEPREFIX: .build/pycache - description: "Serialize the shared test Dags with the TS SDK and with Airflow, and compare the two" - entry: ./ts-sdk/scripts/ci/prek/check_serialization_conformance.py - language: node - additional_dependencies: ['pnpm@10.28.1'] - pass_filenames: false - require_serial: true - files: > - (?x) - ^airflow-core/src/airflow/serialization/serialized_objects\.py$| - ^airflow-core/src/airflow/serialization/schema\.json$| - ^scripts/ci/lang_sdk_serialization/.*$ - - id: check-go-sdk-serialization-conformance - name: Check the Go SDK serializes Dags the way Airflow does - env: - PYTHONPYCACHEPREFIX: .build/pycache - description: "Serialize the shared test Dags with the Go SDK and with Airflow, and compare the two" - entry: ./scripts/ci/prek/check_go_sdk_serialization_conformance.py - # golang so prek provisions the toolchain that builds the Go serializer. - language: golang - pass_filenames: false - require_serial: true - files: > - (?x) - ^airflow-core/src/airflow/serialization/serialized_objects\.py$| - ^airflow-core/src/airflow/serialization/schema\.json$| - ^go-sdk/airflow/.*\.go$| - ^go-sdk/schema/dag-schema\.json$| - ^scripts/ci/lang_sdk_serialization/.*$| - ^scripts/ci/prek/check_go_sdk_serialization_conformance\.py$ - - id: check-java-sdk-serialization-conformance - name: Check the Java SDK serializes Dags the way Airflow does - env: - PYTHONPYCACHEPREFIX: .build/pycache - description: "Serialize the shared test Dags with the Java SDK and with Airflow, and compare the two" - entry: ./java-sdk/scripts/ci/prek/check_serialization_conformance.py - language: system - pass_filenames: false - require_serial: true - files: > - (?x) - ^airflow-core/src/airflow/serialization/serialized_objects\.py$| - ^airflow-core/src/airflow/serialization/schema\.json$| - ^java-sdk/scripts/ci/prek/check_serialization_conformance\.py$| - ^java-sdk/sdk/schema/dag-schema\.json$| - ^java-sdk/sdk/build\.gradle\.kts$| - ^java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/(Switch|Bundle|Condition|DagDef|Decider|Deps|Arg|TaskGroupRef|TriggerDagRun)\.kt$| - ^java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/execution/Serde\.kt$| - ^java-sdk/sdk/src/main/kotlin/org/apache/airflow/sdk/internal/(Refs|Fields)\.kt$| - ^java-sdk/sdk/src/test/kotlin/org/apache/airflow/sdk/conformance/.*$| - ^scripts/ci/lang_sdk_serialization/.*$ - id: check-go-version-in-sync name: Check Go toolchain version is consistent across build files env: @@ -739,10 +698,12 @@ repos: name: Detect accidentally committed debug statements env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 - id: check-builtin-literals name: Require literal syntax when initializing builtins env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 - id: detect-private-key name: Detect if private key is added to the repository env: @@ -795,6 +756,7 @@ repos: name: Check if there are no deprecate log warn env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 - repo: https://github.com/adrienverge/yamllint rev: cba56bcde1fdd01c1deb3f945e69764c291a6530 # frozen: v1.38.0 hooks: @@ -802,6 +764,7 @@ repos: name: Check YAML files with yamllint env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: yamllint -c yamllint-config.yml --strict types: [yaml] exclude: > @@ -841,6 +804,7 @@ repos: name: Run codespell env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 description: Run codespell to check for common misspellings in files entry: bash -c 'echo "If you think that this failure is an error, consider adding the word(s) to the codespell dictionary at docs/spelling_wordlist.txt. @@ -871,12 +835,13 @@ repos: name: Run zizmor to check for github workflow syntax errors env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 types: [yaml] files: ^\.github/workflows/.*$|^\.github/actions/.*$ require_serial: true entry: zizmor - repo: https://github.com/lycheeverse/lychee - rev: 2bba271688c1abb1503097a064e6c3bc1d1b6a9b # frozen: lychee-lib-v0.24.2 + rev: d9d97b51e395bd72c6498e0c6c4943dcae7b410a # frozen: nightly hooks: # Use the upstream `lychee-docker` variant rather than the script-based # `lychee` hook because the prebuilt lychee binaries that the script @@ -888,6 +853,7 @@ repos: name: Check internal Markdown links with lychee (offline mode) env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 description: >- Validate intra-repo links in Markdown files (relative paths, anchors, and fragments) without making any HTTP requests. Auto-generated client @@ -956,6 +922,7 @@ repos: name: Check for test-only imports in production source env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/check_test_only_imports_in_src.py language: python pass_filenames: true @@ -1028,6 +995,7 @@ repos: name: Lint Dockerfile env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 language: python entry: ./scripts/ci/prek/lint_dockerfile.py files: Dockerfile.*$ @@ -1074,6 +1042,7 @@ repos: name: Prevent deprecated sqlalchemy usage env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/prevent_deprecated_sqlalchemy_usage.py language: python files: > @@ -1202,6 +1171,7 @@ repos: - id: check-for-inclusive-language env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 language: pygrep name: Check for language that we do not accept as community description: Please use more appropriate words for community documentation. @@ -1415,6 +1385,7 @@ repos: name: Check if licenses are OK for Apache env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/check_license.py language: python files: ^LICENSE$ @@ -1423,6 +1394,7 @@ repos: name: Check that metrics in the codebase are in sync with the metrics registry YAML file. env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/check_metrics_synced_with_the_registry.py language: python files: \.py$|^shared/observability/src/airflow_shared/observability/metrics/metrics_template\.yaml$ @@ -1469,6 +1441,7 @@ repos: name: Check Shell scripts syntax correctness env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 language: docker_image entry: koalaman/shellcheck:v0.8.0 -x -a files: \.(bash|sh)$|^hooks/build$|^hooks/push$ @@ -1692,6 +1665,7 @@ repos: name: Run markdownlint env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 description: Checks the style of Markdown files. entry: markdownlint language: node @@ -1856,6 +1830,7 @@ repos: name: Check that all logging methods are lazy env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/check_lazy_logging.py language: python pass_filenames: true @@ -1864,6 +1839,7 @@ repos: name: Check XComModel columns are read through xcom_entity, not directly in SQLAlchemy queries env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/check_xcom_model_columns.py language: python pass_filenames: true @@ -1910,6 +1886,7 @@ repos: name: bandit env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 description: "Bandit is a tool for finding common security issues in Python code" entry: bandit language: python @@ -1979,6 +1956,14 @@ repos: entry: ./scripts/ci/prek/check_prek_hooks_pycache_prefix.py pass_filenames: false files: (^|/)\.pre-commit-config\.yaml$|^scripts/ci/prek/check_prek_hooks_pycache_prefix\.py$ + - id: check-prek-parallel-hooks + name: Only audited hooks run in parallel in the root prek config + env: + PYTHONPYCACHEPREFIX: .build/pycache + language: python + entry: ./scripts/ci/prek/check_prek_parallel_hooks.py + pass_filenames: false + files: ^\.pre-commit-config\.yaml$|^scripts/ci/prek/check_prek_parallel_hooks\.py$ - id: check-migration-patterns name: Check migration files for anti-patterns and style (MIG001-MIG004) env: @@ -1992,14 +1977,6 @@ repos: ## ADD MOST PREK HOOK ABOVE THAT LINE # The below prek hooks are those requiring CI image to be built ## ONLY ADD PREK HOOKS HERE THAT REQUIRE CI IMAGE - - id: check-template-fields-valid - name: Check templated fields mapped in operators/sensors - env: - PYTHONPYCACHEPREFIX: .build/pycache - language: python - entry: ./scripts/ci/prek/check_template_fields.py - files: ^(providers/[^/]+|airflow-core)/src/airflow/(.*/)?(sensors|operators)/.*\.py$ - require_serial: true - id: check-execution-api-versions name: Check execution API datamodel changes have corresponding version updates env: @@ -2073,6 +2050,7 @@ repos: name: Check for problematic context manager class decorators env: PYTHONPYCACHEPREFIX: .build/pycache + priority: 1000 entry: ./scripts/ci/prek/check_contextmanager_class_decorators.py language: python files: .*test.*\.py$ diff --git a/Dockerfile b/Dockerfile index efda9ee3fbb15..2626641d46026 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,25 +54,32 @@ ARG AIRFLOW_VERSION="3.3.2" # image are based on it, so Python is never compiled during the build. # # The default is Airflow's public mirror of the upstream "dhi.io/python" image, so building needs no -# registry credentials. The upstream image itself requires a "docker login dhi.io". +# registry credentials. The upstream image itself requires a "docker login dhi.io". It is pinned to a +# digest, because the mirror's tags move several times a day: "breeze ci upgrade" moves the pin once +# the full CI has passed on the new image. # # The FIPS-validated variants require a paid Docker subscription and cannot be mirrored or made the # default, but you can build a FIPS-compliant image by pointing the build at one: -# docker build . --build-arg BASE_IMAGE="dhi.io/python:3.13.16-debian13-fips-dev" +# docker build . --build-arg BASE_IMAGE="dhi.io/python:3.13.18-debian13-fips-dev" # # AIRFLOW_IMAGE_FLAVOR="legacy" builds the image the way it was built before the hardened base images: # BASE_IMAGE is then a plain Debian image (for example "debian:bookworm-slim") and Python -# AIRFLOW_PYTHON_VERSION is downloaded from python.org, verified and compiled from sources. +# AIRFLOW_PYTHON_VERSION is downloaded from python.org, verified and compiled from sources. A +# MAJOR.MINOR AIRFLOW_PYTHON_VERSION builds the latest release of that line. +# +# AIRFLOW_PYTHON_VERSION is empty by default: the hardened flavor takes Python from BASE_IMAGE, and the +# build fails if a version passed here does not match it. Breeze passes the Python patchlevel that +# "breeze ci upgrade" last moved, so a new patch release also rebuilds the legacy flavor. ARG AIRFLOW_IMAGE_FLAVOR="hardened" -ARG BASE_IMAGE="ghcr.io/apache/airflow/base/python:3.13.16-debian13-dev" -ARG AIRFLOW_PYTHON_VERSION="3.13.16" +ARG BASE_IMAGE="ghcr.io/apache/airflow/base/python:3.13.18-debian13-dev@sha256:a5ef3495cfc3ff8175b90ec1b84b7cfb3528ef3e153b54f9924a8508cd0fd9de" +ARG AIRFLOW_PYTHON_VERSION="" # You can swap comments between those two args to test pip from the main version # When you attempt to test if the version of `pip` from specified branch works for our builds # Also use `force pip` label on your PR to swap all places we use `uv` to `pip` ARG AIRFLOW_PIP_VERSION=26.2.2 # ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main" -ARG AIRFLOW_UV_VERSION=0.13.6 +ARG AIRFLOW_UV_VERSION=0.13.5 ARG AIRFLOW_USE_UV="false" ARG AIRFLOW_IMAGE_REPOSITORY="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/apache/airflow" ARG AIRFLOW_IMAGE_README_URL="https://raw.githubusercontent.com/apache/airflow/main/docs/docker-stack/README.md" @@ -125,7 +132,7 @@ PNPM_VERSION=${PNPM_VERSION:-10.28.1} RUSTUP_DEFAULT_TOOLCHAIN=${RUSTUP_DEFAULT_TOOLCHAIN:-stable} RUSTUP_VERSION=${RUSTUP_VERSION:-1.29.0} AIRFLOW_IMAGE_FLAVOR=${AIRFLOW_IMAGE_FLAVOR:-hardened} -AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-3.13.16} +AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-} COSIGN_VERSION=${COSIGN_VERSION:-3.0.5} if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then # The Debian 12 hardened images ship Python under /opt/python, the Debian 13 ones install it as @@ -133,6 +140,13 @@ if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then PYTHON_HOME=${PYTHON_HOME:-$(python3 -c 'import sys; print(sys.base_prefix)')} # Read before apt runs: a package depending on python3 can pull another Python version in. BASE_PYTHON_MAJOR_MINOR=$(python3 -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")') + if [[ -n "${AIRFLOW_PYTHON_VERSION}" && "${AIRFLOW_PYTHON_VERSION}." != "${BASE_PYTHON_MAJOR_MINOR}."* ]]; then + echo + echo "ERROR! AIRFLOW_PYTHON_VERSION is ${AIRFLOW_PYTHON_VERSION}, but the base image has Python ${BASE_PYTHON_MAJOR_MINOR}." + echo "The hardened flavor takes Python from BASE_IMAGE: leave AIRFLOW_PYTHON_VERSION empty or pick a BASE_IMAGE with that Python." + echo + exit 1 + fi elif [[ "${AIRFLOW_IMAGE_FLAVOR}" == "legacy" ]]; then PYTHON_HOME=${PYTHON_HOME:-/usr/python} else @@ -307,6 +321,24 @@ function keep_image_conffiles() { printf '%s\n' force-confdef force-confold > /etc/dpkg/dpkg.cfg.d/airflow-keep-conffiles } +function prefer_hardened_apt_repository() { + # The hardened base images take their packages from dhi.io, but stock Debian's sources stay + # configured beside it and apt installs whichever repository offers the higher version. Debian's + # build of a package then replaces Docker's, and its dependencies no longer match the packages the + # image ships (docker-hardened-images/catalog#610). Ranking dhi.io above the default priority of + # 500 makes apt take Docker's build whenever dhi.io publishes the package, and fall back to Debian + # only when it does not. + # The priority stays below 1000 so the preference never forces a downgrade: apt still favors + # dhi.io's build of a package it publishes, but may take a newer version from another repository + # when a dependency requires it - for example PGDG's libpq5, which postgresql-client-18 needs at + # ">= 18.6" and dhi.io does not carry. Pinning the base image to a digest CI has passed on keeps + # dhi.io and the image consistent, so the renumbering that once needed a forced "downgrade" of the + # image's copy (docker-hardened-images/catalog#689) no longer arises within a build. + # The preference covers every apt run - this build's and those of images extending it. + mkdir -p /etc/apt/preferences.d + printf 'Package: *\nPin: origin "dhi.io"\nPin-Priority: 999\n' > /etc/apt/preferences.d/airflow-prefer-dhi +} + function refresh_ldconfig_after_dpkg() { # The hardened base images ship libc-bin without its dpkg trigger, so installing a shared library # does not refresh the ldconfig cache and ctypes.util.find_library() - which reads that cache - @@ -366,6 +398,7 @@ function align_perl_base_with_perl() { function install_debian_dev_dependencies() { if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then keep_image_conffiles + prefer_hardened_apt_repository refresh_ldconfig_after_dpkg fi apt-get update @@ -548,8 +581,39 @@ function install_cosign() { chmod +x /tmp/cosign } +function resolve_python_version() { + if [[ -z "${AIRFLOW_PYTHON_VERSION}" ]]; then + echo + echo "ERROR! The legacy flavor compiles Python from sources, so AIRFLOW_PYTHON_VERSION has to name it:" + echo "MAJOR.MINOR for the latest release of that line, or MAJOR.MINOR.PATCH." + echo + exit 1 + fi + if [[ ! "${AIRFLOW_PYTHON_VERSION}" =~ ^[0-9]+\.[0-9]+$ ]]; then + return + fi + # A release directory appears on python.org with its first pre-release, so take the newest one + # that already holds the final tarball. + local candidate + for candidate in $(wget --tries=3 --waitretry=5 -qO- https://www.python.org/ftp/python/ \ + | grep -oE "href=\"${AIRFLOW_PYTHON_VERSION//./\\.}\.[0-9]+/\"" \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r); do + if wget --tries=3 --waitretry=5 -q --spider \ + "https://www.python.org/ftp/python/${candidate}/Python-${candidate}.tar.xz"; then + echo "Python ${AIRFLOW_PYTHON_VERSION} resolved to its latest release ${candidate}" + AIRFLOW_PYTHON_VERSION="${candidate}" + return + fi + done + echo + echo "ERROR! No release of Python ${AIRFLOW_PYTHON_VERSION} found on python.org." + echo + exit 1 +} + function install_python() { # Only the legacy image flavor compiles Python - the hardened flavor gets it from the base image. + resolve_python_version wget --tries=3 --waitretry=5 -O python.tar.xz "https://www.python.org/ftp/python/${AIRFLOW_PYTHON_VERSION%%[a-z]*}/Python-${AIRFLOW_PYTHON_VERSION}.tar.xz" local major_minor_version major_minor_version="${AIRFLOW_PYTHON_VERSION%.*}" @@ -630,6 +694,7 @@ function install_python() { function install_debian_runtime_dependencies() { if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then keep_image_conffiles + prefer_hardened_apt_repository refresh_ldconfig_after_dpkg fi apt-get update @@ -971,6 +1036,12 @@ install_postgres_client() { echo "deb [arch=amd64,arm64] https://apt.postgresql.org/pub/repos/apt/ $(common::debian_codename)-pgdg main" > \ /etc/apt/sources.list.d/pgdg.list + # The hardened image's airflow-prefer-dhi pin outranks Debian's default, so apt would otherwise keep + # dhi.io's libpq (e.g. 17.11) and postgresql-client (which needs a matching, newer libpq5) could not + # install. PostgreSQL's own repository is the authority for its packages - rank it above the dhi.io + # preference so apt takes libpq from PGDG. + mkdir -p /etc/apt/preferences.d + printf 'Package: *\nPin: origin "apt.postgresql.org"\nPin-Priority: 1001\n' > /etc/apt/preferences.d/airflow-prefer-pgdg apt-get update apt-get install --no-install-recommends -y "${packages[@]}" apt-get autoremove -yqq --purge diff --git a/Dockerfile.ci b/Dockerfile.ci index a16046aee4bbc..da16c347219e6 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -22,12 +22,14 @@ # image are based on it, so Python is never compiled during the build. # # The default is Airflow's public mirror of the upstream "dhi.io/python" image, so building needs no -# registry credentials. The upstream image itself requires a "docker login dhi.io". +# registry credentials. The upstream image itself requires a "docker login dhi.io". It is pinned to a +# digest, because the mirror's tags move several times a day: "breeze ci upgrade" moves the pin once +# the full CI has passed on the new image. # # The FIPS-validated variants require a paid Docker subscription and cannot be mirrored or made the # default, but you can build a FIPS-compliant image by pointing the build at one: -# docker build . --build-arg BASE_IMAGE="dhi.io/python:3.13.16-debian13-fips-dev" -ARG BASE_IMAGE="ghcr.io/apache/airflow/base/python:3.13.16-debian13-dev" +# docker build . --build-arg BASE_IMAGE="dhi.io/python:3.13.18-debian13-fips-dev" +ARG BASE_IMAGE="ghcr.io/apache/airflow/base/python:3.13.18-debian13-dev@sha256:a5ef3495cfc3ff8175b90ec1b84b7cfb3528ef3e153b54f9924a8508cd0fd9de" ############################################################################################## # This is the script image where we keep all inlined bash scripts needed in other segments @@ -61,7 +63,7 @@ PNPM_VERSION=${PNPM_VERSION:-10.28.1} RUSTUP_DEFAULT_TOOLCHAIN=${RUSTUP_DEFAULT_TOOLCHAIN:-stable} RUSTUP_VERSION=${RUSTUP_VERSION:-1.29.0} AIRFLOW_IMAGE_FLAVOR=${AIRFLOW_IMAGE_FLAVOR:-hardened} -AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-3.13.16} +AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-} COSIGN_VERSION=${COSIGN_VERSION:-3.0.5} if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then # The Debian 12 hardened images ship Python under /opt/python, the Debian 13 ones install it as @@ -69,6 +71,13 @@ if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then PYTHON_HOME=${PYTHON_HOME:-$(python3 -c 'import sys; print(sys.base_prefix)')} # Read before apt runs: a package depending on python3 can pull another Python version in. BASE_PYTHON_MAJOR_MINOR=$(python3 -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")') + if [[ -n "${AIRFLOW_PYTHON_VERSION}" && "${AIRFLOW_PYTHON_VERSION}." != "${BASE_PYTHON_MAJOR_MINOR}."* ]]; then + echo + echo "ERROR! AIRFLOW_PYTHON_VERSION is ${AIRFLOW_PYTHON_VERSION}, but the base image has Python ${BASE_PYTHON_MAJOR_MINOR}." + echo "The hardened flavor takes Python from BASE_IMAGE: leave AIRFLOW_PYTHON_VERSION empty or pick a BASE_IMAGE with that Python." + echo + exit 1 + fi elif [[ "${AIRFLOW_IMAGE_FLAVOR}" == "legacy" ]]; then PYTHON_HOME=${PYTHON_HOME:-/usr/python} else @@ -243,6 +252,24 @@ function keep_image_conffiles() { printf '%s\n' force-confdef force-confold > /etc/dpkg/dpkg.cfg.d/airflow-keep-conffiles } +function prefer_hardened_apt_repository() { + # The hardened base images take their packages from dhi.io, but stock Debian's sources stay + # configured beside it and apt installs whichever repository offers the higher version. Debian's + # build of a package then replaces Docker's, and its dependencies no longer match the packages the + # image ships (docker-hardened-images/catalog#610). Ranking dhi.io above the default priority of + # 500 makes apt take Docker's build whenever dhi.io publishes the package, and fall back to Debian + # only when it does not. + # The priority stays below 1000 so the preference never forces a downgrade: apt still favors + # dhi.io's build of a package it publishes, but may take a newer version from another repository + # when a dependency requires it - for example PGDG's libpq5, which postgresql-client-18 needs at + # ">= 18.6" and dhi.io does not carry. Pinning the base image to a digest CI has passed on keeps + # dhi.io and the image consistent, so the renumbering that once needed a forced "downgrade" of the + # image's copy (docker-hardened-images/catalog#689) no longer arises within a build. + # The preference covers every apt run - this build's and those of images extending it. + mkdir -p /etc/apt/preferences.d + printf 'Package: *\nPin: origin "dhi.io"\nPin-Priority: 999\n' > /etc/apt/preferences.d/airflow-prefer-dhi +} + function refresh_ldconfig_after_dpkg() { # The hardened base images ship libc-bin without its dpkg trigger, so installing a shared library # does not refresh the ldconfig cache and ctypes.util.find_library() - which reads that cache - @@ -302,6 +329,7 @@ function align_perl_base_with_perl() { function install_debian_dev_dependencies() { if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then keep_image_conffiles + prefer_hardened_apt_repository refresh_ldconfig_after_dpkg fi apt-get update @@ -484,8 +512,39 @@ function install_cosign() { chmod +x /tmp/cosign } +function resolve_python_version() { + if [[ -z "${AIRFLOW_PYTHON_VERSION}" ]]; then + echo + echo "ERROR! The legacy flavor compiles Python from sources, so AIRFLOW_PYTHON_VERSION has to name it:" + echo "MAJOR.MINOR for the latest release of that line, or MAJOR.MINOR.PATCH." + echo + exit 1 + fi + if [[ ! "${AIRFLOW_PYTHON_VERSION}" =~ ^[0-9]+\.[0-9]+$ ]]; then + return + fi + # A release directory appears on python.org with its first pre-release, so take the newest one + # that already holds the final tarball. + local candidate + for candidate in $(wget --tries=3 --waitretry=5 -qO- https://www.python.org/ftp/python/ \ + | grep -oE "href=\"${AIRFLOW_PYTHON_VERSION//./\\.}\.[0-9]+/\"" \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r); do + if wget --tries=3 --waitretry=5 -q --spider \ + "https://www.python.org/ftp/python/${candidate}/Python-${candidate}.tar.xz"; then + echo "Python ${AIRFLOW_PYTHON_VERSION} resolved to its latest release ${candidate}" + AIRFLOW_PYTHON_VERSION="${candidate}" + return + fi + done + echo + echo "ERROR! No release of Python ${AIRFLOW_PYTHON_VERSION} found on python.org." + echo + exit 1 +} + function install_python() { # Only the legacy image flavor compiles Python - the hardened flavor gets it from the base image. + resolve_python_version wget --tries=3 --waitretry=5 -O python.tar.xz "https://www.python.org/ftp/python/${AIRFLOW_PYTHON_VERSION%%[a-z]*}/Python-${AIRFLOW_PYTHON_VERSION}.tar.xz" local major_minor_version major_minor_version="${AIRFLOW_PYTHON_VERSION%.*}" @@ -566,6 +625,7 @@ function install_python() { function install_debian_runtime_dependencies() { if [[ "${AIRFLOW_IMAGE_FLAVOR}" == "hardened" ]]; then keep_image_conffiles + prefer_hardened_apt_repository refresh_ldconfig_after_dpkg fi apt-get update @@ -907,6 +967,12 @@ install_postgres_client() { echo "deb [arch=amd64,arm64] https://apt.postgresql.org/pub/repos/apt/ $(common::debian_codename)-pgdg main" > \ /etc/apt/sources.list.d/pgdg.list + # The hardened image's airflow-prefer-dhi pin outranks Debian's default, so apt would otherwise keep + # dhi.io's libpq (e.g. 17.11) and postgresql-client (which needs a matching, newer libpq5) could not + # install. PostgreSQL's own repository is the authority for its packages - rank it above the dhi.io + # preference so apt takes libpq from PGDG. + mkdir -p /etc/apt/preferences.d + printf 'Package: *\nPin: origin "apt.postgresql.org"\nPin-Priority: 1001\n' > /etc/apt/preferences.d/airflow-prefer-pgdg apt-get update apt-get install --no-install-recommends -y "${packages[@]}" apt-get autoremove -yqq --purge @@ -1779,6 +1845,8 @@ function check_force_lowest_dependencies() { local provider_id # shellcheck disable=SC2001 provider_id=$(echo "${TEST_TYPE}" | sed 's/Providers\[\(.*\)\]/\1/') + # A split provider's test type names one part of its tests: Providers[:] + provider_id=${provider_id%%:*} echo echo "${COLOR_BLUE}Forcing dependencies to lowest versions for provider: ${provider_id}${COLOR_RESET}" echo @@ -1977,7 +2045,8 @@ ENV DEV_APT_COMMAND=${DEV_APT_COMMAND} \ ADDITIONAL_DEV_APT_COMMAND=${ADDITIONAL_DEV_APT_COMMAND} -ARG AIRFLOW_PYTHON_VERSION="3.13.16" +# Empty takes the Python of BASE_IMAGE, breeze passes the patchlevel of the image it builds on. +ARG AIRFLOW_PYTHON_VERSION="" ENV AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION} ENV GOLANG_MAJOR_MINOR_VERSION="1.27.3" ENV TEMURIN_VERSION="11" @@ -2139,7 +2208,7 @@ COPY --from=scripts common.sh install_packaging_tools.sh install_additional_depe # Also use `force pip` label on your PR to swap all places we use `uv` to `pip` ARG AIRFLOW_PIP_VERSION=26.2.2 # ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main" -ARG AIRFLOW_UV_VERSION=0.13.6 +ARG AIRFLOW_UV_VERSION=0.13.5 ARG AIRFLOW_PREK_VERSION="0.5.7" # UV_LINK_MODE=copy is needed since we are using cache mounted from the host diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 8ba25964a38d3..4bf52b0b58f34 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -24,7 +24,7 @@ .. towncrier release notes start -Airflow 3.4.0 (2026-11-02) +Airflow 3.4.0 (2026-11-04) -------------------------- Significant Changes @@ -603,6 +603,17 @@ New Features Bug Fixes ^^^^^^^^^ +- UI: Fix Portuguese and Hungarian labels that show a raw placeholder (#75964) +- Fix the 404 on a looped task group's breadcrumb (#76050) +- Fix stale queued asset rows in scheduler cleanup and readiness (#76002) +- Stop Recent Configurations flashing on the trigger form (#75991) +- Avoid unbounded IN lists for queued asset events (#75943) +- Stop requesting the details of an empty Dag id after a bulk selection (#75862) +- Fix hourly cron schedules running an hour off across a DST change (#75847) +- Preserve XCom value types when editing in the UI (#75496) +- Reject non-object JSON files when importing variables (#75384) +- Fix dashboard Active Dags filtering (#75350) +- Stop a stale callback stat from forcing constant Dag file reparsing (#73433) - UI: Fix a crash caused by an unresolvable Windows PT timezone (#75723) - UI: Stop keyboard shortcuts firing while typing in a Monaco editor (#75684) - UI: Fix slow pending Dag run checks on large databases (#75674) @@ -760,6 +771,12 @@ Bug Fixes Miscellaneous ^^^^^^^^^^^^^ +- UI: Make asset state store entries scrollable (#75870) +- UI: Stop bundling the ELK worker twice (#75864) +- Store and show the retry deadline; start retries with empty run fields (#76027) +- Freeze the GC before the triggerer's forks to keep memory flat (#76016) +- Honor Airflow logging levels in the TypeScript SDK (#76005) +- Make the bundle name less prominent in the Dag import error modals (#75958) - Load the serialized Dag when starting a task only for stub tasks (#75795) - UI: Hide the scheduled run icon in the grid legend (#75775) - Avoid loading timetables for Dags in Execution API endpoints (#75765) @@ -971,6 +988,8 @@ Miscellaneous Doc Only Changes ^^^^^^^^^^^^^^^^ +- Show UI doc screenshots in synced dark/light tabs (#75957) +- Document the zh-TW translation workflow (#75702) - Go SDK: Correct the documented install command that broke the first bundle build (#75574) - Add missing German Dag trigger translations (#75519) - Normalize zh-TW plural forms and wording (#75504) diff --git a/airflow-core/docs/ui.rst b/airflow-core/docs/ui.rst index 867322f91ec64..4c522b96f3352 100644 --- a/airflow-core/docs/ui.rst +++ b/airflow-core/docs/ui.rst @@ -27,7 +27,9 @@ This guide offers a reference-style walkthrough of key UI components, with annot experienced users alike. .. note:: - Screenshots in this guide use **dark theme** by default. Select views are also shown in **light theme** for comparison. You can toggle themes from user settings located at the bottom corner of the Airflow UI. + Screenshots in this guide are available in both **dark** and **light** theme. Use the tabs above any screenshot to + switch; your choice applies to every screenshot on the page. You can toggle themes in the Airflow UI from user + settings located at the bottom corner. .. note:: The Airflow 3 UI uses modern browser and CSS features. Use a current version of Chrome, Edge, Firefox, or @@ -49,13 +51,20 @@ Airflow 3 and includes: This page is useful for quickly assessing the health of your environment and identifying recent issues or asset-triggered events. -.. image:: img/ui-dark/home_dark.png - :alt: Airflow Home Page showing system health, Dag/task stats, and asset events (Dark Mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/home_light.png - :alt: Airflow Home Page showing system health, Dag/task stats, and asset events (Light Mode) + .. image:: img/ui-dark/home_dark.png + :alt: Airflow Home Page showing system health, Dag/task stats, and asset events (Dark Mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/home_light.png + :alt: Airflow Home Page showing system health, Dag/task stats, and asset events (Light Mode) .. _ui-dag-list: @@ -81,26 +90,38 @@ At the top of the view, you can: - Use **search** or **advanced search (⌘+K)** to find specific Dags - Sort the list using the dropdown (e.g., Latest Run Start Date) -.. image:: img/ui-dark/dag_list.png - :alt: Dag List View in dark mode showing search, filters, and Dag-level controls +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark -| + .. image:: img/ui-dark/dag_list.png + :alt: Dag List View in dark mode showing search, filters, and Dag-level controls -.. image:: img/ui-light/dag_list.png - :alt: Dag List View in light mode showing the same Dags and actions for comparison + .. tab-item:: Light + :sync: light -| + .. image:: img/ui-light/dag_list.png + :alt: Dag List View in light mode showing the same Dags and actions for comparison Some Dags in this list may interact with data assets. For example, Dags that are triggered by asset conditions may display popups showing upstream asset inputs. -.. image:: img/ui-dark/dag_list_asset_condition_popup.png - :alt: Dag List View showing asset condition popup (Dark Mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_list_asset_condition_popup.png - :alt: Dag List View showing asset condition popup (Light Mode) + .. image:: img/ui-dark/dag_list_asset_condition_popup.png + :alt: Dag List View showing asset condition popup (Dark Mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_list_asset_condition_popup.png + :alt: Dag List View showing asset condition popup (Light Mode) .. _ui-dag-details: @@ -118,13 +139,20 @@ Key elements include: This page also includes a visual **timeline of recent Dag runs** and a **log preview for failures**, helping users quickly identify issues across runs. -.. image:: img/ui-dark/dag_overview_dashboard.png - :alt: Dag Details Page in dark mode showing overview dashboard and failure diagnostics +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark -| + .. image:: img/ui-dark/dag_overview_dashboard.png + :alt: Dag Details Page in dark mode showing overview dashboard and failure diagnostics -.. image:: img/ui-light/dag_overview_dashboard.png - :alt: Dag Details Page in light mode showing overview dashboard and failure diagnostics + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_overview_dashboard.png + :alt: Dag Details Page in light mode showing overview dashboard and failure diagnostics .. _ui-grid-view: @@ -145,13 +173,20 @@ Use Grid View to: Each row represents a task, and each column represents a Dag run. You can hover over any task instance for more detail, or click to drill down into logs and metadata. -.. image:: img/ui-dark/dag_overview_grid.png - :alt: Grid View showing Dag run status matrix with varied task states (Dark Mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_overview_grid.png + :alt: Grid View showing Dag run status matrix with varied task states (Dark Mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-light/dag_overview_grid.png - :alt: Grid View showing Dag run status matrix with varied task states (Light Mode) + .. image:: img/ui-light/dag_overview_grid.png + :alt: Grid View showing Dag run status matrix with varied task states (Light Mode) .. _ui-graph-view: @@ -172,13 +207,20 @@ recent run history. Use the dropdown at the top to switch between Dag runs and see how task states changed across executions. -.. image:: img/ui-dark/dag_overview_graph.png - :alt: Graph View showing Dag structure with no Dag run selected (Dark Mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_overview_graph.png - :alt: Graph View showing Dag structure with no Dag run selected (Light Mode) + .. image:: img/ui-dark/dag_overview_graph.png + :alt: Graph View showing Dag structure with no Dag run selected (Dark Mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_overview_graph.png + :alt: Graph View showing Dag structure with no Dag run selected (Light Mode) .. _ui-dag-tabs: @@ -191,71 +233,100 @@ Runs Tab '''''''' The **Runs** tab displays a sortable table of all Dag runs, along with their status, execution duration, run type, and Dag version. -.. image:: img/ui-dark/dag_overview_runs.png - :alt: Dag Runs Tab (Dark Mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark -| + .. image:: img/ui-dark/dag_overview_runs.png + :alt: Dag Runs Tab (Dark Mode) -.. image:: img/ui-light/dag_overview_runs.png - :alt: Dag Runs Tab (Light Mode) + .. tab-item:: Light + :sync: light -| + .. image:: img/ui-light/dag_overview_runs.png + :alt: Dag Runs Tab (Light Mode) Tasks Tab ''''''''' The **Tasks** tab shows metadata for each task in the Dag, including operator type, trigger rule, most recent run status, and run history. -.. image:: img/ui-dark/dag_overview_tasks.png - :alt: Dag Tasks Tab (Dark Mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_overview_tasks.png - :alt: Dag Tasks Tab (Light Mode) + .. image:: img/ui-dark/dag_overview_tasks.png + :alt: Dag Tasks Tab (Dark Mode) -| + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_overview_tasks.png + :alt: Dag Tasks Tab (Light Mode) Events Tab '''''''''' The **Events** tab surfaces structured events related to the Dag, such as Dag triggers and version patches. This tab is especially useful for Dag versioning and troubleshooting changes. -.. image:: img/ui-dark/dag_overview_events.png - :alt: Dag Events Tab (Dark Mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_overview_events.png + :alt: Dag Events Tab (Dark Mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-light/dag_overview_events.png - :alt: Dag Events Tab (Light Mode) + .. image:: img/ui-light/dag_overview_events.png + :alt: Dag Events Tab (Light Mode) Code Tab '''''''' The **Code** tab displays the current version of the Dag definition, including the timestamp of the last parse. Users can view the code for any specific Dag version. -.. image:: img/ui-dark/dag_overview_code.png - :alt: Dag Code Tab (Dark Mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_overview_code.png - :alt: Dag Code Tab (Light Mode) + .. image:: img/ui-dark/dag_overview_code.png + :alt: Dag Code Tab (Dark Mode) -| + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_overview_code.png + :alt: Dag Code Tab (Light Mode) Details Tab ''''''''''' The **Details** tab provides configuration details and metadata for the Dag, including schedule, file location, concurrency limits, and version identifiers. -.. image:: img/ui-dark/dag_overview_details.png - :alt: Dag Details Tab (Dark Mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_overview_details.png + :alt: Dag Details Tab (Dark Mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-light/dag_overview_details.png - :alt: Dag Details Tab (Light Mode) + .. image:: img/ui-light/dag_overview_details.png + :alt: Dag Details Tab (Light Mode) .. _ui-dag-runs: @@ -264,11 +335,20 @@ Dag Run View Each Dag Run has its own view, accessible by selecting a specific row in the Dag's **Runs** tab. The Dag Run view displays metadata about the selected run, as well as task-level details, rendered code, and more. -.. image:: img/ui-dark/dag_run_task_instances.png - :alt: Dag Run - Task Instances tab (dark mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark + .. image:: img/ui-dark/dag_run_task_instances.png + :alt: Dag Run - Task Instances tab (dark mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_run_task_instances.png + :alt: Dag Run - Task Instances tab (light mode) Key elements include: @@ -294,9 +374,6 @@ Displays the status and metadata for each task instance within the Dag Run. Colu Each row also includes a mini Gantt-style timeline that visually represents the task's duration. -.. image:: img/ui-light/dag_run_task_instances.png - :alt: Dag Run - Task Instances (light mode) - Events '''''' @@ -310,25 +387,37 @@ or comparing behavior across Dag Runs that used different code. Dag Run code for ``hello >> airflow()``: -.. image:: img/ui-dark/dag_run_code_hello_airflow.png - :alt: Dag Run Code Snapshot - airflow() (dark mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_run_code_hello_airflow.png - :alt: Dag Run Code Snapshot - airflow() (light mode) + .. image:: img/ui-dark/dag_run_code_hello_airflow.png + :alt: Dag Run Code Snapshot - airflow() (dark mode) -| + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_run_code_hello_airflow.png + :alt: Dag Run Code Snapshot - airflow() (light mode) Dag Run code for ``hello >> world()``: -.. image:: img/ui-dark/dag_run_code_hello_world.png - :alt: Dag Run Code Snapshot - world() (dark mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_run_code_hello_world.png + :alt: Dag Run Code Snapshot - world() (dark mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-light/dag_run_code_hello_world.png - :alt: Dag Run Code Snapshot - world() (light mode) + .. image:: img/ui-light/dag_run_code_hello_world.png + :alt: Dag Run Code Snapshot - world() (light mode) Details ''''''' @@ -341,13 +430,20 @@ Provides extended metadata for the Dag Run, including: - Trigger Source and Run Config - Dag Version ID and Bundle Name -.. image:: img/ui-dark/dag_run_details.png - :alt: Dag Run - Details tab (dark mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_run_details.png - :alt: Dag Run - Details tab (light mode) + .. image:: img/ui-dark/dag_run_details.png + :alt: Dag Run - Details tab (dark mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_run_details.png + :alt: Dag Run - Details tab (light mode) Graph View '''''''''' @@ -356,13 +452,20 @@ Shows the Dag's task dependency structure overlaid with the status of each task Each node includes a visual indicator of task duration. -.. image:: img/ui-dark/dag_run_graph.png - :alt: Dag Run - Graph View (dark mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark -| + .. image:: img/ui-dark/dag_run_graph.png + :alt: Dag Run - Graph View (dark mode) -.. image:: img/ui-light/dag_run_graph.png - :alt: Dag Run - Graph View (light mode) + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_run_graph.png + :alt: Dag Run - Graph View (light mode) .. _ui-ti-view: @@ -374,26 +477,40 @@ Single Run The Single Run window allows you to trigger a Dag run. -.. image:: img/ui-light/dag_trigger_window_single_run.png - :alt: Dag Trigger Window - Single Run (Light Mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_trigger_window_single_run.png + :alt: Dag Trigger Window - Single Run (Dark Mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-dark/dag_trigger_window_single_run.png - :alt: Dag Trigger Window - Single Run (Dark Mode) + .. image:: img/ui-light/dag_trigger_window_single_run.png + :alt: Dag Trigger Window - Single Run (Light Mode) Backfill '''''''' The Backfill window allows you to trigger a Dag run for past dates. -.. image:: img/ui-light/backfill.png - :alt: Dag Trigger Window - Backfill (Light Mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-dark/backfill.png - :alt: Dag Trigger Window - Backfill (Dark Mode) + .. image:: img/ui-dark/backfill.png + :alt: Dag Trigger Window - Backfill (Dark Mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/backfill.png + :alt: Dag Trigger Window - Backfill (Light Mode) Task Instance View ------------------ @@ -401,8 +518,20 @@ Task Instance View When you click on a specific task from the Dag Run view, you're brought to the **Task Instance View**, which shows detailed logs and metadata for that individual task execution. -.. image:: img/ui-dark/dag_task_instance_logs.png - :alt: Task Logs (dark mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_task_instance_logs.png + :alt: Task Logs (dark mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_task_instance_logs.png + :alt: Task Logs (light mode) .. _ui-ti-tabs: @@ -415,9 +544,6 @@ Logs '''' The default tab shows the task logs, which include system output, error messages, and traceback information. This is the first place to look when a task fails. -.. image:: img/ui-light/dag_task_instance_logs.png - :alt: Task Logs (light mode) - Rendered Templates '''''''''''''''''' Displays the rendered version of templated fields in your task. Useful for debugging context variables or verifying @@ -427,13 +553,20 @@ XCom '''' Shows any values pushed via ``XCom.push()`` or returned from Python functions when using TaskFlow. -.. image:: img/ui-dark/dag_run_task_instance_xcom.png - :alt: Task Instance - XCom tab (dark mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_run_task_instance_xcom.png + :alt: Task Instance - XCom tab (dark mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-light/dag_run_task_instance_xcom.png - :alt: Task Instance - XCom tab (light mode) + .. image:: img/ui-light/dag_run_task_instance_xcom.png + :alt: Task Instance - XCom tab (light mode) Events '''''' @@ -453,13 +586,20 @@ Displays runtime metadata about the task instance, including: - Pool and slot usage - Executor and configuration -.. image:: img/ui-dark/dag_task_instance_details.png - :alt: Task Instance - Details tab (dark mode) +.. tab-set:: + :sync-group: ui-theme -| + .. tab-item:: Dark + :sync: dark -.. image:: img/ui-light/dag_task_instance_details.png - :alt: Task Instance - Details tab (light mode) + .. image:: img/ui-dark/dag_task_instance_details.png + :alt: Task Instance - Details tab (dark mode) + + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_task_instance_details.png + :alt: Task Instance - Details tab (light mode) .. _ui-asset-views: @@ -481,13 +621,20 @@ The Asset List shows all known assets, grouped by name. For each asset, you can Hovering over a count of Dags or tasks shows a tooltip with the full list of producers or consumers. -.. image:: img/ui-dark/asset_list_consuming_dags.png - :alt: Asset List (dark mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark -| + .. image:: img/ui-dark/asset_list_consuming_dags.png + :alt: Asset List (dark mode) -.. image:: img/ui-light/asset_list_consuming_dags.png - :alt: Asset List (light mode) + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/asset_list_consuming_dags.png + :alt: Asset List (light mode) Clicking on the link takes you to the Asset Graph View. @@ -500,13 +647,20 @@ The Asset Graph View shows the asset in context, including upstream producers an - Trigger asset events manually - View recent asset events and the Dag runs they triggered -.. image:: img/ui-dark/asset_view.png - :alt: Asset Graph View (dark mode) +.. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/asset_view.png + :alt: Asset Graph View (dark mode) -| + .. tab-item:: Light + :sync: light -.. image:: img/ui-light/asset_view.png - :alt: Asset Graph View (light mode) + .. image:: img/ui-light/asset_view.png + :alt: Asset Graph View (light mode) Graph Overlays in Dag View @@ -521,25 +675,37 @@ Two graph modes are available: - **All Dag Dependencies**: Shows all Dag-to-Dag and task-level connections - .. image:: img/ui-dark/dag_graph_all_dependencies.png - :alt: Dag Graph View - All Dependencies (dark mode) + .. tab-set:: + :sync-group: ui-theme - | + .. tab-item:: Dark + :sync: dark - .. image:: img/ui-light/dag_graph_all_dependencies.png - :alt: Dag Graph View - All Dependencies (light mode) + .. image:: img/ui-dark/dag_graph_all_dependencies.png + :alt: Dag Graph View - All Dependencies (dark mode) - | + .. tab-item:: Light + :sync: light + + .. image:: img/ui-light/dag_graph_all_dependencies.png + :alt: Dag Graph View - All Dependencies (light mode) - **External Conditions**: Shows only Dags triggered via asset events - .. image:: img/ui-dark/dag_graph_external_conditions.png - :alt: Dag Graph View - External Conditions Only (dark mode) + .. tab-set:: + :sync-group: ui-theme + + .. tab-item:: Dark + :sync: dark + + .. image:: img/ui-dark/dag_graph_external_conditions.png + :alt: Dag Graph View - External Conditions Only (dark mode) - | + .. tab-item:: Light + :sync: light - .. image:: img/ui-light/dag_graph_external_conditions.png - :alt: Dag Graph View - External Conditions Only (light mode) + .. image:: img/ui-light/dag_graph_external_conditions.png + :alt: Dag Graph View - External Conditions Only (light mode) .. _ui-admin-views: diff --git a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/package.json b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/package.json index c1e31aee5da1a..5279776a3be32 100644 --- a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/package.json +++ b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/package.json @@ -21,13 +21,13 @@ "@chakra-ui/react": "^3.37.0", "@hey-api/client-axios": "^0.9.1", "@hey-api/openapi-ts": "^0.99.0", - "@tanstack/react-query": "^5.104.4", + "@tanstack/react-query": "^5.105.0", "axios": "^1.20.0", "next-themes": "^0.4.6", "react": "^19.3.1", "react-cookie": "^8.1.2", "react-dom": "^19.3.1", - "react-hook-form": "^7.90.0", + "react-hook-form": "^7.91.0", "react-router-dom": "^7.18.4" }, "devDependencies": { @@ -40,15 +40,15 @@ "@trivago/prettier-plugin-sort-imports": "^6.0.2", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", - "@typescript-eslint/eslint-plugin": "8.71.2", - "@typescript-eslint/parser": "8.71.2", - "@typescript-eslint/utils": "^8.71.2", + "@typescript-eslint/eslint-plugin": "8.72.0", + "@typescript-eslint/parser": "8.72.0", + "@typescript-eslint/utils": "^8.72.0", "@vitejs/plugin-react-swc": "^4.3.3", "@vitest/coverage-v8": "^4.1.12", "eslint": "^10.13.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-perfectionist": "^5.12.1", + "eslint-plugin-perfectionist": "^5.13.0", "eslint-plugin-prettier": "^5.5.7", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", @@ -58,8 +58,8 @@ "prettier": "^3.9.10", "ts-morph": "^28.0.0", "typescript": "~6.0.3", - "typescript-eslint": "^8.71.2", - "vite": "^8.3.4", + "typescript-eslint": "^8.72.0", + "vite": "^8.3.5", "vite-plugin-css-injected-by-js": "^5.0.2", "vitest": "^4.1.12" }, diff --git a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/pnpm-lock.yaml b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/pnpm-lock.yaml index 3141fe43858d0..60503bb34cb10 100644 --- a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/pnpm-lock.yaml +++ b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/pnpm-lock.yaml @@ -45,8 +45,8 @@ importers: specifier: ^0.99.0 version: 0.99.0(magicast@0.5.5)(typescript@6.0.3) '@tanstack/react-query': - specifier: ^5.104.4 - version: 5.104.4(@types/react@19.3.0)(react@19.3.1) + specifier: ^5.105.0 + version: 5.105.0(@types/react@19.3.0)(react@19.3.1) axios: specifier: ^1.20.0 version: 1.20.0 @@ -63,15 +63,15 @@ importers: specifier: ^19.3.1 version: 19.3.1(react@19.3.1) react-hook-form: - specifier: ^7.90.0 - version: 7.90.0(@types/react@19.3.0)(react@19.3.1) + specifier: ^7.91.0 + version: 7.91.0(@types/react@19.3.0)(react@19.3.1) react-router-dom: specifier: ^7.18.4 version: 7.18.4(react-dom@19.3.1(react@19.3.1))(react@19.3.1) devDependencies: '@7nohe/openapi-react-query-codegen': specifier: ^3.0.2 - version: 3.0.2(@tanstack/react-query@5.104.4(@types/react@19.3.0)(react@19.3.1))(commander@15.0.0)(magicast@0.5.5)(ts-morph@28.0.0)(typescript@6.0.3) + version: 3.0.2(@tanstack/react-query@5.105.0(@types/react@19.3.0)(react@19.3.1))(commander@15.0.0)(magicast@0.5.5)(ts-morph@28.0.0)(typescript@6.0.3) '@eslint/compat': specifier: ^2.1.1 version: 2.1.1(eslint@10.13.0(jiti@2.7.0)) @@ -97,17 +97,17 @@ importers: specifier: ^19.3.0 version: 19.3.0(@types/react@19.3.0) '@typescript-eslint/eslint-plugin': - specifier: 8.71.2 - version: 8.71.2(@typescript-eslint/parser@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + specifier: 8.72.0 + version: 8.72.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) '@typescript-eslint/parser': - specifier: 8.71.2 - version: 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + specifier: 8.72.0 + version: 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) '@typescript-eslint/utils': - specifier: ^8.71.2 - version: 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + specifier: ^8.72.0 + version: 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) '@vitejs/plugin-react-swc': specifier: ^4.3.3 - version: 4.3.3(@swc/helpers@0.5.23)(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) + version: 4.3.3(@swc/helpers@0.5.23)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) '@vitest/coverage-v8': specifier: ^4.1.12 version: 4.1.12(vitest@4.1.12) @@ -121,8 +121,8 @@ importers: specifier: ^6.10.2 version: 6.10.2(eslint@10.13.0(jiti@2.7.0)) eslint-plugin-perfectionist: - specifier: ^5.12.1 - version: 5.12.1(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + specifier: ^5.13.0 + version: 5.13.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) eslint-plugin-prettier: specifier: ^5.5.7 version: 5.5.7(eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)))(eslint@10.13.0(jiti@2.7.0))(prettier@3.9.10) @@ -151,17 +151,17 @@ importers: specifier: ~6.0.3 version: 6.0.3 typescript-eslint: - specifier: ^8.71.2 - version: 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + specifier: ^8.72.0 + version: 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) vite: - specifier: ^8.3.4 - version: 8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) + specifier: ^8.3.5 + version: 8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) vite-plugin-css-injected-by-js: specifier: ^5.0.2 - version: 5.0.2(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) + version: 5.0.2(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) vitest: specifier: ^4.1.12 - version: 4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) + version: 4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) packages: @@ -531,8 +531,8 @@ packages: resolution: {integrity: sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==} engines: {node: '>=8'} - '@oxc-project/types@0.154.0': - resolution: {integrity: sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==} + '@oxc-project/types@0.155.0': + resolution: {integrity: sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==} '@pandacss/is-valid-prop@1.12.1': resolution: {integrity: sha512-JFmahiSKrpBE48NHl8NIsNO5e5y1SrOrOGvyle9h9rkNrYw+RJrm5CLeGimmyhg2FIymsmZE76sDnw5Zuu2LVA==} @@ -542,98 +542,98 @@ packages: resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==} engines: {node: ^14.18.0 || >=16.0.0} - '@rolldown/binding-android-arm-eabi@1.2.14': - resolution: {integrity: sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==} + '@rolldown/binding-android-arm-eabi@1.2.15': + resolution: {integrity: sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] - '@rolldown/binding-android-arm64@1.2.14': - resolution: {integrity: sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==} + '@rolldown/binding-android-arm64@1.2.15': + resolution: {integrity: sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.2.14': - resolution: {integrity: sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==} + '@rolldown/binding-darwin-arm64@1.2.15': + resolution: {integrity: sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.2.14': - resolution: {integrity: sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==} + '@rolldown/binding-darwin-x64@1.2.15': + resolution: {integrity: sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.2.14': - resolution: {integrity: sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==} + '@rolldown/binding-freebsd-x64@1.2.15': + resolution: {integrity: sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.2.14': - resolution: {integrity: sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==} + '@rolldown/binding-linux-arm-gnueabihf@1.2.15': + resolution: {integrity: sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.2.14': - resolution: {integrity: sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==} + '@rolldown/binding-linux-arm64-gnu@1.2.15': + resolution: {integrity: sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.2.14': - resolution: {integrity: sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==} + '@rolldown/binding-linux-arm64-musl@1.2.15': + resolution: {integrity: sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-ppc64-gnu@1.2.14': - resolution: {integrity: sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==} + '@rolldown/binding-linux-ppc64-gnu@1.2.15': + resolution: {integrity: sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.2.14': - resolution: {integrity: sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==} + '@rolldown/binding-linux-s390x-gnu@1.2.15': + resolution: {integrity: sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.2.14': - resolution: {integrity: sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==} + '@rolldown/binding-linux-x64-gnu@1.2.15': + resolution: {integrity: sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.2.14': - resolution: {integrity: sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==} + '@rolldown/binding-linux-x64-musl@1.2.15': + resolution: {integrity: sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.2.14': - resolution: {integrity: sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==} + '@rolldown/binding-openharmony-arm64@1.2.15': + resolution: {integrity: sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-win32-arm64-msvc@1.2.14': - resolution: {integrity: sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==} + '@rolldown/binding-win32-arm64-msvc@1.2.15': + resolution: {integrity: sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.2.14': - resolution: {integrity: sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==} + '@rolldown/binding-win32-x64-msvc@1.2.15': + resolution: {integrity: sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -746,11 +746,11 @@ packages: '@swc/types@0.1.28': resolution: {integrity: sha512-V6Mnml8v09QALx6K0elJ7o9K/MkVDtW3t6L+7Ou/JcWtb3xwId2AH4FeOceySd2JaO87IMw4+6vSZxLm34LPbw==} - '@tanstack/query-core@5.104.4': - resolution: {integrity: sha512-nU4Yrb8Sjn0DeVb7PKG9uiepNavys3yoxy1FX0hViY4/P6Ng/mBje2SMl7i9812rtyHKtHyqiaC/td6GkI8StA==} + '@tanstack/query-core@5.105.0': + resolution: {integrity: sha512-7p56vRmT/z4UJ6sctGIdl5WRUQyUv53IUpUwEKi2g97zMbO7zh8ZsCLffGAvCPBR4xD72e3VXsDyLwXHhoNTMQ==} - '@tanstack/react-query@5.104.4': - resolution: {integrity: sha512-YD5QkvUNy8Ey3LbOy2vwL97JjoYycwDv++cWAibTe+9BLYvl3c09XpYp5dZ2VcxcguwoDhGF+utYJYb79RB36w==} + '@tanstack/react-query@5.105.0': + resolution: {integrity: sha512-y+hMuDERvgg6ay1da0V1a6ZC0ZONt7dELxSFkqRZuwm7p1TTZs0MoXrPlBRflIpRoYjvzQVYxycnLImpFLhWrw==} peerDependencies: '@types/react': ^18 || ^19 react: ^18 || ^19 @@ -852,39 +852,39 @@ packages: '@types/ws@8.18.2': resolution: {integrity: sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==} - '@typescript-eslint/eslint-plugin@8.71.2': - resolution: {integrity: sha512-K72/pvT7qpm8q3k8G5u93NCSN1RcLxX5h7Gw0bQpbMXviBHeY6Nx1WEwmk9wP+eKTSQ8ecxvcgt/ZX/rB938xQ==} + '@typescript-eslint/eslint-plugin@8.72.0': + resolution: {integrity: sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.71.2 + '@typescript-eslint/parser': ^8.72.0 eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/parser@8.71.2': - resolution: {integrity: sha512-aTtmZjp/x3gsGHkDs04/1I8kNogBJkpQaeGaN0PfiG43NzDEmW2n+OP5im9wfsvyX0yP1UZWBrAGtDBfH9jEVw==} + '@typescript-eslint/parser@8.72.0': + resolution: {integrity: sha512-0O+x3ynciD6zuXb1CKSu165haQV6ey53DKhHHUnujP7U+XlltJG+/keT0Xhd1HXCze+IHf7Tvt39ovyepX/LNw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/project-service@8.71.2': - resolution: {integrity: sha512-Pd68GsLVh5ZXlcEccFPdhSOvtHZ/2WU0XsA8zmXOS3F158lVlcTLhfQ6qvtL1RzbMie0Kp8xtbVwAg4nejKPHw==} + '@typescript-eslint/project-service@8.72.0': + resolution: {integrity: sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/scope-manager@8.71.2': - resolution: {integrity: sha512-YF4wgg5iUX5Obywoac27B56FhozMNFhdJSbh11H5GBAwmBtfyRhmgTQqW9tRNNmHDvsZ2CX6UGzoz+YfYn2Leg==} + '@typescript-eslint/scope-manager@8.72.0': + resolution: {integrity: sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.71.2': - resolution: {integrity: sha512-jz49TAWokm/7yWD9/o837nYax9DyALxIPOImdImvVzo6canBCZYzin8zJyqNR5k1j9K1DE0bVvr0XYB+99uAdg==} + '@typescript-eslint/tsconfig-utils@8.72.0': + resolution: {integrity: sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@8.71.2': - resolution: {integrity: sha512-cC8UaalCViJkb3rH/xLIvidEwoFRtMZMUqDjjJMGEKaTFwYRHYBcoczlEGHuvkHEO8svRDrgZ0yQgOArFmwang==} + '@typescript-eslint/type-utils@8.72.0': + resolution: {integrity: sha512-gEXxmmbSTSOVTC37IYYvremOM31v+UN2W772bJxmVYPhAOPSUxtacyb7wkm1EhkYKU6KzFJsdU44DCV4to0LWw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 @@ -894,29 +894,25 @@ packages: resolution: {integrity: sha512-dTLI8PEXhjUC7B9Kre+u0XznO696BhXcTlOn0/6kf1fHaQW8+VjJAVHJ3eTI14ZapTxdkOmc80HblPQLaEeJdg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.70.1': - resolution: {integrity: sha512-Dm1ypdhhrGCTyyehxElhgJ6kgk8MVCv5qXdoOVqPr1uqk42jX8KjrZqhROvdShczA8qrDoYiOWn1ykWlx2k81Q==} + '@typescript-eslint/types@8.72.0': + resolution: {integrity: sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.71.2': - resolution: {integrity: sha512-y5Ukl3oVp7e/VGxqIoEXoeb/Roj71PAJ4WG/N/RGj+eeDvKRLM15kGr9MijLbN0i03S52zxu31Z98E5gWChJKw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/typescript-estree@8.71.2': - resolution: {integrity: sha512-DgNOEsl4pdYzwSL+N/Cl33tX1Hlw3FvId73LnKXfq7jnrF2viOEn7X+P7RBkkSWCVm92gnWd28GIC5vJuLREeA==} + '@typescript-eslint/typescript-estree@8.72.0': + resolution: {integrity: sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/utils@8.71.2': - resolution: {integrity: sha512-RyKa1G1M9rKHDhrk+HJtiF1MvLD5Ux2JW3TSkzw+02pRALdpJb+QzG1Y5em+LvCgzGwgg8H7mBRFKljNz7ImPw==} + '@typescript-eslint/utils@8.72.0': + resolution: {integrity: sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/visitor-keys@8.71.2': - resolution: {integrity: sha512-zozlN0UA32bSG2zkKAgQyRYSbEISVoyU6vvkKYo2aSny74D8Jh4e+POkJ6Lk0dlezZi5x7TtD+88Xb06IB8nhg==} + '@typescript-eslint/visitor-keys@8.72.0': + resolution: {integrity: sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitejs/plugin-react-swc@4.3.3': @@ -1618,8 +1614,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 - eslint-plugin-perfectionist@5.12.1: - resolution: {integrity: sha512-krdSE7Dz+TCtcVr2+rfNhlOIFFBJcUdoRvjaN7JQnsaVnxJw+BZh9wMkY3MSLCJat+yW+UPTQLKS82Epc7MGZA==} + eslint-plugin-perfectionist@5.13.0: + resolution: {integrity: sha512-kPlqE2Kdh0njsad9S9xL/xnq+NNVUsga/uS3yf6axE0RddACM3Q+idJyethC7R+C9b73+NRhAWvKyXPrkl0nFA==} engines: {node: ^20.0.0 || >=22.0.0} peerDependencies: eslint: ^8.45.0 || ^9.0.0 || ^10.0.0 @@ -1905,8 +1901,8 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - ignore@7.0.12: - resolution: {integrity: sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==} + ignore@7.0.14: + resolution: {integrity: sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==} engines: {node: '>= 4'} import-fresh@3.3.1: @@ -2404,8 +2400,8 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} - postcss@8.5.30: - resolution: {integrity: sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==} + postcss@8.5.31: + resolution: {integrity: sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==} engines: {node: ^10 || ^12 || >=14} powershell-utils@0.1.0: @@ -2467,8 +2463,8 @@ packages: peerDependencies: react: ^19.3.1 - react-hook-form@7.90.0: - resolution: {integrity: sha512-+NdG0FLzCPhFOp2NNxaUYLF9fyZhNjx9FTBBSYWF71/l6BBlmIc/j6xlp3DbaHWLJbIG7Zd8oznA19xJClU97w==} + react-hook-form@7.91.0: + resolution: {integrity: sha512-5BEBUnCBwa28AFXYTYmOaB/+CSpJ/+CWVASHEvIGUzFdHyUiPHeRhG7r5hOZ8nZi0yP7pbHdFNXO/p31EKTJFQ==} engines: {node: '>=18.0.0'} peerDependencies: '@types/react': '*' @@ -2544,8 +2540,8 @@ packages: resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==} hasBin: true - rolldown@1.2.14: - resolution: {integrity: sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==} + rolldown@1.2.15: + resolution: {integrity: sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -2731,8 +2727,8 @@ packages: resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} - typescript-eslint@8.71.2: - resolution: {integrity: sha512-Rz4effbMy2g9wnvOJZG6SbVavX313Lap1vNEbk1RUochzickvzP8P4HB+bkNg5e50eVz1hQGjh9K1omI1xB4Bw==} + typescript-eslint@8.72.0: + resolution: {integrity: sha512-r26Fkc8As+mZvqp7SLsMmNFyYUup/6CjK7/eHBHmhOw6GH6n6YFxHVFrG0jN1c5CMpDzelLPxvgeCOzx7BjN+A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 @@ -2770,13 +2766,13 @@ packages: peerDependencies: vite: '>8.0.0-0' - vite@8.3.4: - resolution: {integrity: sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==} + vite@8.3.5: + resolution: {integrity: sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 - '@vitejs/devtools': ^0.7.1 + '@vitejs/devtools': ^0.7.1 || ^0.8.0 esbuild: '>=0.28.1' jiti: '>=1.21.0' less: ^4.0.0 @@ -2931,10 +2927,10 @@ packages: snapshots: - '@7nohe/openapi-react-query-codegen@3.0.2(@tanstack/react-query@5.104.4(@types/react@19.3.0)(react@19.3.1))(commander@15.0.0)(magicast@0.5.5)(ts-morph@28.0.0)(typescript@6.0.3)': + '@7nohe/openapi-react-query-codegen@3.0.2(@tanstack/react-query@5.105.0(@types/react@19.3.0)(react@19.3.1))(commander@15.0.0)(magicast@0.5.5)(ts-morph@28.0.0)(typescript@6.0.3)': dependencies: '@hey-api/openapi-ts': 0.99.0(magicast@0.5.5)(typescript@6.0.3) - '@tanstack/react-query': 5.104.4(@types/react@19.3.0)(react@19.3.1) + '@tanstack/react-query': 5.105.0(@types/react@19.3.0)(react@19.3.1) commander: 15.0.0 cross-spawn: 7.0.6 ts-morph: 28.0.0 @@ -3453,55 +3449,55 @@ snapshots: '@lukeed/ms@2.0.2': {} - '@oxc-project/types@0.154.0': {} + '@oxc-project/types@0.155.0': {} '@pandacss/is-valid-prop@1.12.1': {} '@pkgr/core@0.3.6': {} - '@rolldown/binding-android-arm-eabi@1.2.14': + '@rolldown/binding-android-arm-eabi@1.2.15': optional: true - '@rolldown/binding-android-arm64@1.2.14': + '@rolldown/binding-android-arm64@1.2.15': optional: true - '@rolldown/binding-darwin-arm64@1.2.14': + '@rolldown/binding-darwin-arm64@1.2.15': optional: true - '@rolldown/binding-darwin-x64@1.2.14': + '@rolldown/binding-darwin-x64@1.2.15': optional: true - '@rolldown/binding-freebsd-x64@1.2.14': + '@rolldown/binding-freebsd-x64@1.2.15': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.2.14': + '@rolldown/binding-linux-arm-gnueabihf@1.2.15': optional: true - '@rolldown/binding-linux-arm64-gnu@1.2.14': + '@rolldown/binding-linux-arm64-gnu@1.2.15': optional: true - '@rolldown/binding-linux-arm64-musl@1.2.14': + '@rolldown/binding-linux-arm64-musl@1.2.15': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.2.14': + '@rolldown/binding-linux-ppc64-gnu@1.2.15': optional: true - '@rolldown/binding-linux-s390x-gnu@1.2.14': + '@rolldown/binding-linux-s390x-gnu@1.2.15': optional: true - '@rolldown/binding-linux-x64-gnu@1.2.14': + '@rolldown/binding-linux-x64-gnu@1.2.15': optional: true - '@rolldown/binding-linux-x64-musl@1.2.14': + '@rolldown/binding-linux-x64-musl@1.2.15': optional: true - '@rolldown/binding-openharmony-arm64@1.2.14': + '@rolldown/binding-openharmony-arm64@1.2.15': optional: true - '@rolldown/binding-win32-arm64-msvc@1.2.14': + '@rolldown/binding-win32-arm64-msvc@1.2.15': optional: true - '@rolldown/binding-win32-x64-msvc@1.2.14': + '@rolldown/binding-win32-x64-msvc@1.2.15': optional: true '@rolldown/pluginutils@1.0.1': {} @@ -3583,11 +3579,11 @@ snapshots: dependencies: '@swc/counter': 0.1.3 - '@tanstack/query-core@5.104.4': {} + '@tanstack/query-core@5.105.0': {} - '@tanstack/react-query@5.104.4(@types/react@19.3.0)(react@19.3.1)': + '@tanstack/react-query@5.105.0(@types/react@19.3.0)(react@19.3.1)': dependencies: - '@tanstack/query-core': 5.104.4 + '@tanstack/query-core': 5.105.0 react: 19.3.1 optionalDependencies: '@types/react': 19.3.0 @@ -3613,7 +3609,7 @@ snapshots: picocolors: 1.1.1 redent: 3.0.0 optionalDependencies: - vitest: 4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) + vitest: 4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) '@testing-library/react@16.3.3(@testing-library/dom@10.4.0)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': dependencies: @@ -3685,57 +3681,57 @@ snapshots: dependencies: '@types/node': 26.6.5 - '@typescript-eslint/eslint-plugin@8.71.2(@typescript-eslint/parser@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/eslint-plugin@8.72.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/scope-manager': 8.71.2 - '@typescript-eslint/type-utils': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/utils': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/visitor-keys': 8.71.2 + '@typescript-eslint/parser': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/scope-manager': 8.72.0 + '@typescript-eslint/type-utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.72.0 eslint: 10.13.0(jiti@2.7.0) - ignore: 7.0.12 + ignore: 7.0.14 natural-compare: 1.4.0 ts-api-utils: 2.5.0(typescript@6.0.3) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: - '@typescript-eslint/scope-manager': 8.71.2 - '@typescript-eslint/types': 8.71.2 - '@typescript-eslint/typescript-estree': 8.71.2(typescript@6.0.3) - '@typescript-eslint/visitor-keys': 8.71.2 + '@typescript-eslint/scope-manager': 8.72.0 + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/typescript-estree': 8.72.0(typescript@6.0.3) + '@typescript-eslint/visitor-keys': 8.72.0 debug: 4.4.3 eslint: 10.13.0(jiti@2.7.0) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.71.2(typescript@6.0.3)': + '@typescript-eslint/project-service@8.72.0(typescript@6.0.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.71.2(typescript@6.0.3) - '@typescript-eslint/types': 8.71.2 + '@typescript-eslint/tsconfig-utils': 8.72.0(typescript@6.0.3) + '@typescript-eslint/types': 8.72.0 debug: 4.4.3 typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.71.2': + '@typescript-eslint/scope-manager@8.72.0': dependencies: - '@typescript-eslint/types': 8.71.2 - '@typescript-eslint/visitor-keys': 8.71.2 + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/visitor-keys': 8.72.0 - '@typescript-eslint/tsconfig-utils@8.71.2(typescript@6.0.3)': + '@typescript-eslint/tsconfig-utils@8.72.0(typescript@6.0.3)': dependencies: typescript: 6.0.3 - '@typescript-eslint/type-utils@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/type-utils@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: - '@typescript-eslint/types': 8.71.2 - '@typescript-eslint/typescript-estree': 8.71.2(typescript@6.0.3) - '@typescript-eslint/utils': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/typescript-estree': 8.72.0(typescript@6.0.3) + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) debug: 4.4.3 eslint: 10.13.0(jiti@2.7.0) ts-api-utils: 2.5.0(typescript@6.0.3) @@ -3745,16 +3741,14 @@ snapshots: '@typescript-eslint/types@8.57.0': {} - '@typescript-eslint/types@8.70.1': {} - - '@typescript-eslint/types@8.71.2': {} + '@typescript-eslint/types@8.72.0': {} - '@typescript-eslint/typescript-estree@8.71.2(typescript@6.0.3)': + '@typescript-eslint/typescript-estree@8.72.0(typescript@6.0.3)': dependencies: - '@typescript-eslint/project-service': 8.71.2(typescript@6.0.3) - '@typescript-eslint/tsconfig-utils': 8.71.2(typescript@6.0.3) - '@typescript-eslint/types': 8.71.2 - '@typescript-eslint/visitor-keys': 8.71.2 + '@typescript-eslint/project-service': 8.72.0(typescript@6.0.3) + '@typescript-eslint/tsconfig-utils': 8.72.0(typescript@6.0.3) + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/visitor-keys': 8.72.0 debug: 4.4.3 minimatch: 10.2.6 semver: 7.8.5 @@ -3764,27 +3758,27 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/utils@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)) - '@typescript-eslint/scope-manager': 8.71.2 - '@typescript-eslint/types': 8.71.2 - '@typescript-eslint/typescript-estree': 8.71.2(typescript@6.0.3) + '@typescript-eslint/scope-manager': 8.72.0 + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/typescript-estree': 8.72.0(typescript@6.0.3) eslint: 10.13.0(jiti@2.7.0) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.71.2': + '@typescript-eslint/visitor-keys@8.72.0': dependencies: - '@typescript-eslint/types': 8.71.2 + '@typescript-eslint/types': 8.72.0 eslint-visitor-keys: 5.0.1 - '@vitejs/plugin-react-swc@4.3.3(@swc/helpers@0.5.23)(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1))': + '@vitejs/plugin-react-swc@4.3.3(@swc/helpers@0.5.23)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1))': dependencies: '@rolldown/pluginutils': 1.0.1 '@swc/core': 1.15.47(@swc/helpers@0.5.23) - vite: 8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) + vite: 8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) transitivePeerDependencies: - '@swc/helpers' @@ -3800,7 +3794,7 @@ snapshots: obug: 2.2.1 std-env: 4.3.0 tinyrainbow: 3.2.0 - vitest: 4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) + vitest: 4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) '@vitest/expect@4.1.12': dependencies: @@ -3811,13 +3805,13 @@ snapshots: chai: 6.3.0 tinyrainbow: 3.2.0 - '@vitest/mocker@4.1.12(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1))': + '@vitest/mocker@4.1.12(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1))': dependencies: '@vitest/spy': 4.1.12 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) + vite: 8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) '@vitest/pretty-format@4.1.12': dependencies: @@ -4916,10 +4910,10 @@ snapshots: safe-regex-test: 1.1.0 string.prototype.includes: 2.0.1 - eslint-plugin-perfectionist@5.12.1(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3): + eslint-plugin-perfectionist@5.13.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3): dependencies: - '@typescript-eslint/types': 8.70.1 - '@typescript-eslint/utils': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/types': 8.72.0 + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) natural-orderby: 5.0.0 optionalDependencies: eslint: 10.13.0(jiti@2.7.0) @@ -5259,7 +5253,7 @@ snapshots: ignore@5.3.2: {} - ignore@7.0.12: {} + ignore@7.0.14: {} import-fresh@3.3.1: dependencies: @@ -5714,7 +5708,7 @@ snapshots: possible-typed-array-names@1.1.0: {} - postcss@8.5.30: + postcss@8.5.31: dependencies: nanoid: 3.3.20 picocolors: 1.1.1 @@ -5777,7 +5771,7 @@ snapshots: react: 19.3.1 scheduler: 0.28.0 - react-hook-form@7.90.0(@types/react@19.3.0)(react@19.3.1): + react-hook-form@7.91.0(@types/react@19.3.0)(react@19.3.1): dependencies: react: 19.3.1 optionalDependencies: @@ -5853,26 +5847,26 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - rolldown@1.2.14: + rolldown@1.2.15: dependencies: - '@oxc-project/types': 0.154.0 + '@oxc-project/types': 0.155.0 '@rolldown/pluginutils': 1.0.1 optionalDependencies: - '@rolldown/binding-android-arm-eabi': 1.2.14 - '@rolldown/binding-android-arm64': 1.2.14 - '@rolldown/binding-darwin-arm64': 1.2.14 - '@rolldown/binding-darwin-x64': 1.2.14 - '@rolldown/binding-freebsd-x64': 1.2.14 - '@rolldown/binding-linux-arm-gnueabihf': 1.2.14 - '@rolldown/binding-linux-arm64-gnu': 1.2.14 - '@rolldown/binding-linux-arm64-musl': 1.2.14 - '@rolldown/binding-linux-ppc64-gnu': 1.2.14 - '@rolldown/binding-linux-s390x-gnu': 1.2.14 - '@rolldown/binding-linux-x64-gnu': 1.2.14 - '@rolldown/binding-linux-x64-musl': 1.2.14 - '@rolldown/binding-openharmony-arm64': 1.2.14 - '@rolldown/binding-win32-arm64-msvc': 1.2.14 - '@rolldown/binding-win32-x64-msvc': 1.2.14 + '@rolldown/binding-android-arm-eabi': 1.2.15 + '@rolldown/binding-android-arm64': 1.2.15 + '@rolldown/binding-darwin-arm64': 1.2.15 + '@rolldown/binding-darwin-x64': 1.2.15 + '@rolldown/binding-freebsd-x64': 1.2.15 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.15 + '@rolldown/binding-linux-arm64-gnu': 1.2.15 + '@rolldown/binding-linux-arm64-musl': 1.2.15 + '@rolldown/binding-linux-ppc64-gnu': 1.2.15 + '@rolldown/binding-linux-s390x-gnu': 1.2.15 + '@rolldown/binding-linux-x64-gnu': 1.2.15 + '@rolldown/binding-linux-x64-musl': 1.2.15 + '@rolldown/binding-openharmony-arm64': 1.2.15 + '@rolldown/binding-win32-arm64-msvc': 1.2.15 + '@rolldown/binding-win32-x64-msvc': 1.2.15 run-applescript@7.1.0: {} @@ -6099,12 +6093,12 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript-eslint@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3): + typescript-eslint@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.71.2(@typescript-eslint/parser@8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/parser': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/typescript-estree': 8.71.2(typescript@6.0.3) - '@typescript-eslint/utils': 8.71.2(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/eslint-plugin': 8.72.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/parser': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.72.0(typescript@6.0.3) + '@typescript-eslint/utils': 8.72.0(eslint@10.13.0(jiti@2.7.0))(typescript@6.0.3) eslint: 10.13.0(jiti@2.7.0) typescript: 6.0.3 transitivePeerDependencies: @@ -6137,16 +6131,16 @@ snapshots: dependencies: punycode: 2.3.1 - vite-plugin-css-injected-by-js@5.0.2(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)): + vite-plugin-css-injected-by-js@5.0.2(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)): dependencies: - vite: 8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) + vite: 8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) - vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1): + vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1): dependencies: lightningcss: 1.33.0 picomatch: 4.0.7 - postcss: 8.5.30 - rolldown: 1.2.14 + postcss: 8.5.31 + rolldown: 1.2.15 tinyglobby: 0.2.17 optionalDependencies: '@types/node': 26.6.5 @@ -6154,10 +6148,10 @@ snapshots: jiti: 2.7.0 yaml: 2.9.1 - vitest@4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)): + vitest@4.1.12(@types/node@26.6.5)(@vitest/coverage-v8@4.1.12)(happy-dom@20.14.6)(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)): dependencies: '@vitest/expect': 4.1.12 - '@vitest/mocker': 4.1.12(vite@8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) + '@vitest/mocker': 4.1.12(vite@8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1)) '@vitest/pretty-format': 4.1.12 '@vitest/runner': 4.1.12 '@vitest/snapshot': 4.1.12 @@ -6174,7 +6168,7 @@ snapshots: tinyexec: 1.3.1 tinyglobby: 0.2.17 tinyrainbow: 3.2.0 - vite: 8.3.4(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) + vite: 8.3.5(@types/node@26.6.5)(jiti@2.7.0)(yaml@2.9.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 26.6.5 diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instance_history.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instance_history.py index 2d810885fe39c..a4c7fa489a11c 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instance_history.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instance_history.py @@ -77,6 +77,10 @@ class TaskInstanceHistoryResponse(OmitsMissingRegion, BaseModel): validation_alias="retry_reason", description=("The reason this try ended, as recorded by a retry policy."), ) + retry_at: datetime | None = Field( + default=None, + description="When a task instance waiting to be retried becomes due. Only set in the up_for_retry state.", + ) @field_validator("state_reason", mode="after") @classmethod diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instances.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instances.py index a0c2d30d9c437..097bad4159f8a 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instances.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/task_instances.py @@ -110,6 +110,11 @@ class TaskInstanceResponse(OmitsMissingRegion, BaseModel): ), ) + retry_at: datetime | None = Field( + default=None, + description="When a task instance waiting to be retried becomes due. Only set in the up_for_retry state.", + ) + @field_validator("state_reason", mode="after") @classmethod def redact_state_reason(cls, v: str | None) -> str | None: diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py index b584fd7c4cab2..c3497eeeaca7e 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py @@ -43,6 +43,7 @@ class LightGridTaskInstanceSummary(BaseModel): loop_iterations_count: int | None = None latest_region_id: UUID | None = None latest_region_index: int | None = None + retry_at: datetime | None = None class GridTISummaries(BaseModel): diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml index c28d3ff03b710..7869196d8638c 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml @@ -5066,6 +5066,12 @@ components: - type: integer - type: 'null' title: Latest Region Index + retry_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Retry At type: object required: - task_id @@ -6003,6 +6009,14 @@ components: recorded by a retry policy. May describe a previous attempt: a task waiting to be retried still carries the reason its last attempt ended. It is cleared when the task is cleared and when the next attempt is scheduled or deferred.' + retry_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Retry At + description: When a task instance waiting to be retried becomes due. Only + set in the up_for_retry state. type: object required: - id diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml index 7c51d8b4b4236..b1c2b5c34079a 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml @@ -18017,6 +18017,14 @@ components: - type: 'null' title: State Reason description: The reason this try ended, as recorded by a retry policy. + retry_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Retry At + description: When a task instance waiting to be retried becomes due. Only + set in the up_for_retry state. type: object required: - id @@ -18224,6 +18232,14 @@ components: recorded by a retry policy. May describe a previous attempt: a task waiting to be retried still carries the reason its last attempt ended. It is cleared when the task is cleared and when the next attempt is scheduled or deferred.' + retry_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Retry At + description: When a task instance waiting to be retried becomes due. Only + set in the up_for_retry state. type: object required: - id diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py index 6eca4ae979a91..f6d571eea70d6 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py @@ -491,6 +491,7 @@ def _build_ti_summaries( iteration == latest_iteration[(ti.task_id, loop_id, family_id)] for loop_id, (family_id, iteration) in positions.items() ), + retry_at=getattr(ti, "retry_at", None), ) def get_node_summaries() -> Iterable[dict[str, Any]]: @@ -597,6 +598,7 @@ def _generate() -> Generator[str, None, None]: TaskInstance.dag_version_id, TaskInstance.start_date, TaskInstance.end_date, + TaskInstance.retry_at, DagVersion.version_number, has_note_subq, ) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py index 2eaa3296aad16..fe99d7feb714c 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/grid.py @@ -68,6 +68,8 @@ class GridNodeAgg: has_note: bool = False loop_iterations: dict[str, set[tuple[UUID, int]]] = field(default_factory=dict) latest_region: tuple[UUID, int] | None = None + # Only meaningful while the summary holds a single task instance. + retry_at: datetime | None = None def add_ti( self, @@ -80,6 +82,7 @@ def add_ti( loop_positions: dict[str, tuple[UUID, int]] | None = None, is_latest_pass: bool = True, region: tuple[UUID, int] | None = None, + retry_at: datetime | None = None, ) -> None: """ Merge one task instance row into the summary. @@ -92,6 +95,7 @@ def add_ti( does not supply the coordinate: a link has to address the newest row. """ self.child_states[state] += 1 + self.retry_at = retry_at if self.child_states.total() == 1 else None # A looped task has one row per iteration, so a link without a coordinate cannot say # which one it means. Carry the newest so the grid can address it. if is_latest_pass and region is not None: @@ -254,6 +258,7 @@ def _find_aggregates( "type": "task", "parent_id": parent_id, **_get_aggs_for_node(summary), + "retry_at": summary.retry_at, }, summary, ) diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py b/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py index bb3f8fdf20d7e..a20580ece0a18 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py @@ -284,8 +284,8 @@ def ti_run( ) # One sample per queue wait, not per try: the scheduler refreshes queued_dttm on every # queueing, so a retry and a resume from deferral each waited for a slot of their own. - # task.scheduled_duration skips retries (emit_state_change_metric returns early while - # end_date is set), so the two disagree on retries by design. + # task.scheduled_duration is one sample per try (emit_state_change_metric returns early once + # the try has an end_date, as after a sensor reschedule), so the two disagree on resumes by design. # queued_dttm is unset only for runs that skip the scheduler's queueing, e.g. dag.test(). emit_queued_duration = ti.queued_dttm is not None @@ -298,6 +298,7 @@ def ti_run( state=TaskInstanceState.RUNNING, last_heartbeat_at=timezone.utcnow(), retry_delay_override=None, + retry_at=None, retry_reason=None, ) diff --git a/airflow-core/src/airflow/assets/manager.py b/airflow-core/src/airflow/assets/manager.py index eb8ea92d20734..b732ad0de00ec 100644 --- a/airflow-core/src/airflow/assets/manager.py +++ b/airflow-core/src/airflow/assets/manager.py @@ -31,7 +31,6 @@ from airflow.listeners.types import AssetEvent as ListenerAssetEvent from airflow.models.asset import ( AssetAliasModel, - AssetDagRunQueue, AssetEvent, AssetModel, AssetPartitionDagRun, @@ -42,12 +41,12 @@ PartitionedAssetKeyLog, TaskOutletAssetReference, asset_alias_asset_event_association_table, + insert_asset_dag_run_queue_rows, ) from airflow.models.log import Log from airflow.timetables.base import compute_rollup_fingerprint from airflow.utils.helpers import is_container, prune_dict from airflow.utils.log.logging_mixin import LoggingMixin -from airflow.utils.sqlalchemy import get_dialect_name if TYPE_CHECKING: from datetime import datetime @@ -840,29 +839,7 @@ def _queue_dagruns_nonpartitioned( {"asset_id": asset_id, "target_dag_id": dag.dag_id, "asset_event_id": event.id} for dag in dags_to_queue ] - - if (dialect_name := get_dialect_name(session)) == "mysql": - from sqlalchemy.dialects.mysql import insert as my_insert - - session.execute( - # The on-dup update a no-op since we are always working on ADRQs - # for the asset. It may not hold if you change e.g. ADRQ schema. - my_insert(AssetDagRunQueue).on_duplicate_key_update(asset_id=AssetDagRunQueue.asset_id), - values, - ) - return - - if dialect_name == "postgresql": - from sqlalchemy.dialects.postgresql import insert - else: - from sqlalchemy.dialects.sqlite import insert # type: ignore[assignment] - - session.execute( - insert(AssetDagRunQueue).on_conflict_do_nothing( - index_elements=["target_dag_id", "asset_event_id"] - ), - values, - ) + insert_asset_dag_run_queue_rows(values, session=session) def resolve_asset_manager() -> AssetManager: diff --git a/airflow-core/src/airflow/cli/commands/triggerer_command.py b/airflow-core/src/airflow/cli/commands/triggerer_command.py index 3f881e35c510b..feeb50fbd74e7 100644 --- a/airflow-core/src/airflow/cli/commands/triggerer_command.py +++ b/airflow-core/src/airflow/cli/commands/triggerer_command.py @@ -18,10 +18,11 @@ from __future__ import annotations +import gc from collections.abc import Generator from contextlib import contextmanager from functools import partial -from multiprocessing import Process +from multiprocessing import Process, get_start_method from airflow.cli.commands.daemon_utils import run_command_with_daemon_option from airflow.configuration import conf @@ -43,6 +44,12 @@ def _serve_logs(skip_serve_logs: bool = False) -> Generator[None, None, None]: if skip_serve_logs is False: port = conf.getint("logging", "trigger_log_server_port", fallback=8794) sub_proc = Process(target=partial(serve_logs, port=port)) + if get_start_method() == "fork": + # Freeze and stay frozen: unfreezing would let this process's next full GC split the + # pages the forked child shares copy-on-write (a memory jump with no new allocation). + # The triggerer forks its children once, like the Dag processor manager. No effect + # under forkserver/spawn, where the child re-imports instead of sharing. + gc.freeze() sub_proc.start() try: yield diff --git a/airflow-core/src/airflow/dag_processing/manager.py b/airflow-core/src/airflow/dag_processing/manager.py index a4a834b9acec1..a150b4c1fba5f 100644 --- a/airflow-core/src/airflow/dag_processing/manager.py +++ b/airflow-core/src/airflow/dag_processing/manager.py @@ -1573,8 +1573,21 @@ def _resort_file_queue(self): # Put callback files at the front, then sorted regular files self._file_queue = OrderedDict.fromkeys(callback_files + sorted_regular_files) + def _resolve_stats_by_presence_key(self) -> dict[tuple[str, Path], DagFileStat]: + """ + Resolve one stat per physical file from the bundle scan's entries. + + A callback pins ``bundle_version``, so its entry is separate from the scan's and does + not track parses of the current file: a callback-only result has no ``last_finish_time``, + and a timed-out callback processor is stamped although nothing parsed the current version. + A file with no scan entry has no stat, so it is queued. + """ + return { + file.presence_key: stat for file, stat in self._file_stats.items() if file.bundle_version is None + } + def _sort_by_mtime(self, files: Iterable[DagFileInfo]): - file_stats_by_presence_key = {file.presence_key: stat for file, stat in self._file_stats.items()} + file_stats_by_presence_key = self._resolve_stats_by_presence_key() files_with_mtime: dict[DagFileInfo, float] = {} changed_recently = set() for file in files: @@ -1624,19 +1637,19 @@ def prepare_file_queue(self, known_files: dict[str, set[DagFileInfo]]): Note this method is only called when the file path queue is empty """ + file_stats_by_presence_key = self._resolve_stats_by_presence_key() # We only emit metrics after processing all files in the queue. If `self._parsing_start_time` is None # when this method is called, no files have yet been added to the queue so we shouldn't emit metrics. if self._parsing_start_time is not None: emit_metrics( parse_time=time.perf_counter() - self._parsing_start_time, - dag_file_stats=list(self._file_stats.values()), + dag_file_stats=list(file_stats_by_presence_key.values()), ) self._parsing_start_time = None # If the file path is already being processed, or if a file was # processed recently, wait until the next batch in_progress_keys = {file.presence_key for file in self._processors} - file_stats_by_presence_key = {file.presence_key: stat for file, stat in self._file_stats.items()} now = timezone.utcnow() # Sort the file paths by the parsing order mode diff --git a/airflow-core/src/airflow/jobs/scheduler_job_runner.py b/airflow-core/src/airflow/jobs/scheduler_job_runner.py index 7b8b2d539061a..bd9212973ede9 100644 --- a/airflow-core/src/airflow/jobs/scheduler_job_runner.py +++ b/airflow-core/src/airflow/jobs/scheduler_job_runner.py @@ -91,7 +91,8 @@ TaskInletAssetReference, TaskOutletAssetReference, alias_association_table, - association_table, + build_consumed_by_dag_clause, + insert_asset_dag_run_queue_rows, ) from airflow.models.asset_state_store import AssetStateStoreModel from airflow.models.backfill import Backfill, BackfillDagRun @@ -125,7 +126,7 @@ from airflow.timetables.base import Timetable, compute_rollup_fingerprint from airflow.triggers.base import TriggerEvent from airflow.utils.event_scheduler import EventScheduler -from airflow.utils.helpers import prune_dict +from airflow.utils.helpers import chunks, prune_dict from airflow.utils.log.logging_mixin import LoggingMixin from airflow.utils.log.task_log_address import prepare_task_log_contexts from airflow.utils.retries import MAX_DB_RETRIES, retry_db_transaction, run_with_db_retries @@ -173,6 +174,9 @@ # safety bound, not a behavioural knob operators need to tune. MAX_PARTITION_DAG_RUNS_PER_LOOP = 500 +# Max number of ADRQ rows deleted per statement, to keep the bind parameter count bounded. +_ADRQ_DELETE_CHUNK_SIZE = 500 + def _eager_load_dag_run_for_validation() -> tuple[LoaderOption, LoaderOption]: """ @@ -303,6 +307,18 @@ def _create_scheduler_dag_bag() -> CachedDBDagBag: ) +def _build_scheduled_asset_event_clause(dag_id: str) -> ColumnElement[bool]: + """Check whether an asset event is of an asset the Dag schedules on, directly or via an alias.""" + return or_( + AssetEvent.asset_id.in_( + select(DagScheduleAssetReference.asset_id).where(DagScheduleAssetReference.dag_id == dag_id) + ), + AssetEvent.source_aliases.any( + AssetAliasModel.scheduled_dags.any(DagScheduleAssetAliasReference.dag_id == dag_id) + ), + ) + + def _get_current_dr_task_concurrency(states: Iterable[TaskInstanceState]) -> Subquery: """Get the dag_run IDs and how many tasks are in the provided states for each one.""" return ( @@ -2777,18 +2793,17 @@ def _create_dag_runs(self, dag_models: Collection[DagModel], session: Session) - ) continue - consumed_asset_records: Sequence[AssetDagRunQueue] = () - gated_asset_events: list[AssetEvent] = [] if dag_model.timetable_asset_gated: # The asset condition was evaluated without locks when this Dag was # selected; re-evaluate under ADRQ row locks so concurrent schedulers # cannot consume the same events twice. If the condition is not (or no # longer) satisfied, skip without touching the pending schedule slot so # a later loop retries it. - gate = self._collect_gated_asset_events(dag=serdag, session=session) - if gate is None: + if (gate := self._collect_gated_asset_events(dag=serdag, session=session)) is None: continue - consumed_asset_records, gated_asset_events = gate + gated_locked_records, gated_asset_events = gate + else: + gated_locked_records, gated_asset_events = None, () try: next_info = serdag.timetable.next_run_info_from_dag_model(dag_model=dag_model) @@ -2823,10 +2838,13 @@ def _create_dag_runs(self, dag_models: Collection[DagModel], session: Session) - session=session, active_non_backfill_runs=active_runs_of_dags[dag_model.dag_id], ) - if consumed_asset_records: + if gated_locked_records is not None: created_run.consumed_asset_events.extend(gated_asset_events) + session.flush() # Make consumed events visible to ADRQ cleanup. self._delete_consumed_asset_records( - records=consumed_asset_records, dag_id=dag_model.dag_id, session=session + serdag, + locked_records=gated_locked_records, + session=session, ) # Exceptions like ValueError, ParamValidationError, etc. are raised by @@ -2845,44 +2863,29 @@ def _create_dag_runs(self, dag_models: Collection[DagModel], session: Session) - def _collect_gated_asset_events( self, *, dag: SerializedDAG, session: Session - ) -> tuple[Sequence[AssetDagRunQueue], list[AssetEvent]] | None: + ) -> tuple[Sequence[AssetDagRunQueue], Sequence[AssetEvent]] | None: """ Check an asset-gated Dag's asset condition and collect what a new run consumes. - Returns ``None`` when the condition is not satisfied by the queued asset - events, in which case no run should be created yet. + Returns the locked ADRQ rows, and the event objects consumed by the new + run. *None* is returned when the condition is not satisfied by the queued + asset events, in which case no run should be created yet. """ - records = self._lock_queued_asset_records(dag_id=dag.dag_id, load_assets=True, session=session) + records = self._lock_queued_asset_records(dag_id=dag.dag_id, session=session) if not records: return None - statuses = {SerializedAssetUniqueKey.from_asset(record.asset): True for record in records} - try: - ready = AssetEvaluator(session).run(dag.timetable.asset_condition, statuses=statuses) - except Exception: - self.log.exception("Dag '%s' failed to be evaluated; assuming not ready", dag.dag_id) - return None - if not ready: - return None - asset_events = self._select_consumed_asset_events( - dag=dag, - records=records, - session=session, - ) - if not asset_events: - self._delete_consumed_asset_records(records=records, dag_id=dag.dag_id, session=session) + if not self._is_asset_condition_met(dag, locked_records=records, session=session): + self._delete_consumed_asset_records(dag, locked_records=records, session=session) return None - return records, asset_events + return records, self._select_consumed_asset_events(dag, locked_records=records, session=session) - def _lock_queued_asset_records( - self, *, dag_id: str, load_assets: bool, session: Session - ) -> Sequence[AssetDagRunQueue]: + def _lock_queued_asset_records(self, *, dag_id: str, session: Session) -> Sequence[AssetDagRunQueue]: """Lock and return the Dag's queued asset (ADRQ) rows, skipping rows another scheduler holds.""" - query = select(AssetDagRunQueue).where(AssetDagRunQueue.target_dag_id == dag_id) - if load_assets: - query = query.options(joinedload(AssetDagRunQueue.asset)) return session.scalars( with_row_locks( - query, + select(AssetDagRunQueue) + .where(AssetDagRunQueue.target_dag_id == dag_id) + .options(joinedload(AssetDagRunQueue.asset)), of=AssetDagRunQueue, skip_locked=True, key_share=False, @@ -2890,70 +2893,98 @@ def _lock_queued_asset_records( ) ).all() + def _is_asset_condition_met( + self, dag: SerializedDAG, *, locked_records: Iterable[AssetDagRunQueue], session: Session + ) -> bool: + """ + Evaluate a Dag's asset condition against its locked ADRQ rows. + + Rows whose events have already been consumed by the Dag do not count. + """ + consumed_event_ids = set( + session.scalars( + select(AssetDagRunQueue.asset_event_id).where( + AssetDagRunQueue.target_dag_id == dag.dag_id, + build_consumed_by_dag_clause(dag.dag_id, AssetDagRunQueue.asset_event_id), + ) + ) + ) + statuses = { + SerializedAssetUniqueKey.from_asset(record.asset): True + for record in locked_records + if record.asset_event_id not in consumed_event_ids + } + if not statuses: + return False + try: + return AssetEvaluator(session).run(dag.timetable.asset_condition, statuses=statuses) + except Exception: + self.log.exception("Dag '%s' failed to be evaluated; assuming not ready", dag.dag_id) + return False + def _select_consumed_asset_events( self, - *, dag: SerializedDAG, - records: Sequence[AssetDagRunQueue], + *, + locked_records: Iterable[AssetDagRunQueue], limit: int | None = None, session: Session, - ) -> list[AssetEvent]: - """Select unconsumed events referenced by a Dag's locked ADRQ rows.""" - referenced_event_ids = {record.asset_event_id for record in records} - event_predicate: ColumnElement[bool] = AssetEvent.id.in_(referenced_event_ids) - if dag.catchup: - event_predicate = or_( - event_predicate, - AssetEvent.asset_id.in_( - select(DagScheduleAssetReference.asset_id).where( - DagScheduleAssetReference.dag_id == dag.dag_id - ) - ), - AssetEvent.source_aliases.any( - AssetAliasModel.scheduled_dags.any(DagScheduleAssetAliasReference.dag_id == dag.dag_id) - ), - ) - return list( - session.scalars( - select(AssetEvent) - .where( - event_predicate, - ~( - select(association_table.c.event_id) - .join(DagRun, DagRun.id == association_table.c.dag_run_id) - .where( - DagRun.dag_id == dag.dag_id, - association_table.c.event_id == AssetEvent.id, - ) - .exists() - ), - ) - .order_by(AssetEvent.timestamp.asc(), AssetEvent.id.asc()) - .limit(limit) + ) -> Sequence[AssetEvent]: + """ + Select unconsumed events referenced by a Dag's locked ADRQ rows. + + ADRQ rows are matched up to the largest event ID in *locked_records*. + This does not exclude every event queued after the rows were locked. + With catchup, events are also matched by asset regardless of ID, and + event IDs are not assigned in commit order. Concurrent schedulers can't + consume this Dag's events since the Dag's own row is locked. + """ + event_predicate: ColumnElement[bool] = ( + select(AssetDagRunQueue.asset_event_id) + .where( + AssetDagRunQueue.target_dag_id == dag.dag_id, + AssetDagRunQueue.asset_event_id == AssetEvent.id, + AssetDagRunQueue.asset_event_id <= max(record.asset_event_id for record in locked_records), ) + .exists() ) + if dag.catchup: + event_predicate |= _build_scheduled_asset_event_clause(dag.dag_id) + return session.scalars( + select(AssetEvent) + .where(event_predicate, ~build_consumed_by_dag_clause(dag.dag_id, AssetEvent.id)) + .order_by(AssetEvent.timestamp.asc(), AssetEvent.id.asc()) + .limit(limit) + ).all() def _delete_consumed_asset_records( - self, *, records: Sequence[AssetDagRunQueue], dag_id: str, session: Session + self, + dag: SerializedDAG, + *, + locked_records: Iterable[AssetDagRunQueue], + session: Session, ) -> None: - # Delete only consumed ADRQ rows to avoid dropping newly queued events - # (e.g. DagRun triggered by asset A while a new event for asset B arrives). - result = cast( - "CursorResult", - session.execute( - delete(AssetDagRunQueue).where( - tuple_( - AssetDagRunQueue.target_dag_id, - AssetDagRunQueue.asset_event_id, - ).in_((record.target_dag_id, record.asset_event_id) for record in records) - ) - ), - ) - self.log.info( - "Deleted %d ADRQ rows for '%s'", - result.rowcount, - dag_id, - ) + """ + Delete locked ADRQ rows whose events have been consumed by a Dag run. + + Only rows locked by this scheduler are deleted, since a DELETE waits on + rows locked elsewhere (e.g. by the API) and can deadlock. Of those, only + consumed rows are deleted to keep events not yet consumed queued. + Consumed events are matched against the Dag's runs with a subquery, so + the caller must flush newly consumed events before calling this. + + :param locked_records: The ADRQ rows locked by this scheduler. + """ + event_ids = [r.asset_event_id for r in locked_records] + deleted = 0 + for chunk in chunks(event_ids, _ADRQ_DELETE_CHUNK_SIZE): + stmt = delete(AssetDagRunQueue).where( + AssetDagRunQueue.target_dag_id == dag.dag_id, + AssetDagRunQueue.asset_event_id.in_(chunk), + build_consumed_by_dag_clause(dag.dag_id, AssetDagRunQueue.asset_event_id), + ) + deleted += cast("CursorResult", session.execute(stmt)).rowcount + self.log.info("Deleted %d ADRQ rows for '%s'", deleted, dag.dag_id) def _create_dag_runs_asset_triggered( self, @@ -2980,9 +3011,7 @@ def _create_dag_runs_asset_triggered( ) continue - queued_adrqs = self._lock_queued_asset_records( - dag_id=dag.dag_id, load_assets=False, session=session - ) + queued_adrqs = self._lock_queued_asset_records(dag_id=dag.dag_id, session=session) # If another scheduler already locked these ADRQ rows, SKIP LOCKED makes this scheduler skip them. if not queued_adrqs: self.log.debug( @@ -2990,6 +3019,11 @@ def _create_dag_runs_asset_triggered( dag.dag_id, ) continue + # The condition was evaluated without locks when this Dag was selected. + if not self._is_asset_condition_met(dag, locked_records=queued_adrqs, session=session): + self.log.debug("Asset condition no longer met for Dag '%s'", dag.dag_id) + self._delete_consumed_asset_records(dag, locked_records=queued_adrqs, session=session) + continue run_limit = per_dag_limit if not dag.timetable.batch_asset_events: @@ -3008,69 +3042,97 @@ def _create_dag_runs_asset_triggered( continue asset_events = self._select_consumed_asset_events( - dag=dag, - records=queued_adrqs, + dag, + locked_records=queued_adrqs, limit=None if dag.timetable.batch_asset_events else run_limit + 1, session=session, ) - has_more_events = not dag.timetable.batch_asset_events and len(asset_events) > run_limit - if has_more_events: + if has_more_events := not dag.timetable.batch_asset_events and len(asset_events) > run_limit: asset_events = asset_events[:run_limit] - if asset_events: - triggered_date = timezone.coerce_datetime(max(event.timestamp for event in asset_events)) - self.log.debug( - "Creating asset-triggered DagRun for '%s': %d queued assets, triggered_date=%s", - dag.dag_id, - len(queued_adrqs), - triggered_date, - ) - team_name = ( - self._get_team_names_for_dag_ids([dag.dag_id], session).get(dag.dag_id) - if self._multi_team - else None + triggered_date = timezone.coerce_datetime(max(event.timestamp for event in asset_events)) + self.log.debug( + "Creating asset-triggered DagRun for '%s': %d queued assets, triggered_date=%s", + dag.dag_id, + len(queued_adrqs), + triggered_date, + ) + team_name = ( + self._get_team_names_for_dag_ids([dag.dag_id], session).get(dag.dag_id) + if self._multi_team + else None + ) + for run_after, events in dag.timetable.group_asset_events(asset_events, triggered_date): + dag_run = dag.create_dagrun( + run_id=DagRun.generate_run_id( + run_type=DagRunType.ASSET_TRIGGERED, logical_date=None, run_after=run_after + ), + logical_date=None, + data_interval=None, + run_after=run_after, + run_type=DagRunType.ASSET_TRIGGERED, + triggered_by=DagRunTriggeredByType.ASSET, + state=DagRunState.QUEUED, + creating_job_id=self.job.id, + session=session, ) - for run_after, events in dag.timetable.group_asset_events(asset_events, triggered_date): - dag_run = dag.create_dagrun( - run_id=DagRun.generate_run_id( - run_type=DagRunType.ASSET_TRIGGERED, logical_date=None, run_after=run_after - ), - logical_date=None, - data_interval=None, - run_after=run_after, - run_type=DagRunType.ASSET_TRIGGERED, - triggered_by=DagRunTriggeredByType.ASSET, - state=DagRunState.QUEUED, - creating_job_id=self.job.id, - session=session, - ) - remaining_runs -= 1 - stats.incr("asset.triggered_dagruns", tags=prune_dict({"team_name": team_name})) - dag_run.consumed_asset_events.extend(events) - self.log.info( - "Created asset-triggered DagRun for '%s': run_id=%s, consumed %d asset events", - dag.dag_id, - dag_run.run_id, - len(events), - ) - else: + remaining_runs -= 1 + stats.incr("asset.triggered_dagruns", tags=prune_dict({"team_name": team_name})) + dag_run.consumed_asset_events.extend(events) self.log.info( - "No DagRun created for '%s' - asset events already consumed or none found", + "Created asset-triggered DagRun for '%s': run_id=%s, consumed %d asset events", dag.dag_id, + dag_run.run_id, + len(events), ) - records_to_delete = queued_adrqs - if has_more_events: - consumed_ids = {event.id for event in asset_events} - if dag.catchup: - # Historical events may have no ADRQ. Keep a wakeup row until that backlog drains. - consumed_ids.discard(max(record.asset_event_id for record in queued_adrqs)) - records_to_delete = [ - record for record in queued_adrqs if record.asset_event_id in consumed_ids - ] - self._delete_consumed_asset_records( - records=records_to_delete, - dag_id=dag.dag_id, - session=session, + session.flush() # Make consumed events visible to ADRQ cleanup. + # Dequeue rows for events just consumed above and any stale ones. + self._delete_consumed_asset_records(dag, locked_records=queued_adrqs, session=session) + if has_more_events and dag.catchup: + # Historical events may have no ADRQ row. Queue the next ones so + # the Dag is selected again until the backlog drains. + self._queue_next_backlog_events(dag_id=dag.dag_id, session=session) + + def _queue_next_backlog_events(self, *, dag_id: str, session: Session) -> None: + """ + Queue an ADRQ row for the earliest unconsumed event of each asset the Dag schedules on. + + This lets the Dag's asset condition be evaluated against its catchup + backlog. Events already queued for the Dag are skipped, so the insert + does not wait on a row locked elsewhere (e.g. by the API) on MySQL. + """ + ranked = ( + select( + AssetEvent.id.label("event_id"), + AssetEvent.asset_id.label("asset_id"), + func.row_number() + .over( + partition_by=AssetEvent.asset_id, + order_by=(AssetEvent.timestamp.asc(), AssetEvent.id.asc()), + ) + .label("event_rank"), + ) + .where( + _build_scheduled_asset_event_clause(dag_id), + ~build_consumed_by_dag_clause(dag_id, AssetEvent.id), ) + .subquery() + ) + queued = ( + select(AssetDagRunQueue.asset_event_id) + .where( + AssetDagRunQueue.target_dag_id == dag_id, + AssetDagRunQueue.asset_event_id == ranked.c.event_id, + ) + .exists() + ) + values = [ + {"asset_id": asset_id, "target_dag_id": dag_id, "asset_event_id": event_id} + for event_id, asset_id in session.execute( + select(ranked.c.event_id, ranked.c.asset_id).where(ranked.c.event_rank == 1, ~queued) + ) + ] + if values: + insert_asset_dag_run_queue_rows(values, session=session) def _lock_backfills(self, dag_runs: Collection[DagRun], session: Session) -> dict[int, Backfill]: """ @@ -3763,8 +3825,6 @@ def adopt_or_reset_orphaned_tasks(self, *, session: Session = NEW_SESSION) -> in reset_tis_message.append(repr(ti)) successor = ti.prepare_db_for_next_try(session=session) successor.state = None - successor.queued_by_job_id = None - successor.external_executor_id = None successor.clear_next_method_args() for ti in set(tis_to_adopt_or_reset) - set(to_reset): diff --git a/airflow-core/src/airflow/jobs/triggerer_job_runner.py b/airflow-core/src/airflow/jobs/triggerer_job_runner.py index 4c6cc56ceea22..c6399e2027fb5 100644 --- a/airflow-core/src/airflow/jobs/triggerer_job_runner.py +++ b/airflow-core/src/airflow/jobs/triggerer_job_runner.py @@ -19,6 +19,7 @@ import asyncio import contextvars import functools +import gc import logging import math import os @@ -566,6 +567,12 @@ def start( # type: ignore[override] **kwargs, ): proc_id = job.id if job is not None else uuid4() + if not supervisor._should_use_exec(): + # Freeze before the bare fork and stay frozen: unfreezing would let this process's next + # full GC split the pages the runner child shares copy-on-write (a memory jump with no + # new allocation). Forked once, like the Dag processor manager. Skipped when the child + # execs, which discards the inherited pages. + gc.freeze() # Triggers run user code that polls APIs / watches queues / hits HTTP # endpoints -- almost always network calls that trigger macOS-unsafe ObjC # initialization. Fork+exec a clean interpreter for the runner child. diff --git a/airflow-core/src/airflow/migrations/versions/0142_3_4_0_unify_task_attempt_ownership.py b/airflow-core/src/airflow/migrations/versions/0142_3_4_0_unify_task_attempt_ownership.py index 41a1e0e055ac1..3f19e561a33ba 100644 --- a/airflow-core/src/airflow/migrations/versions/0142_3_4_0_unify_task_attempt_ownership.py +++ b/airflow-core/src/airflow/migrations/versions/0142_3_4_0_unify_task_attempt_ownership.py @@ -233,6 +233,7 @@ def upgrade(): with op.batch_alter_table("task_instance") as batch: batch.add_column(sa.Column("working_set", sa.Boolean(), nullable=True, server_default=sa.true())) batch.add_column(sa.Column("archived_reason", sa.String(50), nullable=True)) + batch.add_column(sa.Column("retry_at", UtcDateTime(), nullable=True)) batch.drop_constraint("task_instance_composite_key", type_="unique") batch.create_unique_constraint("task_instance_current_key", [*_COORDINATES, "working_set"]) batch.create_unique_constraint("task_instance_try_key", [*_COORDINATES, "try_number"]) @@ -598,7 +599,7 @@ def downgrade(): batch.drop_constraint("task_instance_current_key", type_="unique") batch.drop_constraint("task_instance_try_key", type_="unique") batch.create_unique_constraint("task_instance_composite_key", list(_COORDINATES)) - for column in ("working_set", "archived_reason"): + for column in ("working_set", "archived_reason", "retry_at"): batch.drop_column(column) with op.batch_alter_table("task_instance_history") as batch: batch.create_foreign_key( diff --git a/airflow-core/src/airflow/models/asset.py b/airflow-core/src/airflow/models/asset.py index df845b53a9fc7..f6aac15660935 100644 --- a/airflow-core/src/airflow/models/asset.py +++ b/airflow-core/src/airflow/models/asset.py @@ -44,13 +44,15 @@ from airflow.configuration import conf as airflow_conf from airflow.models.base import Base, StringID from airflow.utils.session import NEW_SESSION, provide_session -from airflow.utils.sqlalchemy import UtcDateTime +from airflow.utils.sqlalchemy import UtcDateTime, get_dialect_name if TYPE_CHECKING: - from collections.abc import Iterable + from collections.abc import Iterable, Sequence from typing import Any, TypeAlias + from sqlalchemy import Insert from sqlalchemy.orm import Session + from sqlalchemy.sql.elements import ColumnElement, SQLColumnExpression from airflow.models.dag import DagModel from airflow.models.trigger import Trigger @@ -833,6 +835,44 @@ def __repr__(self): ) +def build_consumed_by_dag_clause( + dag_id: str | SQLColumnExpression[str], event_id: SQLColumnExpression[int] +) -> ColumnElement[bool]: + """Check whether the asset event *event_id* has been consumed by a run of the Dag *dag_id*.""" + from airflow.models.dagrun import DagRun # Avoid circular import + + return ( + select(association_table.c.event_id) + .join(DagRun, DagRun.id == association_table.c.dag_run_id) + .where(DagRun.dag_id == dag_id, association_table.c.event_id == event_id) + .exists() + ) + + +def insert_asset_dag_run_queue_rows(values: Sequence[dict[str, Any]], *, session: Session) -> None: + """Insert ADRQ rows, ignoring rows that are already queued.""" + stmt: Insert + if (dialect_name := get_dialect_name(session)) == "mysql": + from sqlalchemy.dialects.mysql import insert as mysql_insert + + # The on-dup update is a no-op since we are always working on ADRQs + # for the asset. It may not hold if you change e.g. ADRQ schema. + stmt = mysql_insert(AssetDagRunQueue).on_duplicate_key_update(asset_id=AssetDagRunQueue.asset_id) + elif dialect_name == "postgresql": + from sqlalchemy.dialects.postgresql import insert as pg_insert + + stmt = pg_insert(AssetDagRunQueue).on_conflict_do_nothing( + index_elements=["target_dag_id", "asset_event_id"] + ) + else: + from sqlalchemy.dialects.sqlite import insert as sqlite_insert + + stmt = sqlite_insert(AssetDagRunQueue).on_conflict_do_nothing( + index_elements=["target_dag_id", "asset_event_id"] + ) + session.execute(stmt, values) + + class AssetEvent(Base): """ A table to store assets events. diff --git a/airflow-core/src/airflow/models/dag.py b/airflow-core/src/airflow/models/dag.py index 814f6e74298eb..434c18c2af4fc 100644 --- a/airflow-core/src/airflow/models/dag.py +++ b/airflow-core/src/airflow/models/dag.py @@ -62,7 +62,7 @@ from airflow.assets.evaluation import AssetEvaluator from airflow.configuration import conf as airflow_conf from airflow.exceptions import AirflowException -from airflow.models.asset import AssetDagRunQueue +from airflow.models.asset import AssetDagRunQueue, build_consumed_by_dag_clause from airflow.models.base import Base, StringID from airflow.models.dagbundle import DagBundleModel from airflow.models.dagrun import DagRun @@ -737,8 +737,11 @@ def dag_ready(dag_id: str, cond: SerializedAssetBase, statuses: dict[UKey, bool] # this loads all the ADRQ records.... may need to limit num dags adrq_by_dag: dict[str, list[AssetDagRunQueue]] = defaultdict(list) - for adrq in session.scalars( - select(AssetDagRunQueue).options( + for adrq, consumed in session.execute( + select( + AssetDagRunQueue, + build_consumed_by_dag_clause(AssetDagRunQueue.target_dag_id, AssetDagRunQueue.asset_event_id), + ).options( joinedload(AssetDagRunQueue.dag_model), joinedload(AssetDagRunQueue.asset), ) @@ -748,7 +751,9 @@ def dag_ready(dag_id: str, cond: SerializedAssetBase, statuses: dict[UKey, bool] # could happen if the dag DID depend on an asset at some point, # but no longer does. Delete the stale adrq. session.delete(adrq) - else: + elif not consumed: + # A row whose event the Dag already consumed is cleaned up when + # the Dag is next processed. It must not count towards readiness. adrq_by_dag[adrq.target_dag_id].append(adrq) if adrq_by_dag: diff --git a/airflow-core/src/airflow/models/dagrun.py b/airflow-core/src/airflow/models/dagrun.py index 206993e1b66b2..810e308fb59fe 100644 --- a/airflow-core/src/airflow/models/dagrun.py +++ b/airflow-core/src/airflow/models/dagrun.py @@ -1773,10 +1773,20 @@ def _expand_mapped_task_if_needed(ti: TI) -> Iterable[TI] | None: expansion_happened = False # (task id, region id) pairs for which _revise_map_indexes_if_mapped was already done revised_expansion_keys: set[tuple[str, UUID]] = set() + now = timezone.utcnow() for schedulable in itertools.chain(schedulable_tis, additional_tis): if TYPE_CHECKING: assert isinstance(schedulable.task, Operator) old_state = schedulable.state + if old_state == TaskInstanceState.UP_FOR_RETRY: + # Worker-reported retries arrive without one; storing it spares later passes the + # previous-attempt lookup. + if schedulable.retry_at is None: + schedulable.retry_at = schedulable.next_retry_datetime() + # Not due yet, so no dependency of it can pass; _are_premature_tis still counts it + # as runnable when the run looks for a deadlock. + if schedulable.retry_at >= now: + continue if not schedulable.are_dependencies_met(session=session, dep_context=dep_context): old_states[schedulable.id] = old_state continue @@ -2720,6 +2730,7 @@ def schedule_tis( # Already archived with the finished try; the new one must not inherit it. retry_reason=None, retry_delay_override=None, + retry_at=None, ) .execution_options(synchronize_session=False) ) @@ -2772,6 +2783,7 @@ def schedule_tis( try_number=next_try_number, retry_reason=None, retry_delay_override=None, + retry_at=None, ) .execution_options( synchronize_session=False, diff --git a/airflow-core/src/airflow/models/taskinstance.py b/airflow-core/src/airflow/models/taskinstance.py index 6905ae965d8fb..974690b93825a 100644 --- a/airflow-core/src/airflow/models/taskinstance.py +++ b/airflow-core/src/airflow/models/taskinstance.py @@ -144,6 +144,20 @@ TR = TaskReschedule log = logging.getLogger(__name__) + +# Columns describing one attempt's execution; a successor attempt starts with them empty. +_PER_ATTEMPT_COLUMNS = ( + "start_date", + "end_date", + "duration", + "hostname", + "unixname", + "pid", + "queued_dttm", + "scheduled_dttm", + "queued_by_job_id", + "last_heartbeat_at", +) tracer = trace.get_tracer(__name__) if TYPE_CHECKING: @@ -558,6 +572,7 @@ def get_cached_latest_dag_version(dag_id: str) -> DagVersion | None: # the task's own retry_delay, so a stale value would retime the next retry. ti.retry_reason = None ti.retry_delay_override = None + ti.retry_at = None ti.clear_next_method_args() # Match DagVersion to latest serialized DAG when running on the latest version. if use_latest_version: @@ -1191,6 +1206,9 @@ class TaskInstance(Base, LoggingMixin, BaseWorkload): # Read by next_retry_datetime(). retry_delay_override: Mapped[float | None] = mapped_column(Float, nullable=True) retry_reason: Mapped[str | None] = mapped_column(String(500), nullable=True) + # When an UP_FOR_RETRY attempt becomes due; written by the scheduler on its first pass after the + # attempt is created. + retry_at: Mapped[datetime | None] = mapped_column(UtcDateTime, nullable=True) __table_args__ = ( Index("ti_dag_state", dag_id, state), @@ -1628,6 +1646,7 @@ def set_state(self, state: str | None, *, session: Session = NEW_SESSION) -> boo # prepare_db_for_next_try() would otherwise archive them under this try number. self.retry_reason = None self.retry_delay_override = None + self.retry_at = None if self.state in State.finished or self.state == TaskInstanceState.UP_FOR_RETRY: self.end_date = self.end_date or current_time self.duration = (self.end_date - self.start_date).total_seconds() @@ -1755,12 +1774,22 @@ def prepare_db_for_next_try(self, session: Session) -> TaskInstance: """Archive this UUID and return its successor in the caller's transaction.""" successor_state = self.state dag_version_id = self.dag_version_id + retry_at = None + # The execution API doesn't load the task, so a worker-reported retry without a policy + # override is left for DagRun._get_ready_tis. + if successor_state == TaskInstanceState.UP_FOR_RETRY and ( + self.retry_delay_override is not None or self.task is not None + ): + retry_at = self._compute_retry_deadline( + failed_try_number=self.try_number, failed_end_date=self.end_date + ) self.archive(reason="retry", session=session) values = { attribute.columns[0].name: getattr(self, attribute.key) for attribute in inspect(TaskInstance).column_attrs } values.update( + {name: None for name in _PER_ATTEMPT_COLUMNS}, id=uuid7(), try_number=self.try_number + 1, working_set=True, @@ -1769,6 +1798,7 @@ def prepare_db_for_next_try(self, session: Session) -> TaskInstance: external_executor_id=None, dag_version_id=dag_version_id, state=successor_state, + retry_at=retry_at, ) session.execute(insert(TaskInstance.__table__).values(values)) successor = session.scalars(select(TaskInstance).where(TaskInstance.id == values["id"])).one() @@ -2060,28 +2090,60 @@ def _is_in_own_top_level_region(self) -> bool: return False return region is not None and region.node_id == self.task_id and region.parent_region_id is None - def next_retry_datetime(self): + def next_retry_datetime(self, *, session: Session | None = None) -> datetime: """ Get datetime of the next retry if the task instance fails. + ``retry_at`` is usually written by the scheduler on its first pass after an + ``UP_FOR_RETRY`` attempt is created. Until then, or for a row from before that column, the + deadline is computed from the previous attempt's end date. + """ + if self.state == TaskInstanceState.UP_FOR_RETRY: + if self.retry_at is not None: + return self.retry_at + return self._compute_retry_deadline( + failed_try_number=self.try_number - 1, + failed_end_date=self._get_previous_attempt_end_date(session=session) or self.end_date, + ) + return self._compute_retry_deadline(failed_try_number=self.try_number, failed_end_date=self.end_date) + + def _get_previous_attempt_end_date(self, *, session: Session | None) -> datetime | None: + session = session or inspect(self).session + if session is None: + return None + return session.scalar( + select(TaskInstance.end_date) + .where( + TaskInstance.dag_id == self.dag_id, + TaskInstance.run_id == self.run_id, + TaskInstance.task_id == self.task_id, + TaskInstance.region_id == self.region_id, + TaskInstance.region_index == self.region_index, + TaskInstance.try_number == self.try_number - 1, + ) + .execution_options(include_all_attempts=True) + ) + + def _compute_retry_deadline( + self, *, failed_try_number: int, failed_end_date: datetime | None + ) -> datetime: + """ + Compute when the attempt after ``failed_try_number`` may start. + When a :class:`~airflow.sdk.definitions.retry_policy.RetryPolicy` has - overridden the delay, ``retry_delay_override`` is stored on the task - instance row and takes precedence over the static ``retry_delay`` / - exponential-backoff calculation. + overridden the delay, ``retry_delay_override`` takes precedence over the + static ``retry_delay`` / exponential-backoff calculation. For exponential backoff, retry_delay is used as base and will be converted to seconds. """ - # Check for a policy-driven delay override. + base = failed_end_date if failed_end_date is not None else timezone.utcnow() if self.retry_delay_override is not None: - base = self.end_date if self.end_date is not None else timezone.utcnow() return base + timedelta(seconds=self.retry_delay_override) from airflow.sdk.definitions._internal.abstractoperator import MAX_RETRY_DELAY - # While waiting for retry, the live row already identifies the next attempt. - failed_try_number = ( - self.try_number - 1 if self.state == TaskInstanceState.UP_FOR_RETRY else self.try_number - ) + if TYPE_CHECKING: + assert self.task is not None delay = self.task.retry_delay multiplier = self.task.retry_exponential_backoff if self.task.retry_exponential_backoff != 0 else 1.0 if multiplier != 1.0 and multiplier > 0: @@ -2124,7 +2186,7 @@ def next_retry_datetime(self): delay = timedelta(seconds=delay_backoff_in_seconds) if self.task.max_retry_delay: delay = min(self.task.max_retry_delay, delay) - return self.end_date + delay + return base + delay def ready_for_retry(self) -> bool: """Check on whether the task instance is in the right state and timeframe to be retried.""" @@ -2353,8 +2415,7 @@ def emit_state_change_metric(self, new_state: TaskInstanceState) -> None: Supported states: QUEUED and RUNNING """ if self.end_date: - # if the task has an end date, it means that this is not its first round. - # we send the state transition time metric only on the first try, otherwise it gets more complex. + # This try already ran once (e.g. a sensor reschedule); only its first scheduling is timed. return # switch on state and deduce which metric to send @@ -2681,6 +2742,7 @@ def defer_task(self, *, session: Session = NEW_SESSION) -> bool: # A start_from_trigger retry skips schedule_tis' UPDATE, so clear here too. self.retry_reason = None self.retry_delay_override = None + self.retry_at = None self.trigger_id = trigger_row.id self.next_method = start_trigger_args.next_method self.next_kwargs = stringify_encoding_keys(start_trigger_args.next_kwargs or {}) diff --git a/airflow-core/src/airflow/serialization/definitions/baseoperator.py b/airflow-core/src/airflow/serialization/definitions/baseoperator.py index 4d5647a8555d6..9f41bde935d9e 100644 --- a/airflow-core/src/airflow/serialization/definitions/baseoperator.py +++ b/airflow-core/src/airflow/serialization/definitions/baseoperator.py @@ -103,7 +103,7 @@ class SerializedBaseOperator(DAGNode): map_index_template: str | None = None max_active_tis_per_dag: int | None = None max_active_tis_per_dagrun: int | None = None - max_retry_delay: datetime.timedelta | float | None = None + max_retry_delay: datetime.timedelta | None = None multiple_outputs: bool = False # Boolean flags for callback existence diff --git a/airflow-core/src/airflow/serialization/definitions/mappedoperator.py b/airflow-core/src/airflow/serialization/definitions/mappedoperator.py index 4033152abbbc5..aea53d1bd4719 100644 --- a/airflow-core/src/airflow/serialization/definitions/mappedoperator.py +++ b/airflow-core/src/airflow/serialization/definitions/mappedoperator.py @@ -297,7 +297,7 @@ def retry_exponential_backoff(self) -> float: return float(value) @property - def max_retry_delay(self) -> datetime.timedelta | float | None: + def max_retry_delay(self) -> datetime.timedelta | None: return self._get_partial_kwargs_or_operator_default("max_retry_delay") @property diff --git a/airflow-core/src/airflow/ti_deps/deps/not_in_retry_period_dep.py b/airflow-core/src/airflow/ti_deps/deps/not_in_retry_period_dep.py index ce20fddf40c2e..0af1adfb29214 100644 --- a/airflow-core/src/airflow/ti_deps/deps/not_in_retry_period_dep.py +++ b/airflow-core/src/airflow/ti_deps/deps/not_in_retry_period_dep.py @@ -42,11 +42,9 @@ def _get_dep_statuses(self, ti, dep_context, *, session): yield self._passing_status(reason="The task instance was not marked for retrying.") return - # Calculate the date first so that it is always smaller than the timestamp used by - # ready_for_retry cur_date = timezone.utcnow() - next_task_retry_date = ti.next_retry_datetime() - if ti.is_premature: + next_task_retry_date = ti.next_retry_datetime(session=session) + if next_task_retry_date >= cur_date: yield self._failing_status( reason=( f"Task is not ready for retry yet but will be retried automatically. " diff --git a/airflow-core/src/airflow/timetables/_cron.py b/airflow-core/src/airflow/timetables/_cron.py index 245cc3fbc3953..ac0438e7a0cbb 100644 --- a/airflow-core/src/airflow/timetables/_cron.py +++ b/airflow-core/src/airflow/timetables/_cron.py @@ -31,6 +31,27 @@ from pendulum.tz.timezone import FixedTimezone, Timezone +# How far the fold search looks back for a fold twin: tzdata 2020-2030 has no DST shift above 2 hours +# (Antarctica/Troll); Casey's 3 hours was a change of standard time, not DST. +_MAX_DST_SHIFT = datetime.timedelta(hours=2) + + +def _localize_all_folds(naive: datetime.datetime, timezone: Timezone | FixedTimezone) -> list[DateTime]: + """ + Return every UTC instant a naive wall-clock time maps to, earliest first. + + A wall-clock time inside a fall-back fold occurs twice, but ``make_aware`` only returns the later one. + A time skipped by a spring-forward gap never occurs, so it maps to nothing. + """ + first = timezone.convert(naive.replace(fold=0)) + second = timezone.convert(naive.replace(fold=1)) + if first.replace(tzinfo=None) != naive: + return [] + if first.utcoffset() != second.utcoffset(): + return [convert_to_utc(first), convert_to_utc(second)] + return [convert_to_utc(first)] + + def _covers_every_hour(cron: croniter) -> bool: """ Check whether the given cron runs at least once an hour. @@ -153,6 +174,34 @@ def localize_partition_datetime(self, dt: datetime.datetime) -> DateTime: """ return convert_to_utc(make_aware(dt.replace(tzinfo=None), self._timezone)) + def _localized_ticks_within_limit(self, naive: datetime.datetime, *, before: bool) -> list[DateTime]: + """Localize every cron tick within ``_MAX_DST_SHIFT`` on one side of ``naive``, ``naive`` included.""" + nudge = datetime.timedelta(microseconds=1) + cron = croniter(self._expression, start_time=naive + nudge if before else naive - nudge) + step = cron.get_prev if before else cron.get_next + localized: list[DateTime] = [] + tick = step(datetime.datetime) + while abs(tick - naive) <= _MAX_DST_SHIFT: + localized += _localize_all_folds(tick, self._timezone) + tick = step(datetime.datetime) + return localized + + def _localize_if_unambiguous( + self, naive: datetime.datetime, scheduled: datetime.datetime + ) -> DateTime | None: + """ + Localize ``scheduled`` when neither it nor ``naive`` is ambiguous, else return ``None``. + + croniter yields ticks in wall-clock order, so none lies between ``naive`` and ``scheduled``; + a fold or gap between them holds no tick, and localizing an unambiguous wall-clock time is + exact. An earlier tick can only cross ``current`` through a fold at ``naive`` itself, and a + fold or gap at ``scheduled`` has two or no instants; those cases are left to the fold search. + """ + if len(_localize_all_folds(naive, self._timezone)) != 1: + return None + localized = _localize_all_folds(scheduled, self._timezone) + return localized[0] if len(localized) == 1 else None + def _get_next(self, current: DateTime) -> DateTime: """Get the first schedule after specified time, with DST fixed.""" naive = make_naive(current, self._timezone) @@ -162,8 +211,16 @@ def _get_next(self, current: DateTime) -> DateTime: assert isinstance(scheduled, datetime.datetime) if not _covers_every_hour(cron): return convert_to_utc(make_aware(scheduled, self._timezone)) - delta = scheduled - naive - return convert_to_utc(current.in_timezone(self._timezone) + delta) + + if (exact := self._localize_if_unambiguous(naive, scheduled)) is not None: + return exact + # Ticks within ``_MAX_DST_SHIFT`` before ``naive`` may have a later fold occurrence after ``current``. + candidates = [c for c in self._localized_ticks_within_limit(naive, before=True) if c > current] + # croniter is strictly increasing on naive wall clock and DST gaps are finite, so a + # candidate strictly after ``current`` is reached in finitely many steps. + while not (forward := [c for c in _localize_all_folds(scheduled, self._timezone) if c > current]): + scheduled = cron.get_next(datetime.datetime) + return min(candidates + forward) def _get_prev(self, current: DateTime) -> DateTime: """Get the first schedule strictly before specified time, with DST fixed.""" @@ -181,8 +238,12 @@ def _get_prev(self, current: DateTime) -> DateTime: scheduled = cron.get_prev(datetime.datetime) prev = convert_to_utc(make_aware(scheduled, self._timezone)) return prev - delta = naive - scheduled - return convert_to_utc(current.in_timezone(self._timezone) - delta) + if (exact := self._localize_if_unambiguous(naive, scheduled)) is not None: + return exact + candidates = [c for c in self._localized_ticks_within_limit(naive, before=False) if c < current] + while not (backward := [c for c in _localize_all_folds(scheduled, self._timezone) if c < current]): + scheduled = cron.get_prev(datetime.datetime) + return max(candidates + backward) def _align_to_next(self, current: DateTime) -> DateTime: """ diff --git a/airflow-core/src/airflow/timetables/base.py b/airflow-core/src/airflow/timetables/base.py index a2325395a08e4..e1e5b8d6a0a31 100644 --- a/airflow-core/src/airflow/timetables/base.py +++ b/airflow-core/src/airflow/timetables/base.py @@ -233,8 +233,8 @@ class Timetable(Protocol): """Whether queued asset events are consumed together in one Dag run.""" def group_asset_events( - self, events: list[AssetEvent], triggered_date: DateTime - ) -> Iterable[tuple[DateTime, list[AssetEvent]]]: + self, events: Sequence[AssetEvent], triggered_date: DateTime + ) -> Iterable[tuple[DateTime, Sequence[AssetEvent]]]: """Yield a run time and its consumed events for each asset-triggered run.""" if not events: return diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts index 32669dad1aaba..8ba458c15dc83 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts @@ -8200,6 +8200,19 @@ export const $TaskInstanceHistoryResponse = { ], title: 'State Reason', description: 'The reason this try ended, as recorded by a retry policy.' + }, + retry_at: { + anyOf: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'null' + } + ], + title: 'Retry At', + description: 'When a task instance waiting to be retried becomes due. Only set in the up_for_retry state.' } }, type: 'object', @@ -8535,6 +8548,19 @@ export const $TaskInstanceResponse = { ], title: 'State Reason', description: 'The reason the task instance reached its current state, as recorded by a retry policy. May describe a previous attempt: a task waiting to be retried still carries the reason its last attempt ended. It is cleared when the task is cleared and when the next attempt is scheduled or deferred.' + }, + retry_at: { + anyOf: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'null' + } + ], + title: 'Retry At', + description: 'When a task instance waiting to be retried becomes due. Only set in the up_for_retry state.' } }, type: 'object', @@ -12318,6 +12344,18 @@ export const $LightGridTaskInstanceSummary = { } ], title: 'Latest Region Index' + }, + retry_at: { + anyOf: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'null' + } + ], + title: 'Retry At' } }, type: 'object', diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts index c34a9a1dfeeb7..6f088ae943ab1 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts @@ -2232,6 +2232,10 @@ export type TaskInstanceHistoryResponse = { * The reason this try ended, as recorded by a retry policy. */ state_reason?: string | null; + /** + * When a task instance waiting to be retried becomes due. Only set in the up_for_retry state. + */ + retry_at?: string | null; }; /** @@ -2283,6 +2287,10 @@ export type TaskInstanceResponse = { * The reason the task instance reached its current state, as recorded by a retry policy. May describe a previous attempt: a task waiting to be retried still carries the reason its last attempt ended. It is cleared when the task is cleared and when the next attempt is scheduled or deferred. */ state_reason?: string | null; + /** + * When a task instance waiting to be retried becomes due. Only set in the up_for_retry state. + */ + retry_at?: string | null; }; /** @@ -3179,6 +3187,7 @@ export type LightGridTaskInstanceSummary = { loop_iterations_count?: number | null; latest_region_id?: string | null; latest_region_index?: number | null; + retry_at?: string | null; }; /** diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json index c12d426d6a6e0..7d55f91564221 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json @@ -487,6 +487,7 @@ "queue": "Queue", "queuedWhen": "Queued At", "renderedMapIndex": "Rendered Map Index", + "retryAt": "Retry At", "scheduledWhen": "Scheduled At", "stateReason": "Reason for state", "stateReasonSummary": { diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/dashboard.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/dashboard.json index 698b017bf8dcc..8cf3b42bb95ab 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/dashboard.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/dashboard.json @@ -54,6 +54,7 @@ }, "history": "History", "importErrors": { + "bundle": "Bundle", "dagImportError_one": "Dag Import Error", "dagImportError_other": "Dag Import Errors", "searchByFile": "Search by file", diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/hu/hitl.json b/airflow-core/src/airflow/ui/public/i18n/locales/hu/hitl.json index d6823b17fef03..1e3cd1393acf4 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/hu/hitl.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/hu/hitl.json @@ -20,7 +20,7 @@ "optionsLabel": "Lehetőségek", "received": "Válasz beérkezett: ", "respond": "Válaszadás", - "responded_by_user_name": "Válaszolta: {{userName}}", + "responded_by_user_name": "Válaszolta (felhasználónév)", "success": "A(z) {{taskId}} feladatpéldányhoz tartozó válasz sikeres", "title": "Emberi feladat példány - {{taskId}}" }, diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/pt/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/pt/common.json index bc5834097669f..2396620372f71 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/pt/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/pt/common.json @@ -123,7 +123,7 @@ "expand": { "collapse": "Recolher", "expand": "Expandir", - "hotkey": "Pressione {{hotkey}} para expandir ou recolher", + "hotkey": "e", "tooltip": "Pressione {{hotkey}} para expandir ou recolher a secção" }, "expandAllExtra": "Expandir todos os extra json", @@ -216,7 +216,7 @@ "signedInAs": "Sessão iniciada como", "source": { "hide": "Ocultar", - "hotkey": "Pressione {{hotkey}} para ocultar/mostrar", + "hotkey": "s", "show": "Mostrar" }, "sourceAssetEvent_many": "Eventos de Asset de Origem", @@ -308,7 +308,7 @@ }, "timestamp": { "hide": "Ocultar", - "hotkey": "Pressione {{hotkey}} para ocultar/mostrar", + "hotkey": "t", "show": "Mostrar" }, "timezone": "Fuso Horário", @@ -360,7 +360,7 @@ "tryNumber": "Número de Tentativas", "user": "Usuário", "wrap": { - "hotkey": "Pressione {{hotkey}} para expandir ou recolher", + "hotkey": "w", "tooltip": "Pressione {{hotkey}} para expandir ou recolher a secção", "unwrap": "Expandir", "wrap": "Recolher" diff --git a/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.emptySelection.test.tsx b/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.emptySelection.test.tsx new file mode 100644 index 0000000000000..9bb4180358d58 --- /dev/null +++ b/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.emptySelection.test.tsx @@ -0,0 +1,44 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import "@testing-library/jest-dom/vitest"; +import { render } from "@testing-library/react"; +import { afterEach, describe, expect, it, vi } from "vitest"; + +import { DagService } from "openapi/requests/services.gen"; + +import { Wrapper } from "src/utils/Wrapper"; + +import ClearTaskInstanceDialog from "./ClearTaskInstanceDialog"; + +afterEach(() => vi.restoreAllMocks()); + +describe("ClearTaskInstanceDialog without task instances", () => { + it("does not request the details of an empty Dag id", async () => { + const getDagDetails = vi.spyOn(DagService, "getDagDetails"); + + render(, { + wrapper: Wrapper, + }); + await new Promise((resolve) => { + setTimeout(resolve, 50); + }); + + expect(getDagDetails).not.toHaveBeenCalled(); + }); +}); diff --git a/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx b/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx index b97a9a6247ed6..cc504f36904f0 100644 --- a/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx +++ b/airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx @@ -155,7 +155,8 @@ const ClearTaskInstanceDialog = (props: Props) => { // The Dag details and run versions behind the run-on-latest option are read for one run. const singleRun = groups.length === 1; - const dagId = groups[0]?.dagId ?? ""; + // Undefined while there is nothing to clear: the bulk actions keep this dialog mounted. + const dagId = groups[0]?.dagId; const dagRunId = groups[0]?.dagRunId ?? ""; const loopMode = targets.some((target) => target.in_loop); const initialNote = targets.length === 1 ? (targets[0]?.note ?? null) : null; @@ -201,9 +202,11 @@ const ClearTaskInstanceDialog = (props: Props) => { closeDialog(); }; - const { data: dagDetails } = useDagServiceGetDagDetails({ dagId }, undefined, { enabled: singleRun }); + const { data: dagDetails } = useDagServiceGetDagDetails({ dagId: dagId ?? "" }, undefined, { + enabled: singleRun, + }); - const { data: dagRun } = useDagRunServiceGetDagRun({ dagId, dagRunId }, undefined, { + const { data: dagRun } = useDagRunServiceGetDagRun({ dagId: dagId ?? "", dagRunId }, undefined, { enabled: openDialog && singleRun, }); diff --git a/airflow-core/src/airflow/ui/src/components/DagImportErrorDetails.tsx b/airflow-core/src/airflow/ui/src/components/DagImportErrorDetails.tsx index 6eb5f825ce9c7..1cb0947ee7362 100644 --- a/airflow-core/src/airflow/ui/src/components/DagImportErrorDetails.tsx +++ b/airflow-core/src/airflow/ui/src/components/DagImportErrorDetails.tsx @@ -28,11 +28,13 @@ import { ClipboardIconButton, IconButton, toaster } from "src/system-components" import Time from "src/components/Time"; +import { useHasMultipleDagBundles } from "src/queries/useHasMultipleDagBundles"; import { createErrorToaster } from "src/utils"; /** The parse failure itself — where it came from, when, the traceback — and a way to reparse. */ export const DagImportErrorDetails = ({ importError }: { readonly importError: ImportErrorResponse }) => { const { t: translate } = useTranslation(["dashboard", "components", "dag"]); + const hasMultipleBundles = useHasMultipleDagBundles(); const { isPending, mutate } = useDagParsingServiceReparseDagFile({ onError: (error) => createErrorToaster(error, { titleKey: "dag:parse.toaster.error.title" }, translate), @@ -47,11 +49,6 @@ export const DagImportErrorDetails = ({ importError }: { readonly importError: I return ( <> - - {translate("components:versionDetails.bundleName")} - {": "} - {importError.bundle_name} - {importError.filename} @@ -66,6 +63,13 @@ export const DagImportErrorDetails = ({ importError }: { readonly importError: I > + {hasMultipleBundles ? ( + + {translate("importErrors.bundle")} + {": "} + {importError.bundle_name} + + ) : undefined} {translate("importErrors.timestamp")} diff --git a/airflow-core/src/airflow/ui/src/components/DagImportErrorModal.test.tsx b/airflow-core/src/airflow/ui/src/components/DagImportErrorModal.test.tsx index 5d4a576531598..96600a5f7061f 100644 --- a/airflow-core/src/airflow/ui/src/components/DagImportErrorModal.test.tsx +++ b/airflow-core/src/airflow/ui/src/components/DagImportErrorModal.test.tsx @@ -18,10 +18,12 @@ */ import "@testing-library/jest-dom/vitest"; import { render, screen, within } from "@testing-library/react"; +import { http, HttpResponse } from "msw"; import { describe, expect, it, vi } from "vitest"; import type { ImportErrorResponse } from "openapi/requests/types.gen"; +import { server } from "src/mocks/server"; import { Wrapper } from "src/utils/Wrapper"; import { DagImportErrorModal } from "./DagImportErrorModal"; @@ -43,8 +45,31 @@ describe("DagImportErrorModal", () => { // i18n resources are not loaded in unit tests, so the title renders as its key. const dialog = screen.getByRole("dialog", { name: "importErrors.dagImportError" }); - expect(dialog).toHaveTextContent("dags-folder"); expect(dialog).toHaveTextContent("dags/broken_dag.py"); expect(within(dialog).getByText(/Traceback \(most recent call last\)/u)).toBeInTheDocument(); }); + + it.each([ + { shown: false, totalEntries: 1 }, + { shown: true, totalEntries: 2 }, + ])("shows the bundle name only with several bundles ($totalEntries)", async ({ shown, totalEntries }) => { + server.use( + http.get("/api/v2/dagBundles", () => + HttpResponse.json({ dag_bundles: [], total_entries: totalEntries }), + ), + ); + + render(, { wrapper: Wrapper }); + + const dialog = screen.getByRole("dialog", { name: "importErrors.dagImportError" }); + + if (shown) { + expect(await within(dialog).findByText(/dags-folder/u)).toBeInTheDocument(); + } else { + await new Promise((resolve) => { + setTimeout(resolve, 50); + }); + expect(dialog).not.toHaveTextContent("dags-folder"); + } + }); }); diff --git a/airflow-core/src/airflow/ui/src/components/FilterBar/filters/pausedStateParams.ts b/airflow-core/src/airflow/ui/src/components/FilterBar/filters/pausedStateParams.ts index f7543ffe6f704..dad892a5b6340 100644 --- a/airflow-core/src/airflow/ui/src/components/FilterBar/filters/pausedStateParams.ts +++ b/airflow-core/src/airflow/ui/src/components/FilterBar/filters/pausedStateParams.ts @@ -21,9 +21,10 @@ import { SearchParamsKeys } from "src/constants/searchParams"; import type { FilterValue } from "../types"; /** - * The Paused state pill covers three choices backed by the two URL params that already exist: + * The Paused state pill covers four choices backed by the two URL params that already exist: * * "not_paused" → ``paused=false`` unpaused, which includes draining Dags + * "active" → ``scheduling_state=active`` excludes paused and draining Dags * "paused" → ``paused=true`` * "draining" → ``scheduling_state=draining`` * @@ -32,29 +33,27 @@ import type { FilterValue } from "../types"; * ``paused`` for the other two leaves existing links and the ``hide_paused_dags_by_default`` * seed working untouched. */ -export type PausedStateValue = "draining" | "not_paused" | "paused"; +export type PausedStateValue = "active" | "draining" | "not_paused" | "paused"; export const pausedStateToSearchParams = (value: FilterValue): Record => { const paused = value === "not_paused" ? "false" : undefined; return { [SearchParamsKeys.PAUSED]: value === "paused" ? "true" : paused, - [SearchParamsKeys.SCHEDULING_STATE]: value === "draining" ? "draining" : undefined, + [SearchParamsKeys.SCHEDULING_STATE]: value === "draining" || value === "active" ? value : undefined, }; }; export const pausedStateFromSearchParams = (params: URLSearchParams): PausedStateValue | undefined => { const schedulingState = params.get(SearchParamsKeys.SCHEDULING_STATE); - // Checked first: a draining Dag is also unpaused, so ``paused=false`` alongside it would - // otherwise win and widen the pill back to every unpaused Dag. - if (schedulingState === "draining") { - return "draining"; + // Scheduling state is narrower than paused=false, which also includes draining Dags. + if (schedulingState === "draining" || schedulingState === "active") { + return schedulingState; } // ``scheduling_state=paused`` is the same set as ``paused=true``, so links written against the - // short-lived Scheduling state filter keep working. ``=active`` has no equivalent here — it - // excludes draining Dags, which no single choice does — so it falls through and is ignored. + // short-lived Scheduling state filter keep working. if (schedulingState === "paused") { return "paused"; } @@ -78,5 +77,5 @@ export const pausedStateToQuery = (value: PausedStateValue | undefined) => { paused = false; } - return { paused, schedulingState: value === "draining" ? ("draining" as const) : undefined }; + return { paused, schedulingState: value === "draining" || value === "active" ? value : undefined }; }; diff --git a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts index 6d989e4f606c9..b04622e863517 100644 --- a/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts +++ b/airflow-core/src/airflow/ui/src/components/Graph/useGraphLayout.ts @@ -17,7 +17,8 @@ * under the License. */ import { useQuery } from "@tanstack/react-query"; -import ELK, { type ElkNode } from "elkjs"; +import type { ElkNode } from "elkjs"; +import ELK from "elkjs/lib/elk-api.js"; // ?raw imports the file content as a plain string without any transformation. // We create a blob: URL from it so the Worker is always same-origin to the // page — avoiding the cross-origin SecurityError that occurs in Airflow's dev diff --git a/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.test.tsx b/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.test.tsx index e667c59f86f16..692182b3903df 100644 --- a/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.test.tsx +++ b/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.test.tsx @@ -20,7 +20,11 @@ import "@testing-library/jest-dom/vitest"; import { render, screen } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; -import type { LightGridTaskInstanceSummary, TaskInstanceResponse } from "openapi/requests/types.gen"; +import type { + LightGridTaskInstanceSummary, + TaskInstanceHistoryResponse, + TaskInstanceResponse, +} from "openapi/requests/types.gen"; import { Wrapper } from "src/utils/Wrapper"; @@ -34,6 +38,18 @@ vi.mock("react-i18next", () => ({ }), })); +const buildTry = (overrides: Partial) => + ({ + dag_id: "test", + dag_run_id: "test", + duration: null, + end_date: null, + start_date: null, + task_id: "my_task", + try_number: 2, + ...overrides, + }) as unknown as TaskInstanceHistoryResponse; + describe("TaskInstanceTooltip", () => { it("renders children directly when both taskInstance and tooltip are undefined", () => { render( @@ -291,4 +307,32 @@ describe("TaskInstanceTooltip", () => { // two neighbouring bars can both be a first try and the number is what tells them apart. expect(screen.getByText(/tryNumber/iu).textContent).toContain("1"); }); + + it("shows when a try waiting to be retried becomes due", () => { + render( + + trigger + , + { wrapper: Wrapper }, + ); + + expect(screen.getByText(/taskInstance\.retryAt/u)).toBeInTheDocument(); + }); + + it.each([ + { retry_at: null, state: "up_for_retry" }, + { retry_at: "2026-10-29T12:00:30Z", state: "failed" }, + ] as const)("hides retry at for a $state try with retry_at $retry_at", (overrides) => { + render( + + trigger + , + { wrapper: Wrapper }, + ); + + expect(screen.queryByText(/taskInstance\.retryAt/u)).not.toBeInTheDocument(); + }); }); diff --git a/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.tsx b/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.tsx index 8df0332b12211..4c57757ab0510 100644 --- a/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.tsx +++ b/airflow-core/src/airflow/ui/src/components/TaskInstanceTooltip.tsx @@ -150,6 +150,13 @@ const TaskInstanceTooltip = ({ ) : undefined} + {"retry_at" in taskInstance && + taskInstance.state === "up_for_retry" && + Boolean(taskInstance.retry_at) ? ( + + {translate("taskInstance.retryAt")}: + ) : undefined} {"min_start_date" in taskInstance && taskInstance.min_start_date !== null ? ( <> diff --git a/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.test.tsx b/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.test.tsx index 09a39585e4993..8bf0d9004f9c3 100644 --- a/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.test.tsx +++ b/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.test.tsx @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import "@testing-library/jest-dom"; +import "@testing-library/jest-dom/vitest"; import { fireEvent, render, screen, waitFor } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; import { Wrapper } from "src/utils/Wrapper"; @@ -50,15 +50,22 @@ const buildRun = (overrides: Record) => ({ }); let mockData: { dag_runs: Array> } | undefined; -const mockIsLoading = false; +// Served from cache on a reopen: data is present without any fetch having happened since mount. +let mockFetchedAfterMount = true; vi.mock("openapi/queries", () => ({ useDagRunServiceGetDagRuns: vi.fn(() => ({ data: mockData, - isLoading: mockIsLoading, + isFetchedAfterMount: mockFetchedAfterMount, + isFetching: false, + isSuccess: mockData !== undefined, })), })); +beforeEach(() => { + mockFetchedAfterMount = true; +}); + // Select.Content is portalled to document.body, outside the render container. const getItems = () => document.body.querySelectorAll(".chakra-select__item"); @@ -101,6 +108,30 @@ describe("RecentConfigSelect", () => { expect(container).toBeEmptyDOMElement(); }); + it("renders nothing while the runs are still loading", () => { + mockFetchedAfterMount = false; + mockData = undefined; + + const { container } = render(, { + wrapper: Wrapper, + }); + + expect(container).toBeEmptyDOMElement(); + }); + + // Runs stay fresh for five minutes, so reopening the modal inside that window serves them from + // cache and nothing is fetched after this mount. The configs are still there to offer. + it("still offers configs when the runs came from cache", () => { + mockFetchedAfterMount = false; + mockData = { + dag_runs: [buildRun({ conf: { message: "From cache" }, dag_run_id: "run_cached" })], + }; + + render(, { wrapper: Wrapper }); + + expect(getItems()).toHaveLength(1); + }); + it("renders all distinct confs without capping the list", () => { mockData = { dag_runs: Array.from({ length: 8 }, (_unused, index) => diff --git a/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.tsx b/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.tsx index 8de65ed9a48e8..d689da850dacd 100644 --- a/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.tsx +++ b/airflow-core/src/airflow/ui/src/components/TriggerDag/RecentConfigSelect.tsx @@ -18,7 +18,14 @@ */ import { useMemo, useState } from "react"; -import { createListCollection, Flex, type SelectValueChangeDetails, Text } from "@chakra-ui/react"; +import { + createListCollection, + Field, + Flex, + type SelectValueChangeDetails, + Stack, + Text, +} from "@chakra-ui/react"; import { useTranslation } from "react-i18next"; import { useDagRunServiceGetDagRuns } from "openapi/queries"; @@ -42,11 +49,9 @@ type RecentConfigSelectProps = { const RecentConfigSelect = ({ dagId, onSelectConf, open }: RecentConfigSelectProps) => { const { t: translate } = useTranslation("components"); const [selectedValue, setSelectedValue] = useState>([]); - const { data, isLoading } = useDagRunServiceGetDagRuns( - { dagId, limit: 25, orderBy: ["-run_after"] }, - undefined, - { enabled: open }, - ); + const { data } = useDagRunServiceGetDagRuns({ dagId, limit: 25, orderBy: ["-run_after"] }, undefined, { + enabled: open, + }); const options = useMemo(() => { const seenConfs = new Set(); @@ -79,34 +84,48 @@ const RecentConfigSelect = ({ dagId, onSelectConf, open }: RecentConfigSelectPro } }; - if (!isLoading && options.length === 0) { + // The options come from the runs alone, so there is nothing to show both before they arrive + // and when none of them carried a config. Asking the query how far along it is would be worse + // than useless here: the runs stay fresh for five minutes, so reopening the modal serves them + // from cache without fetching, and a readiness flag would read that as "not ready yet" and + // hide configs that are already in hand. + if (options.length === 0) { return undefined; } + // Laid out as a form row like Logical Date and the run parameters below it, rather than a + // label stacked over a full-width control. return ( - - {translate("triggerDag.recentConfig")} - - - - - {recentConfigOptions.items.map((option) => ( - - - {option.run.dag_run_id} - - - ))} - - + + + + {translate("triggerDag.recentConfig")} + + + + + + + + + {recentConfigOptions.items.map((option) => ( + + + {option.run.dag_run_id} + + + ))} + + + + ); }; diff --git a/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGForm.test.tsx b/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGForm.test.tsx index d4a4e96bdb4a7..44040b248f878 100644 --- a/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGForm.test.tsx +++ b/airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGForm.test.tsx @@ -79,7 +79,9 @@ vi.mock("openapi/queries", async (importOriginal) => { }, ], }, - isLoading: false, + isFetchedAfterMount: true, + isFetching: false, + isSuccess: true, })), }; }); diff --git a/airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx b/airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx index 969abe1b089cb..975a75c4b3a9d 100644 --- a/airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx +++ b/airflow-core/src/airflow/ui/src/constants/filterConfigs.tsx @@ -99,6 +99,7 @@ export const useFilterConfigs = () => { "common", "components", "admin", + "dashboard", "dags", "hitl", ]); @@ -385,6 +386,7 @@ export const useFilterConfigs = () => { label: translate("dags:filters.pausedState"), options: [ { label: translate("dags:filters.paused.active"), value: "not_paused" }, + { label: translate("dashboard:stats.activeDags"), value: "active" }, { label: translate("dags:draining.label"), value: "draining" }, { label: translate("dags:filters.paused.paused"), value: "paused" }, ], diff --git a/airflow-core/src/airflow/ui/src/i18n/locales.test.ts b/airflow-core/src/airflow/ui/src/i18n/locales.test.ts index 54fc2ccd76c89..d8b41c0d88977 100644 --- a/airflow-core/src/airflow/ui/src/i18n/locales.test.ts +++ b/airflow-core/src/airflow/ui/src/i18n/locales.test.ts @@ -157,3 +157,81 @@ describe("locale counter placeholders", () => { expect(instance.t("dag:logs.search.matchCount", { total: 5 })).toBe("{{current, number}} of 5"); }); }); +const PLACEHOLDER = /\{\{\s*(?[A-Za-z0-9_$]+)/gu; +const PLURAL_SUFFIX = /_(?:zero|one|two|few|many|other)$/u; +const PLURAL_CATEGORIES = ["_other", "_one", "_many", "_few", "_two", "_zero", ""]; + +const placeholdersOf = (value: string): Set => + new Set([...value.matchAll(PLACEHOLDER)].map((match) => match.groups?.name ?? "")); + +const stringsOf = (lng: string): Map => + new Map( + Object.entries((resources[lng] ?? {}) as Record).flatMap(([ns, bundle]) => + flattenStrings(bundle, ns), + ), + ); + +// Plural categories differ by language, so a translated `foo_many` may have no en key of its own +// category to compare against and has to fall back to whichever form en does define. +const enCounterpart = (en: Map, key: string): [string, string] | undefined => { + const exact = en.get(key); + + if (exact !== undefined) { + return [key, exact]; + } + + const base = key.replace(PLURAL_SUFFIX, ""); + + for (const category of PLURAL_CATEGORIES) { + const value = en.get(`${base}${category}`); + + if (value !== undefined) { + return [`${base}${category}`, value]; + } + } + + return undefined; +}; + +// A translation may only interpolate the variables its en original interpolates. The call site +// passes one fixed set, so a locale that invents a variable shows the user a raw "{{...}}" — as +// the counter test above pins — and one that drops an interpolated value loses it silently. +const findVariableMismatch = (en: Map, key: string, value: string): string | undefined => { + const counterpart = enCounterpart(en, key); + + if (counterpart === undefined) { + return undefined; + } + + const [enKey, original] = counterpart; + const expectedNames = placeholdersOf(original); + const actualNames = placeholdersOf(value); + + // i18next only resolves a plural form when `count` was passed, so it is always available. + if (PLURAL_SUFFIX.test(key) || PLURAL_SUFFIX.test(enKey)) { + expectedNames.delete("count"); + actualNames.delete("count"); + } + + const invented = [...actualNames].filter((name) => !expectedNames.has(name)); + const dropped = [...expectedNames].filter((name) => !actualNames.has(name)); + + return invented.length > 0 || dropped.length > 0 + ? `${key}: invented [${invented.join(", ")}], dropped [${dropped.join(", ")}]` + : undefined; +}; + +describe("locale interpolation variables", () => { + const en = stringsOf("en"); + const translations = Object.keys(resources) + .filter((lng) => lng !== "en") + .sort(); + + it.each(translations)("interpolates only the variables en does, in %s", (lng) => { + const offenders = [...stringsOf(lng)] + .map(([key, value]) => findVariableMismatch(en, key, value)) + .filter((offender) => offender !== undefined); + + expect(offenders).toEqual([]); + }); +}); diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx index c9bf35619949f..80215afb5d8a8 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx +++ b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx @@ -20,11 +20,12 @@ import type { PropsWithChildren } from "react"; import "@testing-library/jest-dom/vitest"; import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react"; -import { MemoryRouter, Route, Routes, useLocation, useMatches } from "react-router-dom"; +import { MemoryRouter, Route, Routes, matchRoutes, useLocation, useMatches } from "react-router-dom"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { DagRunService, DagService, TaskInstanceService } from "openapi/requests/services.gen"; +import { routerConfig } from "src/router"; import { BaseWrapper } from "src/utils/Wrapper"; import { DagBreadcrumb } from "./DagBreadcrumb"; @@ -57,6 +58,8 @@ vi.mock("src/queries/useLoopFilterOptions", async (importOriginal) => { // The msw dag-details handler is pinned to this dag id. const DAG_ID = "tutorial_taskflow_api"; +const leadsToErrorPage = (href: string) => matchRoutes(routerConfig, href)?.at(-1)?.route.path === "*"; + const LocationProbe = () =>
{useLocation().pathname}
; const createWrapper = @@ -268,6 +271,22 @@ describe("DagBreadcrumb", () => { expect(screen.getByText("0")).toBeInTheDocument(); }); + it("never links a looped group page's levels to a missing page", async () => { + mockLoopOptions = LOOP_PASSES; + render(, { + wrapper: createWrapper( + `/dags/${DAG_ID}/runs/run_1/tasks/group/batch`, + "/dags/:dagId/runs/:runId/tasks/group/:groupId", + ), + }); + + await screen.findByTestId("switch-iteration"); + + for (const link of screen.getAllByRole("link")) { + expect(leadsToErrorPage(link.getAttribute("href") ?? "")).toBe(false); + } + }); + it("resolves the task instance by the region coordinates in the URL", async () => { const regionId = "11111111-1111-4111-8111-111111111111"; const getTaskInstance = vi.spyOn(TaskInstanceService, "getTaskInstance"); diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx index 55e1008f9366b..20fb450883180 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx +++ b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx @@ -221,7 +221,6 @@ export const DagBreadcrumb = () => { hasState: true, key: "group", state: groupSummary?.state, - to: `/dags/${dagId}/groups/${groupId}`, value: groupId, }); } diff --git a/airflow-core/src/airflow/ui/src/mocks/handlers/dags.ts b/airflow-core/src/airflow/ui/src/mocks/handlers/dags.ts index a9f3570e6c476..41b4144c54ec0 100644 --- a/airflow-core/src/airflow/ui/src/mocks/handlers/dags.ts +++ b/airflow-core/src/airflow/ui/src/mocks/handlers/dags.ts @@ -159,6 +159,10 @@ const filterDags = ({ // Narrower than ``paused=false``: a draining Dag is unpaused, so the two are not alternatives. if (schedulingState === "draining") { allDags = allDags.filter((dag) => "scheduling_state" in dag && dag.scheduling_state === "draining"); + } else if (schedulingState === "active") { + allDags = allDags.filter( + (dag) => !dag.is_paused && !("scheduling_state" in dag && dag.scheduling_state === "draining"), + ); } if (paused === "true") { diff --git a/airflow-core/src/airflow/ui/src/pages/Asset/AssetLayout.tsx b/airflow-core/src/airflow/ui/src/pages/Asset/AssetLayout.tsx index ac007410c496b..7bd53037598a5 100644 --- a/airflow-core/src/airflow/ui/src/pages/Asset/AssetLayout.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Asset/AssetLayout.tsx @@ -134,6 +134,9 @@ export const AssetLayout = () => { display="flex" flexDirection="column" gap={3} + height="100%" + minH={0} + minW={0} paddingInlineStart={2} // not 3 because the transparent resize handle is 1 unit wide >
diff --git a/airflow-core/src/airflow/ui/src/pages/Asset/AssetStateStore/AssetStateStore.tsx b/airflow-core/src/airflow/ui/src/pages/Asset/AssetStateStore/AssetStateStore.tsx index da27f134b42cc..7fb4d171ce0fe 100644 --- a/airflow-core/src/airflow/ui/src/pages/Asset/AssetStateStore/AssetStateStore.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Asset/AssetStateStore/AssetStateStore.tsx @@ -155,7 +155,7 @@ export const AssetStateStore = () => { const columns = getColumns({ assetId, translate }); return ( - + { await waitFor(() => expect(screen.getByText(shown)).toBeInTheDocument()); }); - it("ignores scheduling_state=active rather than filtering with no pill to explain it", async () => { + it("restores the dashboard Active Dags filter and excludes paused and draining Dags", async () => { + withDrainingDag(); render(); - // No choice means "not paused and not draining", so the param is inert instead of narrowing - // the list invisibly. - await waitFor(() => expect(screen.getByText("paused_dag")).toBeInTheDocument()); + await waitFor(() => expect(screen.getByText("tutorial_taskflow_api_success")).toBeInTheDocument()); + expect(screen.getByTestId("paused-pill")).toHaveTextContent("stats.activeDags"); + expect(screen.queryByText("paused_dag")).not.toBeInTheDocument(); + expect(screen.queryByText("draining_dag")).not.toBeInTheDocument(); + + await selectPillOption("paused", "not_paused"); + await waitFor(() => expect(screen.getByTestId("paused-pill")).toHaveTextContent("filters.paused.active")); + await waitFor(() => expect(screen.getByText("draining_dag")).toBeInTheDocument()); + expect(screen.queryByText("paused_dag")).not.toBeInTheDocument(); + + await selectPillOption("paused", "active"); + await waitFor(() => expect(screen.getByTestId("paused-pill")).toHaveTextContent("stats.activeDags")); + await waitFor(() => expect(screen.queryByText("draining_dag")).not.toBeInTheDocument()); expect(screen.getByText("tutorial_taskflow_api_success")).toBeInTheDocument(); - expect(screen.queryByTestId("paused-pill")).not.toBeInTheDocument(); + + fireEvent.click(screen.getByTestId("paused-pill-remove")); + await waitFor(() => expect(screen.getByText("paused_dag")).toBeInTheDocument()); + expect(screen.getByText("draining_dag")).toBeInTheDocument(); }); }); diff --git a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx index 8b1e114e67943..e7e37ff9f4416 100644 --- a/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx +++ b/airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx @@ -146,9 +146,7 @@ export const DagsList = () => { const multiTeamEnabled = Boolean(useConfig("multi_team")); - // Derived through the pill's own mapping so the query can never filter on more than the pill - // shows. A legacy ``scheduling_state=active`` has no choice to represent it, and would - // otherwise narrow the list with nothing on screen saying why. + // Derived through the pill's own mapping so the query can never filter on more than the pill shows. const { paused, schedulingState } = pausedStateToQuery(pausedStateFromSearchParams(searchParams)); const showFavorites = searchParams.get(FAVORITE); diff --git a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DagImportErrorsModal.tsx b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DagImportErrorsModal.tsx index 7adea18d4fe5b..5bf9dfe1545d7 100644 --- a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DagImportErrorsModal.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DagImportErrorsModal.tsx @@ -39,6 +39,7 @@ import { SearchBar } from "src/components/SearchBar"; import Time from "src/components/Time"; import { useConfig } from "src/queries/useConfig"; +import { useHasMultipleDagBundles } from "src/queries/useHasMultipleDagBundles"; import { createErrorToaster } from "src/utils"; type ImportDAGErrorModalProps = { @@ -89,6 +90,7 @@ export const DagImportErrorsModal = ({ onClose, open }: ImportDAGErrorModalProps const [searchQuery, setSearchQuery] = useState(""); const [pollAfterReparse, setPollAfterReparse] = useState(false); const autoRefreshInterval = useConfig("auto_refresh_interval") as number | undefined; + const hasMultipleBundles = useHasMultipleDagBundles(); const { data } = useImportErrorServiceGetImportErrors( { @@ -168,13 +170,15 @@ export const DagImportErrorsModal = ({ onClose, open }: ImportDAGErrorModalProps - - {translate("components:versionDetails.bundleName")} - {": "} - {importError.bundle_name} - {importError.filename} + {hasMultipleBundles ? ( + + {translate("importErrors.bundle")} + {": "} + {importError.bundle_name} + + ) : undefined} diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx index 1b7110d0a232a..d59745b9159c8 100644 --- a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/GroupTaskInstance.tsx @@ -18,12 +18,13 @@ */ import { ReactFlowProvider } from "@xyflow/react"; import { useTranslation } from "react-i18next"; -import { MdOutlineTask } from "react-icons/md"; +import { MdLoop, MdOutlineTask } from "react-icons/md"; import { useParams } from "react-router-dom"; import { DetailsLayout } from "src/layouts/Details/DetailsLayout"; import { useGridTiSummariesStream } from "src/queries/useGridTISummaries.ts"; +import { useIsLoopGroup } from "src/queries/useIsLoopGroup"; import { useDocumentTitle } from "src/utils"; import { Header } from "./Header"; @@ -38,7 +39,13 @@ export const GroupTaskInstance = () => { const gridTISummaries = summariesByRunId.get(runId); const taskInstance = gridTISummaries?.task_instances.find((ti) => ti.task_id === groupId); - const tabs = [{ icon: , label: translate("tabs.taskInstances"), value: "" }]; + const isLoopGroup = useIsLoopGroup(groupId); + + const tabs = [ + { icon: , label: translate("tabs.taskInstances"), value: "" }, + // Only a looped group has passes to list. + ...(isLoopGroup ? [{ icon: , label: translate("loop.iterations"), value: "iterations" }] : []), + ]; return ( diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/LoopIterations.test.tsx b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/LoopIterations.test.tsx new file mode 100644 index 0000000000000..21f6d0378bd9b --- /dev/null +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/LoopIterations.test.tsx @@ -0,0 +1,136 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import type { PropsWithChildren } from "react"; + +import "@testing-library/jest-dom/vitest"; +import { render, screen } from "@testing-library/react"; +import { MemoryRouter, Route, Routes } from "react-router-dom"; +import { beforeEach, describe, expect, it, vi } from "vitest"; + +import type { LoopSummaryResponse } from "openapi/requests/types.gen"; + +import { TimezoneProvider } from "src/context/timezone"; +import { BaseWrapper } from "src/utils/Wrapper"; + +import { LoopIterations } from "./LoopIterations"; + +let mockSummary: LoopSummaryResponse | undefined; + +vi.mock("src/queries/useLoopSummary", () => ({ + useLoopSummary: () => ({ data: mockSummary }), +})); + +const GROUP_PATH = "/dags/my_dag/runs/run_1/tasks/group/refine"; + +const buildSummary = (overrides: Partial = {}): LoopSummaryResponse => ({ + dag_id: "my_dag", + group_id: "refine", + iterations: [], + iterations_ran: 2, + max_iterations: 3, + run_id: "run_1", + status: "stopped_early", + ...overrides, +}); + +const renderAt = (search = "") => { + const wrapper = ({ children }: PropsWithChildren) => ( + + + + + {/* Parameterised so useParams gives the component its dag, run and group. */} + + + + + + ); + + return render(, { wrapper }); +}; + +beforeEach(() => { + mockSummary = undefined; +}); + +describe("LoopIterations", () => { + it("renders a row per pass with its decision reason", () => { + mockSummary = buildSummary({ + iterations: [ + { decision_reason: "error 0.17, needs < 1e-06", index: 1, state: "success", task_count: 2 }, + { decision_reason: "error 8.9e-07, needs < 1e-06", index: 2, state: "success", task_count: 2 }, + ], + stopped_at_iteration: 2, + }); + + renderAt(); + + expect(screen.getByText("error 0.17, needs < 1e-06")).toBeInTheDocument(); + expect(screen.getByText("error 8.9e-07, needs < 1e-06")).toBeInTheDocument(); + }); + + it("links each pass to the group's task instances scoped to it", () => { + mockSummary = buildSummary({ + iterations: [ + { index: 1, state: "success" }, + { index: 2, state: "failed" }, + ], + }); + + renderAt(); + + // The i18n mock echoes the key, so every row's link carries the same accessible name. + const links = screen.getAllByRole("link"); + // Newest first, so the top row is the last pass that ran. + const href = links[0]?.getAttribute("href") ?? ""; + const [pathname, search] = href.split("?"); + + expect(links).toHaveLength(2); + expect(links.map((link) => link.textContent)).toStrictEqual(["2", "1"]); + const params = new URLSearchParams(search); + + expect(pathname).toBe(GROUP_PATH); + expect(params.get("loop_id")).toBe("refine"); + expect(params.get("iteration")).toBe("2"); + }); + + it("drops a pinned row and any paging when a pass is picked", () => { + mockSummary = buildSummary({ iterations: [{ index: 1, state: "success" }] }); + + renderAt("?region_id=r1®ion_index=0&offset=20&dag_run_state=failed"); + + const href = screen.getAllByRole("link")[0]?.getAttribute("href") ?? ""; + const params = new URLSearchParams(href.split("?")[1]); + + expect(params.get("region_id")).toBeNull(); + expect(params.get("region_index")).toBeNull(); + expect(params.get("offset")).toBeNull(); + // Filters the page was reached with are not this control's to discard. + expect(params.get("dag_run_state")).toBe("failed"); + }); + + it("says so when the loop has reported no passes yet", () => { + mockSummary = buildSummary({ iterations: [] }); + + renderAt(); + + expect(screen.getByText(/noItemsFound/iu)).toBeInTheDocument(); + }); +}); diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/LoopIterations.tsx b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/LoopIterations.tsx new file mode 100644 index 0000000000000..31876ec788fa2 --- /dev/null +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/LoopIterations.tsx @@ -0,0 +1,137 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { Link as ChakraLink, Table, Text } from "@chakra-ui/react"; +import { useTranslation } from "react-i18next"; +import { Link as RouterLink, useParams, useSearchParams } from "react-router-dom"; + +import { LoopDecisionReason } from "src/components/LoopDecisionReason"; +import { StateBadge } from "src/components/StateBadge"; +import Time from "src/components/Time"; + +import { SearchParamsKeys } from "src/constants/searchParams"; +import { useLoopSummary } from "src/queries/useLoopSummary"; +import { useDurationFormat } from "src/utils"; + +import { reasonSentence } from "./loopUtils"; + +/** + * Every pass the loop ran, with the gate's reason for each. + * + * The header reports only the loop's final outcome, and the iteration switcher only labels a pass, + * so this is where a reason per pass is readable -- which is what you need to see why a loop ran + * as long as it did. + */ +export const LoopIterations = () => { + const { dagId = "", groupId = "", runId = "" } = useParams(); + // "dag" leads so reasonSentence's unprefixed loop.* keys resolve; common keys are prefixed. + const { t: translate } = useTranslation(["dag", "common"]); + const { formatElapsed } = useDurationFormat(); + const [searchParams] = useSearchParams(); + const { data: summary } = useLoopSummary({ dagId, groupId, runId }); + + const iterations = summary?.iterations ?? []; + + // Picking a pass scopes the group's task instances to it, the same move the breadcrumb's + // iteration switcher makes. A coordinate addresses one row and this names a whole pass, so the + // old one is dropped rather than sending you to a row that pass may not have; paging restarts + // because a cursor into one pass means nothing in another. + const iterationSearch = (index: number) => { + const next = new URLSearchParams(searchParams); + + next.set(SearchParamsKeys.LOOP_ID, groupId); + next.set(SearchParamsKeys.ITERATION, String(index)); + next.delete(SearchParamsKeys.REGION_ID); + next.delete(SearchParamsKeys.REGION_INDEX); + next.delete(SearchParamsKeys.CURSOR); + next.delete(SearchParamsKeys.OFFSET); + + return next.toString(); + }; + + if (iterations.length === 0) { + return ( + + {translate("common:noItemsFound", { modelName: translate("loop.iterations") })} + + ); + } + + // The pass that ended the loop, whichever way it ended; its row carries the outcome sentence. + const endedAt = summary?.failed_at_iteration ?? summary?.stopped_at_iteration; + // Newest first: the pass you came to read about is the one that just ran, and a loop near its + // limit would otherwise bury it. The summary counts them up, so this reverses a copy. + const newestFirst = [...iterations].reverse(); + + return ( + + + + {translate("common:filters.iteration")} + {translate("common:state")} + {translate("common:startDate")} + {translate("common:duration")} + {translate("common:task_other")} + {translate("common:taskInstance.loopDecision")} + + + + {newestFirst.map((iteration) => { + const ended = iteration.index === endedAt; + + return ( + + + + {/* ".." is the group's task instances tab, this tab's sibling. */} + + {iteration.index} + + + + + {iteration.state === null || iteration.state === undefined ? undefined : ( + + {translate(`common:states.${iteration.state}`)} + + )} + + + + {formatElapsed(iteration.start_date, iteration.end_date)} + {iteration.task_count} + + {iteration.decision_reason === undefined ? undefined : ( + + )} + + + ); + })} + + + ); +}; diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/loopUtils.ts b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/loopUtils.ts index 1d2833138e6c8..fcde1c43035cc 100644 --- a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/loopUtils.ts +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/LoopIterations/loopUtils.ts @@ -18,7 +18,7 @@ */ import type { LoopSummaryResponse } from "openapi/requests/types.gen"; -/** Value of the iteration URL parameter that selects every iteration. */ +/** One sentence saying how the loop ended, for the group header and the iterations table. */ export const reasonSentence = ( translate: (key: string, options?: Record) => string, summary: LoopSummaryResponse, diff --git a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/index.ts b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/index.ts index 5f9e069feee6b..b89e107d71890 100644 --- a/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/index.ts +++ b/airflow-core/src/airflow/ui/src/pages/GroupTaskInstance/index.ts @@ -18,3 +18,4 @@ */ export { GroupTaskInstance } from "./GroupTaskInstance"; export { GroupTaskInstances } from "./GroupTaskInstances"; +export { LoopIterations } from "./LoopIterations/LoopIterations"; diff --git a/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.test.tsx b/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.test.tsx index bcd4182f5bff3..9e01ae2cd259b 100644 --- a/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.test.tsx +++ b/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.test.tsx @@ -136,6 +136,30 @@ describe("Details state reason row", () => { }); }); +describe("Details retry at row", () => { + beforeEach(() => { + i18n.addResourceBundle("en", "common", commonLocale, true, true); + }); + + it("shows when a try waiting to be retried becomes due", () => { + renderDetails(buildTaskInstance({ retry_at: "2026-10-29T12:00:30Z", state: "up_for_retry" })); + + const row = screen.getByText(i18n.t("common:taskInstance.retryAt")).closest("tr"); + + expect(row).not.toBeNull(); + expect(within(row as HTMLElement).getByTestId("time-display")).toHaveAttribute( + "datetime", + "2026-10-29T12:00:30Z", + ); + }); + + it("omits the row when the try has no retry_at", () => { + renderDetails(buildTaskInstance({ retry_at: null, state: "up_for_retry" })); + + expect(screen.queryByText(i18n.t("common:taskInstance.retryAt"))).not.toBeInTheDocument(); + }); +}); + describe("Details loop context", () => { beforeEach(() => { i18n.addResourceBundle("en", "common", commonLocale, true, true); diff --git a/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.tsx b/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.tsx index 05314739c2be5..129fa910d1310 100644 --- a/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.tsx +++ b/airflow-core/src/airflow/ui/src/pages/TaskInstance/Details.tsx @@ -252,6 +252,14 @@ export const Details = () => {