Skip to content

refactor: use the existing shared helpers - #769

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-11777-reuse-shared-helpers
Oct 29, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-11777-reuse-shared-helpers

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Replaces copies of helpers that already exist with the shared version, with no change in behaviour, across four commits. The shared helpers errorText, isRecord, optionalString, decodedSegment and counted now live in @corbits/common; githubAppLogin and mirrorCallId are reused where they were copied; the extension has one settle.

  • errorText replaces the inline instanceof Error ternary everywhere it was written out, including the eval fixtures, the model test and the check pack. repo-read-tool and tests/model now depend on @corbits/common (workspace:*).
  • counted moved from the portal into @corbits/common and replaces every other pluraliser (portal pages, the triage comment, the review-clean findings text). apps/web/src/lib/plural.ts is gone. The portal's triage-view.ts counted formats numbers differently and stays.
  • The tenant PATCH route and the workflow-release triggers use decodedSegment; two hub tests build the mirror id with mirrorCallId.

Verified with bun run check, bun run lint (only existing warnings), bun run test:unit and the manager-routes and server Postgres tests, run three times.

Closes CL-11777

@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

CL-11777

@TheGreatAxios
TheGreatAxios force-pushed the cl-11777-reuse-shared-helpers branch from 2b3cef9 to 73cca96 Compare October 29, 2026 16:45
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 29, 2026 16:45
@corbits-triage

corbits-triage Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Notes:

  • pull request is over the files limit: 38 files (max 30)
  • changes sensitive paths: locks: bun.lock
  • Risk: medium (locks paths, 38 files, 18 recently fixed files)

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Replaces duplicated helpers across the monorepo with shared versions from @corbits/common (errorText, isRecord, optionalString, decodedSegment, counted), reuses githubAppLogin and mirrorCallId where they were copied, and consolidates the extension's settle into one module. The change is intended to be behaviour-preserving, and the description reports passing checks, lint, and tests.

@TheGreatAxios
TheGreatAxios merged commit d23e6b4 into main Oct 29, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant