Repository navigation
docs: make free-cloud detection canonical in get_free_clouds - #77
Merged
Merged
Conversation
Document get_free_clouds as the canonical free-cloud API: server-side semantics (no active assignment, future-scheduled clouds excluded via their active assignment, spare pool excluded via server config), the response contract including the last_redefined reservation-lock field, and APINotFound on servers older than 2.1 lacking /clouds/free/. Pin the contract in tests (full payload passthrough, 404 handling) and add a usage docs section with the reservation-lock hint recipe. Version bump to 0.1.18. fixes: #76
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
ttlogan
reviewed
Oct 11, 2026
ttlogan
left a comment
There was a problem hiding this comment.
Reviewed it as a fresh look. No findings.
Verified independently:
- get_free_clouds is a raw passthrough. The @returns("List[Cloud]") decorator only sets func._returns; it does not wrap or transform the return value, so this is genuinely zero runtime change.
- The new test_get_free_clouds_not_found mirrors the move-status pattern and matches _make_request exactly: 404 with a non-JSON body raises APINotFound("Resource not found").
- The empty-case fix (from {"clouds": []} to []) and the happy-path fixture (bare list with id/name/last_redefined, full passthrough asserted) pin the real server payload shape.
- get_free_clouds has no callers in this repo, so nothing here breaks; the client-side consumers are in quads-client.
- Version bump is consistent across setup.py, init.py, the rpm spec and CHANGELOG. Docs check is green and the reST underline matches the section title.
All green, nothing blocking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #76.
Related: quadsproject/quads-client#193, quadsproject/quads-client#194.
What it does:
QuadsApi.get_free_clouds()as the canonical free-cloud API in a napoleon docstring: a cloud is free when it has no active assignment (which also excludes future-scheduled clouds, since their assignments are active), the spare pool is excluded server-side via the server'sspare_pool_nameconfig, and the raw response is a JSON list of cloud dicts withid,nameandlast_redefined(RFC 1123 GMT).last_redefined; the empty case is corrected from{"clouds": []}to[]; addstest_get_free_clouds_not_found(404 ->APINotFound, mirroring the move-status pattern) for servers older than 2.1 that lack/clouds/free/.docs/usage.rstwith the reservation-lock hint recipe (last_redefinedplus client-sidecloud_reservation_lockhours; the lock window is not server-exposed).__init__.py, rpm spec, CHANGELOG), mirroring the in-branch convention from [publish] fix: handle edge case for old QUADS servers. #74.Notes:
last_redefined) already flows to clients; only the contract was unpinned and undocumented.get_free_cloudshas existed since the first quads-lib release (0.1.0);/clouds/free/exists on QUADS servers since v2.1.0 (commit b63e2f1). Only 1.x and 2.0.x servers 404, which surfaces asAPINotFoundper the pattern added in 61f5ddf.cmd_find_free_cloudand GUI_get_free_cloudsbecoming thinapi.get_free_clouds()wrappers) can land on top of this; no client-side v2.0.x fallback is needed given theAPINotFoundbehavior above.latest, the merge/publish commit needs the[publish]marker per publish.yml to actually ship to PyPI.Note
Server endpoints
GET /clouds/free/,/schedules/currentand/schedules/futurehave nocheck_accessdecorator (not admin-gated server-side); that is tracked in the quads server repo and out of scope here.