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

   ## Why
   
   `airflowctl backfill pause`, `unpause` and `cancel` have never worked. The 
API
   server registers all three routes as `PUT`
   (`airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py`),
   but the client sends `POST`, so the server answers `405 Method Not Allowed` 
and
   the CLI raises instead of acting on the backfill. The routes have been `PUT`
   since they were introduced in the AIP-84 migration, so there is no server
   version where `POST` worked.
   
   The practical impact is that an operator who needs to stop a runaway backfill
   cannot do it from the CLI.
   
   The mismatch stayed invisible because the three tests asserted only
   `request.url.path`. `httpx.MockTransport` has no route table, so it returned
   `200` for any verb.
   
   ## What
   
   - `airflow-ctl/src/airflowctl/api/operations.py` — 
`BackfillOperations.pause`,
     `unpause` and `cancel` now use `client.put` instead of `client.post`.
   - `airflow-ctl/tests/airflow_ctl/api/test_operations.py` — added
     `assert request.method == "PUT"` to `test_pause`, `test_unpause` and
     `test_cancel`, matching the eight existing method assertions elsewhere in 
the
     file. Reverting the client change makes exactly these three tests fail.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to