Skip to content

chore(release): 2.8.1#2097

Merged
chernistry merged 1 commit into
mainfrom
fix/s3358-release-2.8.1
Jun 25, 2026
Merged

chore(release): 2.8.1#2097
chernistry merged 1 commit into
mainfrom
fix/s3358-release-2.8.1

Conversation

@chernistry

@chernistry chernistry commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Re-cuts the release as 2.8.1 after fixing an S3358 nested-ternary regression that the gated-file check flagged in the new worktrees unlock command, which kept the 2.8.0 commit red.

  • Fix: worktrees_cmd.py liveness label uses a mapping instead of a nested ternary (it is in the S3358 regression target list).
  • Bumps pyproject.toml (and uv.lock) 2.8.0 -> 2.8.1; renames the notes to docs/release-notes/v2.8.1.md.

2.8.0 was never tagged, so the published release is 2.8.1 with the same content (Codex OAuth fix #2086, worktree GC reliability #2093, worktrees unlock #2094, security cleanup #2087). On merge, a green main run triggers auto-release to tag v2.8.1.

Summary by Sourcery

Bump the project to release version 2.8.1 and address a liveness labeling regression in the new worktrees unlock command.

Enhancements:

  • Adjust the worktrees unlock liveness label to use a mapping for clearer handling of alive, not running, and unknown states.

Build:

  • Update pyproject version metadata and lockfile to 2.8.1 for the new release.

Documentation:

  • Update and rename the release notes file to reflect version v2.8.1.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the wording used in worktree unlock status messages, keeping the same states but making the output more consistent.
  • Chores
    • Bumped the app version to 2.8.1.
    • Updated the release notes version heading to match the new release.

Fixes the S3358 nested-ternary regression in the new `worktrees unlock`
command (worktrees_cmd.py), which is a gated file and kept the release
commit red, and re-cuts the release as 2.8.1. Content is otherwise the
intended 2.8.0 (Codex OAuth fix, worktree GC reliability, the unlock
command, and the security cleanup); 2.8.0 was never tagged.
@sourcery-ai

sourcery-ai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Retags the unreleased 2.8.0 work as 2.8.1, fixes a Sonar S3358 nested-ternary issue in the new worktrees unlock command, and bumps project metadata and release notes to the 2.8.1 version.

File-Level Changes

Change Details Files
Update release notes to reflect version 2.8.1 instead of 2.8.0.
  • Change the release notes document heading from v2.8.0 to v2.8.1 to match the new release tag
  • Ensure the release notes content continues to describe the same set of changes shipped in the 2.8.x line
docs/release-notes/v2.8.1.md
Bump project version metadata from 2.8.0 to 2.8.1 for the new release.
  • Update the project version string to 2.8.1 in the configuration used by packaging/build tooling
  • Keep all other project metadata (name, description, Python requirement) unchanged
pyproject.toml
uv.lock
Refactor the liveness label logic in the worktrees unlock command to avoid a nested ternary and satisfy static analysis rule S3358.
  • Replace a nested conditional expression that derived the liveness status string with a dictionary-based mapping keyed by the liveness flag value
  • Preserve the previous behavior of mapping True/False/None to the same user-facing liveness messages while making the gating/static-analysis rule pass
src/bernstein/cli/commands/worktrees_cmd.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown
Contributor

Sonar insights (advisory, no merge-block)

Snapshot of bernstein on the configured Sonar instance:

Metric Value
Coverage 80.1
Code smells 0
Bugs 0
Vulnerabilities 0
Security hotspots 0

Run bernstein doctor sonar locally for the full surface.

This comment is a soft signal. The Sonar scan runs on push to main; the PR check itself never fails on smells.

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file core cli docs labels Jun 25, 2026
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d85affad-0847-4739-a23d-444aaa8da53b

📥 Commits

Reviewing files that changed from the base of the PR and between 7794192 and 685263e.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (3)
  • docs/release-notes/v2.8.1.md
  • pyproject.toml
  • src/bernstein/cli/commands/worktrees_cmd.py

📝 Walkthrough

Walkthrough

The release notes and package version were bumped to 2.8.1, and worktrees unlock now derives its liveness message from an explicit True/False/None mapping.

Changes

Release metadata

Layer / File(s) Summary
Version bump
docs/release-notes/v2.8.1.md, pyproject.toml
The release notes heading and [project].version were updated from 2.8.0 to 2.8.1.

Worktrees unlock output

Layer / File(s) Summary
Liveness mapping
src/bernstein/cli/commands/worktrees_cmd.py
unlock_cmd now selects the liveness string with an explicit mapping for True, False, and None.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

size/s

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description does not follow the required What/Why/How/Checklist template and omits the checklist items. Rewrite it using the repository template headings, add the checklist, and include the linked issue or release rationale.
Linked Issues check ⚠️ Warning The reviewable changes only bump release metadata and tweak worktrees unlock; they do not implement the Codex/OAuth/demo fixes in #2086. Add the codex adapter, OAuth warning, demo summary, and test changes required by #2086, or remove that issue if it is unrelated.
Out of Scope Changes check ⚠️ Warning The PR includes a release version bump and a worktrees unlock liveness tweak, both unrelated to the linked Codex/demo requirements. Remove unrelated release/worktrees changes or update the linked issues to match the actual scope of this PR.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the release re-cut to v2.8.1.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/s3358-release-2.8.1

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review-bot acknowledgement summary

  • Must-address findings: 0 (0 acknowledged, 0 open)
  • Informational findings: 1

All must-address findings are resolved or acknowledged.

@github-actions

Copy link
Copy Markdown
Contributor

bernstein doctor observe for PR #2097 (fix/s3358-release-2.8.1): ok=1, warn=1, fail=0, error=0, skipped=2

sonar -- OK (project bernstein)

metric value delta threshold status
coverage_pct 80.1% new 80.0% ok
code_smells 0 new 50 ok
bugs 0 new 0 ok
vulnerabilities 0 new 0 ok
security_hotspots 0 new 0 ok

code-scanning -- WARN (2 open alert(s))

metric value delta threshold status
open_alerts 2 new 0 warn
critical_alerts 0 new 0 ok
high_alerts 1 new 0 warn
medium_alerts 0 new - ok
low_alerts 0 new - ok
Skipped backends (credentials not configured)
  • glitchtip: BERNSTEIN_GLITCHTIP_TOKEN not set
  • dt: DTRACK_URL/TOKEN/PROJECT not set

See docs/observability/unified-doctor.md for backend setup notes.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The new liveness mapping assumes alive is always one of True, False, or None; consider using dict.get(alive, "liveness unknown") or a safer default to avoid a potential KeyError if other values ever appear.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new liveness mapping assumes `alive` is always one of `True`, `False`, or `None`; consider using `dict.get(alive, "liveness unknown")` or a safer default to avoid a potential `KeyError` if other values ever appear.

## Individual Comments

### Comment 1
<location path="src/bernstein/cli/commands/worktrees_cmd.py" line_range="696" />
<code_context>
     age_str = f"{int(age)}s" if isinstance(age, (int, float)) else "unknown age"
     owner = f"pid {pid}" if pid else "an unknown process"
-    liveness = "alive" if alive else ("not running" if alive is False else "liveness unknown")
+    liveness = {True: "alive", False: "not running", None: "liveness unknown"}[alive]

     if as_json:
</code_context>
<issue_to_address>
**issue (bug_risk):** Dict indexing here can raise a KeyError if `alive` is any non-boolean/non-None value.

The original ternary safely handled any non-boolean `alive` values via its final `else` branch. With dict indexing, values like `0`, `1`, or other truthy/falsy but non-`True`/`False`/`None` inputs will now raise `KeyError`. To keep the previous robustness, either use `.get(alive, "liveness unknown")` or normalize `alive` to `True`/`False`/`None` before indexing.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

age_str = f"{int(age)}s" if isinstance(age, (int, float)) else "unknown age"
owner = f"pid {pid}" if pid else "an unknown process"
liveness = "alive" if alive else ("not running" if alive is False else "liveness unknown")
liveness = {True: "alive", False: "not running", None: "liveness unknown"}[alive]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Dict indexing here can raise a KeyError if alive is any non-boolean/non-None value.

The original ternary safely handled any non-boolean alive values via its final else branch. With dict indexing, values like 0, 1, or other truthy/falsy but non-True/False/None inputs will now raise KeyError. To keep the previous robustness, either use .get(alive, "liveness unknown") or normalize alive to True/False/None before indexing.

@chernistry chernistry merged commit d1afe00 into main Jun 25, 2026
78 of 81 checks passed
@chernistry chernistry deleted the fix/s3358-release-2.8.1 branch June 25, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli core dependencies Pull requests that update a dependency file docs size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant