Skip to content

Preserve percent sequences in JSON job logs#3877

Merged
DrJosh9000 merged 1 commit intobuildkite:mainfrom
friel-openai:fix-json-job-log-percent-format
May 3, 2026
Merged

Preserve percent sequences in JSON job logs#3877
DrJosh9000 merged 1 commit intobuildkite:mainfrom
friel-openai:fix-json-job-log-percent-format

Conversation

@friel-openai
Copy link
Copy Markdown
Contributor

Description

JSONJobLogger.Write currently passes job output directly to Logger.Info. Logger.Info treats its first argument as a Go format string, so job output containing a percent sequence can be rewritten before it reaches the JSON msg field.

This PR changes JSONJobLogger.Write to pass the job output as a %s argument instead. That keeps literal output such as Receiving objects: 0% (1/140) unchanged.

Context

We observed JSON job logs where literal percent sequences in command output were changed by Go formatting before log consumers saw them.

Changes

  • Preserve literal percent sequences in JSONJobLogger.Write.
  • Add a regression test for a Git-style progress line containing %.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go tool gofumpt -extra -w .)

Disclosures / Credits

I used Codex to inspect the logging path, make this small patch, and run the local tests.

@friel-openai friel-openai marked this pull request as ready for review May 1, 2026 23:08
@friel-openai friel-openai requested review from a team as code owners May 1, 2026 23:08
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@nsuma8989 nsuma8989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@DrJosh9000 DrJosh9000 enabled auto-merge May 3, 2026 23:28
@DrJosh9000 DrJosh9000 merged commit 53338d0 into buildkite:main May 3, 2026
3 checks passed
@buildkate buildkate mentioned this pull request May 4, 2026
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.

3 participants