Skip to content

chore(extensions): centralize Octokit initialization guard#33

Closed
simonrey1 wants to merge 1 commit into
pr/17927-basefrom
chore/octokit-get-or-throw
Closed

chore(extensions): centralize Octokit initialization guard#33
simonrey1 wants to merge 1 commit into
pr/17927-basefrom
chore/octokit-get-or-throw

Conversation

@simonrey1

Copy link
Copy Markdown
Owner

Summary

  • Add getOctokitOrThrow() helper in compose, kind, and kubectl GitHub release classes.
  • Replace repeated await ensureOctokit(); if (!this.octokit) throw ... blocks with a single guarded accessor.
  • Keep behavior unchanged while reducing boilerplate and avoiding non-null assertions.

Test plan

  • npx vitest run extensions/compose/src/compose-github-releases.spec.ts extensions/kind/src/kind-installer.spec.ts extensions/kubectl-cli/src/kubectl-github-releases.spec.ts
  • NODE_OPTIONS=--max-old-space-size=8192 npx eslint extensions/compose/src/compose-github-releases.ts extensions/kind/src/kind-installer.ts extensions/kubectl-cli/src/kubectl-github-releases.ts

Made with Cursor

Replace repeated ensureOctokit/null checks with getOctokitOrThrow() in
compose, kind, and kubectl release clients.

Signed-off-by: Simon Rey <51708585+simonrey1@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@simonrey1

Copy link
Copy Markdown
Owner Author

Closing this draft experiment PR.

@simonrey1 simonrey1 closed this Jun 22, 2026
@simonrey1 simonrey1 deleted the chore/octokit-get-or-throw branch June 22, 2026 08:17
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