Skip to content

fix(harvest-learnings): draft every '## ' section of a bug log, not only the first - #527

Closed
saingge wants to merge 1 commit into
MendixMau:masterfrom
saingge:fix/harvest-multi-entry
Closed

saingge wants to merge 1 commit into
MendixMau:masterfrom
saingge:fix/harvest-multi-entry

Conversation

@saingge

@saingge saingge commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Branch fix/harvest-multi-entry, one commit on origin/master 393d253. Lane 3 (direct).

What changed and why

bin/harvest-learnings.sh section 1 splits each bug-logs/*.md file on its ## headings with
awk. The splitter ended each section with print buf "\x01", and print appends a newline after
the delimiter. Every section after the first therefore began with an empty line, read an empty
heading and was skipped, so each bug-log file drafted one entry. It is printf "%s\x01", buf
now. T5 in tests/wave2/test-harvest-learnings.sh pins it on a two-file fixture.

Impact

Row Answer
Process none. No step or gate added or removed.
Dependencies bin/harvest-learnings.sh and its own fixture only. No shared file, no new tool, no new artifact read.
Context cost none: no routed or always-loaded file touched.
Behaviour n/a: scripts only.
Runtime n/a. The awk pass is unchanged apart from the delimiter write.

Field evidence

A Mendix 10.24 app, mxcli v0.27.0, 43 bug-log files holding 54 ## sections. The script at
393d253 drafts 43 (one per file); the fixed script drafts 54. Run with --to a scratch directory,
so nothing was written to the project or the toolkit.

Checklist

  • No client data anywhere in the diff (leak guard plain and with LEAKGUARD_BASE=origin/master, then a read of the diff).
  • Size: 6 files, 150 insertions and 2 deletions; the counted part (script plus test) is 68 lines, the rest is fixtures, a capture note and CHANGELOG.
  • Test tier: T1. One fixture, test-harvest-learnings.sh, plus the T2 field run above.
  • Golden input: the fixture keeps the structure of a captured field log (heading prefixes, > status blocks, a fenced block, a non-bug section, the last section ending in one newline). Only the text was replaced; CAPTURE.md says so.
  • Both layouts: n/a. The script takes a project root and reads bug-logs/ under it.
  • Both platforms: only macOS awk 20200816 was checked (the delimiter bytes come out as \n \001, then \001). Not run under mawk, BusyBox awk or Git Bash. printf "%s\x01" is plain awk, but that is not tested here.
  • CHANGELOG line under ## Unreleased, credited.
  • [n/a] New skill; new bug entries.

Verification

Run in a clone of master at 393d253 and in this branch.

# master's bin/harvest-learnings.sh (393d253), fixture from this branch
bash tests/wave2/test-harvest-learnings.sh <clone-at-393d253>/bin/harvest-learnings.sh
  FAIL 2 sections drafted, expected 7
  FAIL headings not drafted
  PASS=18 FAIL=2

# the fixed script
bash tests/wave2/test-harvest-learnings.sh bin/harvest-learnings.sh
  ok   7 of 7 fixture sections drafted, across 2 files
  ok   every heading drafted by name, the later sections of each file included
  ok   the known heading, added as a later section, is not drafted
  PASS=20 FAIL=0

bin/check-pr-discipline.sh   -> clean
bin/check-no-client-data.sh  -> no client data detected
LEAKGUARD_BASE=origin/master bin/check-no-client-data.sh -> no new capitalised words

…nly the first

The awk splitter ended each section with print buf "\x01", and print appends a
newline after the delimiter. Every section after the first therefore began
with an empty line, read an empty heading and was skipped, so each bug-log
file drafted one entry. It now uses printf "%s\x01", buf.

Test: tests/wave2/test-harvest-learnings.sh T5 runs on a two-file fixture
(5 and 2 sections) that keeps the structure of a captured field log, with its
text replaced (see the fixture's CAPTURE.md). T5 expects all 7 sections to be
drafted and a heading the toolkit log already carries to be filtered out.
Run against origin/master 393d253: with master's bin/harvest-learnings.sh the
fixture passes 18 of 20 checks and T5 fails (2 of 7 sections drafted); with
the fixed script it passes 20 of 20.

Field run, a Mendix 10.24 app with mxcli v0.27.0 (43 bug-log files, 54 '## '
sections): the script at 393d253 drafts 43, the fix drafts 54. The splitter's
delimiter bytes were checked under macOS awk 20200816 only.
@MendixMau

Copy link
Copy Markdown
Owner

Thanks @saingge! Independent review: MERGE. We moved your commit unchanged, with your authorship, into #553, so CI runs without fork approval and we can handle CHANGELOG conflicts. This PR closes when #553 merges; the merge commit carries a Co-authored-by line for you.


Generated by Claude Code

MendixMau added a commit that referenced this pull request Oct 22, 2026
…nly the first (#553, from #527)

The awk splitter ended each section with print buf "\x01", which appends a newline, so every section after the first read an empty heading and was skipped. It now uses printf "%s\x01", buf. Fixture test-harvest-learnings.sh T5 (7 of 7 sections drafted). Field run: 54 vs 43 drafts on one app. Contributed by @saingge in #527.

Review: MERGE — real one-line awk fix; T5 10/10. Security review: safe.

Co-authored-by: saingge <262679532+saingge@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jQvaonym9V1wKKfAEPmRr
@MendixMau MendixMau closed this Oct 22, 2026
@saingge
saingge deleted the fix/harvest-multi-entry branch October 29, 2026 14:07
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.

2 participants