Skip to content

Fix job logs and the truncated flag, release 1.0.1 - #1

Merged
Klaas-Ritense merged 3 commits into
mainfrom
fix/job-logs-redirect-and-truncated-flag
Sep 14, 2026
Merged

Klaas-Ritense merged 3 commits into
mainfrom
fix/job-logs-redirect-and-truncated-flag

Conversation

@Klaas-Ritense

Copy link
Copy Markdown
Member

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-logs returned no log at all

GitHub serves an Actions log as a 302 to pre-signed blob storage. That 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 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 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 reports available: false with the reason.

A full list was reported as truncated

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 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.properties and projects/plugin/package.json. gradle.properties projectVersion=0.0.1 is the root Gradle project version and never reaches an artifact, so it is left alone.

Verification

  • 80 backend tests pass (8 new), ktlint and frontend lint clean
  • Redirect behaviour and the absent token on the second hop both verified against MockWebServer
  • Generated POM resolves to com.ritense.valtimoplugins:github:1.0.1; built npm package to @valtimo-plugins/github@1.0.1

Worth doing before merge: the redirect path is only exercised against MockWebServer. A manual get-job-logs run 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.md and its README link, which were already in the working tree — kept as a separate commit.

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.
@Klaas-Ritense
Klaas-Ritense merged commit 9fa4b40 into main Sep 14, 2026
2 checks passed
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.

1 participant