-
Notifications
You must be signed in to change notification settings - Fork 9
Job Logging v2 #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Job Logging v2 #122
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4dd7ac1
accept the documented Layout and RFC850 timestamp formats
leontappe d7b255d
log the resolved timestamp layout at debug level
leontappe 3175986
only warn when a canFail boot job actually failed
leontappe 4ddd2d5
log persistent forward-write errors once per failure streak
leontappe 7d9f4c1
decorate watch command output like the job's own output
leontappe 8865c4a
repair the bare-mittnite fallback to up
leontappe 5faf9a1
enable job output decoration by default
leontappe 76c5c60
document the v2 opt-out log defaults and breaking changes
leontappe 0388d8e
harden round-2 tests after adversarial review
leontappe 40ddbc9
address review: clarify tri-state docs, warn with the effective value
leontappe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Changelog | ||
|
|
||
| Release notes are generated from commits by goreleaser; this file documents the breaking changes of major releases. | ||
|
|
||
| ## v2.0.0 | ||
|
|
||
| ### Breaking changes | ||
|
|
||
| - **Job output decoration is on by default.** Every line of every job and boot job is prefixed with `[<RFC3339 timestamp>] [<job name>] `. Opt out globally with `mittnite up --job-log-timestamps=false --job-log-name-prefix=false` or `MITTNITE_JOB_LOG_TIMESTAMPS=0` / `MITTNITE_JOB_LOG_NAME_PREFIX=0`; opt out per job with `enableTimestamps = false` / `enableNamePrefix = false` (explicit per-job values always win, as before). | ||
| - **Decorated output is forwarded line-wise through mittnite.** Single lines longer than 64 KiB are forwarded in chunks, and other jobs' output may interleave between the chunks of such a line on a shared target. Jobs that write binary data or machine-parsed output (e.g. JSON log lines consumed by a strict collector) to stdout/stderr should opt out per job — with both options disabled, the output streams are attached directly and stay byte-identical to v1. | ||
| - **`MITTNITE_JOB_LOG_*` semantics changed:** unset now means *enabled*; unparsable values fall back to *enabled*, with a startup warning naming the assumed value. | ||
| - **Watch `preCommand`/`postCommand` output is now decorated** with the owning job's timestamp/name prefix. | ||
| - The Docker tags `stable` and `latest` on quay.io move to v2 with this release — pin `quay.io/mittwald/mittnite:v1` to defer the migration. | ||
|
|
||
| ### Other changes | ||
|
|
||
| - `Layout` and `RFC850` are now accepted `timestampFormat` values; both were documented but previously warned "unknown timestamp format" and fell back to RFC3339. | ||
| - The "logging with timestamp layout" message moved from info to debug level — it fired once per job start *and restart*. | ||
| - Successful `canFail` boot jobs no longer log a spurious "job failed, but is allowed to fail" warning with an empty error. | ||
| - Persistent write errors on a broken log target are logged once per failure streak instead of once per output line. | ||
| - Running `mittnite` without a subcommand falls back to `up` again — it crashed on a nil function since v1.x (broken in `cdb2ecf`, 2023). | ||
|
|
||
| ## v1 and earlier | ||
|
|
||
| See the [GitHub releases](https://github.com/mittwald/mittnite/releases). |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| // The bare-mittnite fallback must delegate to up's RunE: up defines no Run, | ||
| // so a Run-based delegation calls a nil function — exactly the crash the v2 | ||
| // fallback repair removed. | ||
| func TestRootFallbackDelegatesToUpRunE(t *testing.T) { | ||
| require.Nil(t, up.Run, "up switched to RunE in cdb2ecf; a Run delegation would be a nil call") | ||
| require.NotNil(t, up.RunE) | ||
| require.Nil(t, rootCmd.Run, "the fallback must use RunE, matching up") | ||
| require.NotNil(t, rootCmd.RunE) | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.