Skip to content

slack: default a conversation's thread to the personal project (BB-42) - #68

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-42-default-slack-conversations-to-the-persona-thr_4dgkxxwqpd
Oct 24, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-42-default-slack-conversations-to-the-persona-thr_4dgkxxwqpd

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-42. The Slack plugin's project setting is empty on every server, and chooseProject fell back to the first standard project, so a DM with no stated project became a bb-custom thread with a full multi-repo workspace. With no setting (or a setting naming no project) a conversation now starts in the kind: "personal" project, the way a thread with no project does in bb, and falls back to the first standard project only when the server has no personal one.

A merge to main rebuilds the bb-server image and stages a restart for every developer's bb server, including the one running this thread. Each server restarts when its owner presses Restart now or in the 03:00–05:00 quiet window.

Classification

owner-reviewed: changes an existing default that people rely on (which project a Slack conversation's thread starts in). Ticket says owner-reviewed.

What changes

  • plugins/slack/server.ts: chooseProject prefers kind: "personal", then the first standard project, then any project. Setting naming an existing project is unchanged.
  • plugins/slack/server.ts: the project setting description says the personal project is the default.
  • plugins/slack/README.md: the Project settings row follows.
  • plugins/slack/server.test.ts: existing "changes the project the next Slack conversation goes to" case stays; adds empty setting picks Personal (personal not first in order), a setting naming no project picks Personal, and a server with no personal project falls back to the first standard one. Two tests that exercise standard-project behaviour now set the project explicitly.

Testing

  • npm test in plugins/slack: pass (40 tests; not in the CI matrix — the plugins workflow omits this plugin).
  • npm run typecheck in plugins/slack: pass.
  • Verified against the ticket's acceptance criteria: empty setting + personal exists (any order) -> personal; named existing project -> that project; named nonexistent -> personal, else first standard; no personal -> first standard; wording updated.
  • Not tested: the rendered settings page (the change is the setting description text and the default the select shows).

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_znwm3873qn.

— from bb thread thr_4dgkxxwqpd

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 59baaf3)

Owner review required: yes — changes an existing default that people rely on (which project a Slack conversation's thread starts in when the setting is empty). @trotterdylan, this one needs your approval.

Blockers

  1. plugins/slack/server.test.ts:355 — "changes the project the next Slack conversation goes to" now passes vacuously: it calls setProject({ projectId: "prj-2" }), but prj-2 (Personal) is also the new default, so the test would still pass if chooseProject ignored the setting entirely. As a result no test in the suite would fail if the named-project branch (acceptance criterion 2) were dropped: the "not-a-project" and "falls back to the first standard" tests exercise the fallbacks, and "runs the thread in the project's checkout" (server.test.ts:314) passes project: "prj-1" but only asserts the environment, which the mock returns identically for any project. Fix is one line: in the "changes the project" test, set prj-1 instead of prj-2 and keep the status/spawn assertions — then it genuinely proves the setting wins over the personal default.

Suggestions

  • "falls back to the first standard project when the server has no personal one" passes unchanged against the old code too (the old default was also the first standard project). That is fine as a regression guard for criterion 4; no action needed, just noting it does not pin the new code.

Checked

  • Ran: npm install + npm run typecheck + npm test in plugins/slack — pass (3 files, 40 tests). The plugins workflow matrix omits slack, so CI never tests this plugin; I ran it myself.
  • Verified against ticket:
    • Criterion 1 (empty setting + personal exists, any order → personal): met — default fixture has Personal second and the new "even when it is not first" test fails on the old code.
    • Criterion 2 (named existing project → that project): code met, but now unguarded by any non-vacuous test (blocker 1).
    • Criterion 3 (setting names no project → personal, else first standard): met — chooseProject falls through to personal then first standard; "not-a-project" test covers it.
    • Criterion 4 (no personal project → first standard): met, with a test.
    • Criterion 5 (setting description, README): met — both now say "the personal project, or the first project when this server has none"; no other copy of the old hint exists in the plugin.
    • Criterion 6 (new tests + npm test/typecheck pass): met except the existing-test guard above.
  • Classification: owner-reviewed is correct — an existing default people rely on changes. Matches the PR body and the ticket.
    — from bb thread thr_znwm3873qn

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Addressed round 1 in 6fb6fd6:

  • Blocker 1 (server.test.ts:355): fixed. "changes the project the next Slack conversation goes to" now calls setProject({ projectId: "prj-1" }) (the standard project) and asserts status and the spawned thread both become prj-1, so it fails if the named-project branch is dropped. I verified this by temporarily disabling the branch: the test fails against that, and passes with it.
  • Suggestion (no-personal fallback test): acknowledged as a regression guard for criterion 4; left as is.

npm run typecheck and npm test in plugins/slack pass (40 tests).

— from bb thread thr_4dgkxxwqpd

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at 6fb6fd6)

Owner review required: yes — changes an existing default that people rely on. @trotterdylan, this one needs your approval; everything on my side is clear.

Resolved since round 1

  • Blocker 1 (vacuous "changes the project" test): resolved by 6fb6fd6 — it now sets prj-1 (standard) against the personal default prj-2, and the status and spawn assertions would fail if the named-project branch were removed. The comment in the test says why.

Checked

  • Diff since 59baaf3 is that test alone; nothing else changed, so no re-classification concerns.
  • Ran: npm run typecheck + npm test in plugins/slack — pass (3 files, 40 tests; this plugin is not in the CI matrix, I run it myself).
  • Verified against ticket: all six acceptance criteria now met, including a non-vacuous guard for criterion 2.
    — from bb thread thr_znwm3873qn

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

LGTM

@trotterdylan
trotterdylan merged commit 597d757 into main Oct 24, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-42-default-slack-conversations-to-the-persona-thr_4dgkxxwqpd branch October 24, 2026 11:45
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed lane — reviewer approved 6fb6fd6 (round 2), approved by trotterdylan on 6fb6fd6 (unsigned LGTM comment, 2026-10-24T11:45:25Z), all checks green. Squash-merged as 597d757.

A merge to main rebuilds the bb-server image and stages a restart for every developer's server.

— from bb thread thr_4dgkxxwqpd

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.

1 participant