Extract website version from a file instead of sbt stdout - #43
Conversation
sbt's stdout is not machine-readable: even with -error and --no-colors it emits terminal erase-in-display sequences (ESC[0J) from the progress display, plus the [success] line. Parsing it with `head -n 1` produced a version like "\e[0J0.2.3", which rendered as "[0J0.2.3" on the website. Add a `writeStableVersion` task that writes `stableVersion` to target/stable-version.txt and have the workflow read that file, removing the stdout parsing and the warm-up sbt invocation it required.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe build now writes the resolved stable version to ChangesStable version export
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The website deploy workflow read the version by parsing sbt's stdout:
sbt's stdout is not machine-readable. Even with
-errorand--no-colors, it emits terminal erase-in-display sequences (ESC[0J) from the progress display, plus the[success] elapsed timeline.--no-colorsonly disables color codes, not cursor/erase control codes. The result was a version string like\e[0J0.2.3, rendering on the website as[0J0.2.3.Fix
Stop parsing stdout. A new
writeStableVersiontask writes the value totarget/stable-version.txt, and the workflow reads that file. The warm-up sbt invocation (which only existed to absorb first-run noise) is gone too.Verification
Ran locally against sbt 2.0.1: the file contains exactly
0.2.3— 5 bytes, no escapes, no trailing newline (od -cconfirmed).targetis already gitignored andfetch-depth: 0is already set, so dynver can still resolvepreviousStableVersion.scalafmtSbtproduced no further changes.Same change applied to
decisions4sandworkflows4s.Summary by CodeRabbit