Repository navigation
5.45.5: readable quick-status and traffic-report, current scripts on rebuild - #289
Merged
Merged
Conversation
Both playbooks gave Ansible a list of lines, which it prints as one quoted '- ...' item per line. Print a single multi-line string instead, which the YAML result format shows as a readable block. quick-status joins with a real newline variable, since a backslash-n inside a block scalar stays two characters. It also shows the newest five client-error and login lines rather than the oldest five of the last ten.
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.
Summary
Two fixes in one release, 5.45.5.
1.
quick-statusandtraffic-reportprint a plain reportBoth playbooks passed Ansible a list (
msg: [...],stdout_lines). Ansible prints each list item as its own entry, so the report came out as- 'text'lines with a- ''for every blank line.trellis/monitoring/quick-status.yml: one multi-linemsg: |string. Anlvariable supplies a real newline forjoin, because'\n'inside a block scalar stays two characters.trellis/monitoring/traffic-report.yml: printstdoutinstead ofstdout_lines.quick-statusnow shows the newest five client-error and login-attempt lines ([-5:]), not the oldest five of the last ten.2. A local rebuild runs its own scripts
A binary with no checkout beside it extracts its embedded scripts to
assets-<version>in the cache, and the version is the top CHANGELOG heading. Two builds of one working tree share it, so after editing a playbook and rebuilding, the new binary kept running the first build's copy.go/cmd/env.go: the directory is nowassets-<version>-<hash>, where the hash covers every embedded file's path and contents. The old-extraction sweep matches on theassets-prefix, so it keeps working.Testing
quick-statusandtraffic-reportagainst a production site; the output is plain text blocks.go test ./...passes, including new tests that the hash changes on an edit or a rename and ignores declaration order, and that the extraction directory carries the version and the hash.maininto the branch; the only conflict was the CHANGELOG entry order (5.45.5 above 5.45.4).