Skip to content

Conversation

bmanan7
Copy link
Contributor

@bmanan7 bmanan7 commented Sep 18, 2025

Description

  • Update Airflow client to respect default_pool PATCH rules: send only slots and include_deferred with an update_mask.
  • Added a regression test so future changes keep the special-case behavior intact.

🎟 Issue(s)

Related #1909

🧪 Functional Testing

Tried copying pool with different slot values and number of pools and each request was successful. Attached screenshots from UI.

./astro deployment pool copy --source-id cme0XXXXXX --target-id cme0XXXXXX

Using an Astro API Token
Copying Pool default_pool
Copying Pool test-pool
Copying Pool second_pool
==============
./astro deployment pool copy --source-id cme0XXXXXX --target-id cme0XXXXXX

Using an Astro API Token
Copying Pool default_pool
Copying Pool test-pool
Copying Pool second_pool
Copying Pool Fourth-pool

go test -count=1 ./airflow-client
ok  	github.com/astronomer/astro-cli/airflow-client	0.667s

📸 Screenshots

Confirmed from UI that the default pool slot value is being updated and reflected without any errors.
image

image

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and [Astronomer] (https://github.com/astronomer/astronomer/) (if necessary). - NA
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation - NA

@bmanan7 bmanan7 self-assigned this Sep 18, 2025
@bmanan7 bmanan7 marked this pull request as ready for review September 18, 2025 04:15
Comment on lines 188 to 194
payload = struct {
Slots int `json:"slots"`
IncludeDeferred bool `json:"include_deferred"`
}{
Slots: pool.Slots,
IncludeDeferred: pool.IncludeDeferred,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I am wrong, but based on the airflow code, I think you just need to pass the update_mask in the path param for the default pool. So no need to exclusively send these two fields, airflow will take care of selecting these two fields from the request body based on the update_mask path param

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. You’re right. Airflow handler only enforces that update_mask is supplied and constrained, it doesn’t object to extra fields in the body. I have updated code to keep it straight forward i.e just appending update_mask=slots&update_mask=include_deferred when the pool name is default_pool.

Copy link

coveralls-official bot commented Sep 18, 2025

Pull Request Test Coverage Report for Build ac408698-168f-4800-b0a2-f20ccdda36df

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 38.161%

Files with Coverage Reduction New Missed Lines %
docker/docker.go 2 46.81%
Totals Coverage Status
Change from base Build 04c39e19-4d56-4706-a6ef-480413713603: 0.01%
Covered Lines: 23779
Relevant Lines: 62312

💛 - Coveralls

@bmanan7 bmanan7 force-pushed the bugfix/1909-handle-default-pool branch from af5fa62 to 87e2374 Compare September 18, 2025 17:59
@bmanan7 bmanan7 requested a review from neel-astro September 19, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants