Skip to content

Commit a77ef6a

Browse files
docs: record the deliberate differences, and pin the parity row exactly
MissingSchema is a ValueError, so the row that exists to record released parity could not tell the two apart; it asserts the exact class now. The README and a release-notes draft carry the differences a caller can observe, including the console script this branch removed.
1 parent 114aef8 commit a77ef6a

3 files changed

Lines changed: 65 additions & 1 deletion

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,26 @@ types the target lacks (listed in the end-of-run report).
161161
- Run the source and target on the same (or a newer-target) Unstract build.
162162
- Use `unstract-client >= 1.4.0`, the first release that ships the clone command.
163163

164+
## Behaviour that differs from earlier releases
165+
166+
Deliberate, and listed here so a difference is not rediscovered as a bug:
167+
168+
- **The status poll is resolved under the deployment URL's own path prefix.**
169+
Earlier releases concatenated the base URL and the endpoint the service
170+
returned, which never reached a deployment served under an ingress or reverse
171+
proxy path. Where no prefix can be derived from the deployment URL, the
172+
endpoint the service returned is used as it came.
173+
- **An absolute `status_check_api_endpoint` now resolves.** Concatenation
174+
produced `https://hosthttps://host/...`, which reached nothing at all; it is
175+
joined instead.
176+
- **Query parameters this client sets win a collision** with the ones on the
177+
returned endpoint. Everything else on that endpoint is forwarded unchanged.
178+
- **A malformed `api_url` raises this client's own exception classes**
179+
`APIDeploymentsClientException` for a URL with no host, `MissingSchema` for one
180+
with no scheme — where earlier releases raised `InvalidSchema` for both. Code
181+
catching `requests.exceptions.RequestException` around client construction no
182+
longer catches the first of those.
183+
164184
## Questions and Feedback
165185

166186
On Slack, [join great conversations](https://join-slack.unstract.com/) around LLMs, their ecosystem and leveraging them to automate the previously unautomatable!

RELEASE_NOTES.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Release notes — draft
2+
3+
Content for the next release. Not published yet.
4+
5+
## Breaking
6+
7+
**The `unstract` console script is gone.** Installing this package no longer
8+
puts an `unstract` command on your PATH.
9+
10+
- The clone command is still here: run it as `python -m unstract.clone`, with
11+
the same options it has always taken.
12+
- The name now belongs to the `unstract-cli` package, whose `unstract clone`
13+
wraps this same code.
14+
15+
An environment that holds both an older release of this package and the new CLI
16+
gives the name to whichever was installed last, so check what answers before
17+
reporting a missing command:
18+
19+
```bash
20+
command -v unstract && unstract --version
21+
```
22+
23+
## Behaviour that differs from earlier releases
24+
25+
Deliberate; each is described in the README under *Behaviour that differs from
26+
earlier releases*:
27+
28+
- The status poll resolves under the deployment URL's own path prefix, and falls
29+
back to the endpoint the service returned where no prefix can be derived.
30+
- An absolute `status_check_api_endpoint` resolves instead of being concatenated
31+
into an unreachable URL.
32+
- Query parameters this client sets win a collision with the returned
33+
endpoint's; everything else on that endpoint is forwarded.
34+
- A malformed `api_url` raises this client's own exception classes rather than
35+
`InvalidSchema`.
36+
37+
## Under the hood
38+
39+
The HTTP layer is generated from the service's OpenAPI spec and runs on `httpx`.
40+
Transport failures are still raised as their `requests` equivalents, so code
41+
catching `ConnectionError`, `Timeout` and the rest keeps working.

tests/test_compat.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,12 @@ def test_a_malformed_deployment_url_raises_the_class_this_client_chose(
172172
caller wrapping construction in ``except RequestException`` no longer catches
173173
the first, which is the part that has to be visible.
174174
"""
175-
with pytest.raises(expected):
175+
with pytest.raises(expected) as caught:
176176
client = _client(api_url=api_url)
177177
client.check_execution_status(STATUS_ENDPOINT)
178+
# MissingSchema is itself a ValueError, so the parity row can only tell the
179+
# two apart by the exact class.
180+
assert type(caught.value) is expected
178181

179182

180183
def _httpx_request_errors():

0 commit comments

Comments
 (0)