Repository navigation
An answer with no code says whether waiting will help - #112
Merged
Merged
Conversation
A refusal whose body is not the wire envelope carries no code. The service's own handlers always write the envelope, so such an answer came from something else: a proxy in front of the service while it restarts, a router answering for a route it does not serve, a captive portal, or an address that points elsewhere. It was answered as a code this build does not know: it gave up, said updating curious may help, and quoted the client's own "could not parse" sentence as the server's words. Each of the six handler switches now meets the empty code in a case of its own, and the HTTP status decides between two new answers: - server-error-unexplained (Wait) for any 5xx, 408, 425 and 429, which pass on their own; - server-request-unserved (GiveUp) for every other status, including a redirect, which curious never follows. It says what to check. Neither quotes anything or claims the build is older or newer than the server. Each site says what it can and cannot tell about what had already happened: a publish or a start may have been acted on, a login code may be spent, and a build log answered this way may mean the build ended with the service. The build log also gains a case for internal, the server's own fault while reading the deploy: server-fault, Wait, the message quoted. The dispatch guard now requires every handler switch to answer the empty code with the two new answers, and the shared answer's own empty-code branch and its exception are gone. The catalog and the README move with the ids. The test servers gain a refusal with no envelope, honoured everywhere a scripted answer is written or tested, and the build-log server can refuse before it streams.
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.
What this changes
A refusal whose body is not the wire envelope carries no code. The service's own handlers always write the envelope, so such an answer came from somewhere else: a proxy in front of the service while it restarts, a router answering for a route or method it does not serve, a captive portal, or a
CURIOUS_API_URLpointing elsewhere.Until now it was answered as a code this build does not know. It gave up, said "Updating curious may help: this build may be older than the server.", and quoted the client's own "could not parse" sentence as if the server had written it. A proxy's 502 passes on its own, and updating changes nothing about it.
Each of the six handler switches now meets the empty code in a
case "":of its own. The HTTP status decides between two new failure ids:server-error-unexplainedserver-request-unservedNeither answer quotes anything, and neither claims the build is older or newer than the server. Both show the HTTP status. The GiveUp answer names
CURIOUS_API_URLand anything in between as the things to check.Each site says what it can and cannot tell about what had already happened:
The build log also gains a case for
internal:server-fault, Wait, and the server's message quoted, in the shape of the start's owninternalcase. Two comments that said a refusal "will say the same thing next time" now say only that a refusal stops rather than reconnects.unrecognisedAnswerloses its empty-code branch, and its guard exception goes with it.catalog.jsonand the README gain the two ids, andserver-faultgains a build-log line.The guards
TestEveryCodeSwitchAnswersAnAnswerWithNoCode(new, beside the dispatch guard). Every handler switch overwire.ErrorCodemust have acase "":that names the empty code alone. Every return in that case must be one of the two new answers, and the case must reach both.Rows
New, each red on
mainfirst:TestACodelessAnswerThatCanClearSaysWait: a 502 at all six handlers.TestACodelessAnswerThatCannotClearGivesUp: a 404 at all six handlers, and a 307 at the capacity check.TestTheStatusDecidesWhetherACodelessAnswerCanClear: at the create, 408, 425, 429 and 500 take Wait; 302, 405, 409 and 499 take GiveUp.TestACodelessAnswerAtTheCapacityCheckIsRetriedThenSaysWait: over httptest. An empty 502 takes 3 attempts; atext/plain405 takes 1.TestACodelessAnswerAtTheLoginStopsAndSaysWait: an empty 502 throughLoginStartandLoginVerify, over httptest.TestALoginRefusalWithNoCodeIsRenderedAsTheFailure: both MCP login tools render the failure, not the "can be recovered from" answer.TestTheBuildLogsInternalSaysWait: a full deploy whose build log is refused with a 500internal.TestEveryCodeSwitchAnswersAnAnswerWithNoCode: the guard row above.A control, green on both trees:
TestTheBuildLogsRateLimitStaysWithTheSharedAnswer.Existing rows edited:
TestAnAnswerWithNoCodeIsNotSaidToHaveOne. It pinned the old Why and that the client's sentence was quoted. It now asserts the reverse.TestACodelessAnswerThatCannotClearGivesUp, after its red. Its expected Why gained theCURIOUS_API_URLsentence the settings guard requires.The test servers can now send a refusal with no envelope. It is honoured everywhere a scripted answer is written or checked. The build-log server can refuse before it streams.
Required mutations, each run and reverted:
case "":clauses: every code-less row reds;internalcase: its row reds;case "":: the guard reds.Not changed
rate_limitedandunauthorizedon the build log.deploy_status.