Skip to content

docs: make release changelog commands portable to macOS - #853

Merged
samperman merged 2 commits into
mainfrom
portable-release-commands
Sep 10, 2026
Merged

docs: make release changelog commands portable to macOS#853
samperman merged 2 commits into
mainfrom
portable-release-commands

Conversation

@samperman

Copy link
Copy Markdown
Collaborator

Intent

The release and re-arm steps in CONTRIBUTING.md use sed -i in forms that only work with GNU sed. On macOS, the release step fails because BSD sed requires a suffix argument after -i, and the re-arm step has no BSD equivalent at all: it relies on the GNU-only 0,/re/ address range and on \n in the replacement text. Anyone releasing from a Mac has to translate the commands by hand.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

Replace both sed -i calls with perl, which is preinstalled on macOS and on mainstream Linux distributions and behaves the same on both:

  • Release step: perl -pi -e "s/^## Unreleased/## [$VERSION] - $(date +%Y-%m-%d)/" docs/CHANGELOG.md
  • Re-arm step: perl -0777 -pi -e 's/^## \[/## Unreleased\n\n$&/m' docs/CHANGELOG.md

The re-arm command slurps the file so ^ with the /m flag matches the start of each line, and without /g only the first ## [ heading gets the new ## Unreleased section inserted above it.

A one-line comment above the first command explains why it is perl rather than sed, so the change is not reverted later.

Alternatives considered: sed -i.bak is portable for the release step but not the re-arm step; awk needs a temp file and a move; a just recipe backed by Python would be cleanest but is more than this doc fix needs.

Automated Tests

None. This changes documentation only. Both commands were run by hand on macOS against a copy of docs/CHANGELOG.md and produced the expected result.

Directions for Reviewers

On a Mac or Linux machine, copy docs/CHANGELOG.md somewhere scratch and run the two commands from the diff against it, with VERSION set to any value. The release command should rename ## Unreleased to a dated heading. The re-arm command should insert a blank-line-separated ## Unreleased section above the topmost release heading, once.

Checklist

  • I have updated CHANGELOG.md to cover notable changes. (Not needed: contributor docs only, no user-facing change.)
  • I have updated all related GitHub issues to reflect their current state. (None.)
  • I have run the rsconnect-python-tests-at-night workflow in Connect against this feature branch. (Not needed: no code change.)

The two sed -i calls in the release and re-arm steps only work with GNU
sed. BSD sed on macOS requires a suffix argument after -i, and the
re-arm command also uses the GNU-only 0,/re/ address and \n in the
replacement. Replace both with perl, which is preinstalled on macOS and
Linux and behaves the same on both.
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-10 18:43 UTC

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8956 7708 86% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: b4b4aa0 by action🐍

@samperman

Copy link
Copy Markdown
Collaborator Author

i debated between this and a justfile target to do it.. this was a smaller change but happy to consider alternatives if you have a preference

@edavidaja

Copy link
Copy Markdown
Collaborator

I think a just target would be nice if you feel like it but if not, thank you!

@samperman

Copy link
Copy Markdown
Collaborator Author

I'll merge as is for now... if i need to come back to any of this, i can explore the just target.

@samperman
samperman merged commit daad51e into main Sep 10, 2026
26 checks passed
@samperman
samperman deleted the portable-release-commands branch September 10, 2026 18:42
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