Fix job logs and the truncated flag, release 1.0.1 - #1
Merged
Merged
Conversation
documentation/handleiding.md covers setting the plugin up in the admin UI and wiring actions into a process, without assuming programming knowledge, and links on to plugin.md for the precise property names and return shapes. Linked from the README beside the existing documentation.
Both were found by reading the code against what it promises, and both are the same shape of defect: an answer a process would act on that was not true. get-job-logs returned no log at all. GitHub serves an Actions log as a 302 to pre-signed blob storage, and the redirect was not being followed: Spring's RestClient picks up Apache HttpClient5 here, which does not follow redirects, and a 302 is not an error status, so the empty body was taken as success. The action then reported `available: true` with the literal string "null" as the log — the one action whose purpose is to say why a job failed said nothing, and said it had succeeded. GitHubClient.getText now follows the redirect by hand, deliberately without the Authorization header: the blob URL carries its own signature, the host is not GitHub, and a client configured to follow redirects generally would hand the configuration's token to a third party that never needed it. The text comes from the raw bytes rather than the parsed tree, because a log whose first line parses as JSON — a bare timestamp does — would otherwise come back as that one value with the rest dropped. A log GitHub will not hand over now reports `available: false` with the reason. getPaged called a list truncated whenever it stopped on its limit, without checking whether GitHub had offered another page. A list of exactly `limit` items had not been cut short, so a process branching on the flag — which the flag exists for, since a truncated read is otherwise indistinguishable from a short one — took the "there is more to do" path on every run. Truncation now means something was actually left behind. Both verified against MockWebServer, including that the token does not travel to the redirect target. 80 tests pass.
Patch: the two fixes change no action, property or return shape, only answers that were wrong. Backend and frontend move together. Note the published versions come from plugin.properties and projects/plugin/package.json — gradle.properties projectVersion is the root Gradle project version and never reaches an artifact, so it is left alone.
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.
Two defects found by reading the code against what it promises, plus the release that carries them. Both are the same shape: an answer a process would act on that was not true.
get-job-logsreturned no log at allGitHub serves an Actions log as a 302 to pre-signed blob storage. That redirect was not being followed — Spring's
RestClientpicks up Apache HttpClient5 here, which does not follow redirects, and a 302 is not an error status, so the empty body was taken as success. The action reportedavailable: truewith the literal string"null"as the log.The one action whose purpose is to say why a job failed said nothing, and said it had succeeded.
GitHubClient.getTextnow follows the redirect by hand, deliberately without theAuthorizationheader: the blob URL carries its own signature, the host is not GitHub, and simply enabling redirect-following would have handed the configuration's token to a third party that never needed it. The text comes from the raw bytes rather than the parsed tree — a log whose first line parses as JSON (a bare timestamp does) would otherwise come back as that one value with the rest dropped. A log GitHub will not hand over now reportsavailable: falsewith the reason.A full list was reported as truncated
getPagedcalled a list truncated whenever it stopped on its limit, without checking whether GitHub had offered another page. A list of exactlylimititems had not been cut short, so a process branching on the flag took the "there is more to do" path on every run — and that flag exists precisely because a truncated read is otherwise indistinguishable from a short one.Release 1.0.1
Patch: no action, property or return shape changes. Backend and frontend move together.
Note the published versions come from
plugin.propertiesandprojects/plugin/package.json.gradle.propertiesprojectVersion=0.0.1is the root Gradle project version and never reaches an artifact, so it is left alone.Verification
com.ritense.valtimoplugins:github:1.0.1; built npm package to@valtimo-plugins/github@1.0.1Worth doing before merge: the redirect path is only exercised against MockWebServer. A manual
get-job-logsrun against a live repository — where the blob response is real and large — would be worth one pass, since merging publishes to Maven Central and npm irreversibly.Also included
documentation/handleiding.mdand its README link, which were already in the working tree — kept as a separate commit.