Skip to content

fix(hitl): show mapped task instances on /required_actions listing#66433

Open
paultmathew wants to merge 1 commit intoapache:mainfrom
paultmathew:fix/66428-required-actions-mapped-listing-default
Open

fix(hitl): show mapped task instances on /required_actions listing#66433
paultmathew wants to merge 1 commit intoapache:mainfrom
paultmathew:fix/66428-required-actions-mapped-listing-default

Conversation

@paultmathew
Copy link
Copy Markdown

Fixes #66428.

Why

/required_actions and the per-DAG / per-Run / per-Task Required Actions
tabs all silently dropped HITL rows for mapped task instances because the
listing component hard-coded mapIndex: parseInt(searchParams.get(MAP_INDEX) ?? "-1", 10),
which always sent map_index=-1 and filtered to non-mapped TIs only.
Issue #66428 has the full repro and access-log evidence.

What

  • Pass mapIndex to the listing call only when the user has explicitly
    set the map_index URL search param. Default behaviour is now
    "all map indexes" (no filter) instead of "non-mapped only", and
    map_index=-1 continues to work as an opt-in filter for non-mapped
    task instances.
  • Fix the auto-refresh predicate that compared
    responded_at === undefined instead of === null. The API serializes
    responded_at as JSON null, never an omitted field, so the predicate
    never matched and the page never polled for new pending actions while
    open. The issue's "Anything else" section flagged this; the OP offered
    to roll it into the same PR and there has been no maintainer pushback,
    so it is included here.

Tests

  • Added HITLTaskInstances.test.tsx covering the three URL-param
    branches (map_index absent / set to 2 / set to -1) and the
    refetch predicate for both responded_at: null and a populated value.
  • Locally verified with pnpm exec vitest run src/pages/HITLTaskInstances/HITLTaskInstances.test.tsx
    (5/5 passing), pnpm exec eslint src/pages/HITLTaskInstances/,
    pnpm exec tsc -p tsconfig.app.json --noEmit, and prek run --files
    on the changed files.

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Made with Cursor

Fixes apache#66428.

The Required Actions listing component hard-coded
``mapIndex: parseInt(searchParams.get(MAP_INDEX) ?? "-1", 10)``, which
always sent ``map_index=-1`` and silently filtered every page (the global
``/required_actions`` view as well as the per-DAG / per-Run / per-Task
Required Actions tabs) down to non-mapped task instances. Mapped HITL
rows were therefore counted by the home-page badge but invisible in the
listing pages.

* Pass ``mapIndex`` to ``useTaskInstanceServiceGetHitlDetails`` only when
  the user has explicitly set the ``map_index`` URL search param. The
  default behaviour is now "all map indexes" (no filter) instead of
  "non-mapped only", and ``map_index=-1`` continues to work as an opt-in
  filter for non-mapped task instances.
* Fix the auto-refresh predicate that compared ``responded_at === undefined``
  instead of ``=== null``. The API serialises ``responded_at`` as JSON
  ``null``, never an omitted field, so the predicate never matched and
  the listing never polled for new pending actions.
* Add ``HITLTaskInstances.test.tsx`` covering the three ``map_index``
  URL branches (absent / set to integer / set to ``-1``) and the refetch
  predicate for both ``responded_at: null`` and a populated value.

Signed-off-by: Paul Mathew <ptmathew96@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 5, 2026
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented May 5, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@bbovenzi bbovenzi added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 5, 2026
@bbovenzi bbovenzi added this to the Airflow 3.2.2 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: /required_actions page silently filters out all mapped HITL tasks (sends map_index=-1 by default)

2 participants