Skip to content

fix: Resolve TypeScript compilation errors in GitHub integration - #96

Merged
anoncam merged 1 commit into
mainfrom
fix/github-integration-typescript-errors
Oct 22, 2025
Merged

anoncam merged 1 commit into
mainfrom
fix/github-integration-typescript-errors

Conversation

@anoncam

@anoncam anoncam commented Oct 22, 2025

Copy link
Copy Markdown
Owner

Summary

Fixes the TypeScript compilation errors that were causing the release build to fail after merging PR #95 (GitHub GPG key integration). This enables the release workflow to complete successfully.

Issues Fixed

This PR resolves all TypeScript errors from the failed release build:

  1. ✅ Property 'github' does not exist on type 'KeysOptions' (cli/index.ts:885-903)
  2. ✅ Property 'githubName' does not exist on type 'KeysOptions' (cli/index.ts:897)
  3. ✅ Property 'fingerprint' does not exist on type 'PgpKeyInfo' (cli/githubUtils.ts:177, 185)
  4. ✅ Type 'string | null' is not assignable to type 'string | undefined' (cli/githubUtils.ts:186)
  5. ✅ Argument of type 'PgpKeyInfo' is not assignable to parameter of type 'GitHubKeyAddInfo' (cli/githubUtils.ts:173)
  6. ✅ Type '"github"' is not comparable to ImportOptions source types (cli/unifiedKeyManager.ts:664)

Changes Made

1. cli/index.ts

  • Added github?: string and githubName?: string properties to KeysOptions interface

2. cli/githubUtils.ts

  • Fixed type mismatch by creating proper mapping from PgpKeyInfo to GitHubKeyAddInfo
  • Map keyId → fingerprint (importPgpKey returns keyId, not fingerprint)
  • Convert email: string | null → email?: string using nullish coalescing operator

3. cli/unifiedKeyManager.ts

  • Added 'github' to the ImportOptions.source union type

4. package-lock.json

  • Updated from running npm install during verification

Test Plan

  • Run npm install to ensure dependencies are installed
  • Run npm run build to verify TypeScript compilation succeeds
  • Verify no TypeScript errors are reported

Related

🤖 Generated with Claude Code

This commit fixes the TypeScript errors that were causing the release
build to fail after merging PR #95 (GitHub GPG key integration).

Changes:
- Add missing 'github' and 'githubName' properties to KeysOptions interface
- Fix type mismatch in githubUtils.ts by mapping PgpKeyInfo to GitHubKeyAddInfo
  - Map keyId to fingerprint (importPgpKey returns keyId, not fingerprint)
  - Convert email from 'string | null' to 'string | undefined' using nullish coalescing
- Add 'github' to ImportOptions source type in unifiedKeyManager.ts

Fixes build errors:
- Property 'github' does not exist on type 'KeysOptions' (cli/index.ts:885-903)
- Property 'githubName' does not exist on type 'KeysOptions' (cli/index.ts:897)
- Property 'fingerprint' does not exist on type 'PgpKeyInfo' (cli/githubUtils.ts:177, 185)
- Type 'string | null' is not assignable to type 'string | undefined' (cli/githubUtils.ts:186)
- Argument of type 'PgpKeyInfo' is not assignable to parameter of type 'GitHubKeyAddInfo' (cli/githubUtils.ts:173)
- Type '"github"' is not comparable to ImportOptions source types (cli/unifiedKeyManager.ts:664)

Related to: #94

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@anoncam

anoncam commented Oct 22, 2025

Copy link
Copy Markdown
Owner Author

#94 fixes

@anoncam
anoncam requested a review from Copilot October 22, 2025 17:42

Copilot AI 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.

Pull Request Overview

This PR fixes TypeScript compilation errors introduced in PR #95 that were preventing the release build from completing. The changes add missing type definitions and resolve type mismatches in the GitHub GPG key integration feature.

Key Changes:

  • Extended type definitions to include GitHub-specific options
  • Fixed type mismatches in the GitHub key import flow
  • Corrected property mappings between PGP and GitHub key formats

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
cli/index.ts Added github and githubName properties to KeysOptions interface
cli/githubUtils.ts Fixed type mismatch by mapping PgpKeyInfo to GitHubKeyAddInfo format
cli/unifiedKeyManager.ts Added 'github' as valid source type in ImportOptions

Comment thread cli/githubUtils.ts
Comment on lines +174 to +177
const githubKeyInfo = {
fingerprint: keyInfo.keyId,
email: keyInfo.email ?? undefined
};

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

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

The comment states 'importPgpKey returns keyId, not fingerprint' but the mapping uses keyId as fingerprint for GitHub keys. This needs clarification—either the comment should explain why keyId is semantically equivalent to fingerprint for GitHub keys, or document if this is a workaround for a limitation in the PGP import.

Copilot uses AI. Check for mistakes.
@anoncam
anoncam merged commit 106ae9b into main Oct 22, 2025
3 checks passed
github-actions Bot added a commit that referenced this pull request Oct 22, 2025
Version bump type: patch
PR: #96
Title: fix: Resolve TypeScript compilation errors in GitHub integration
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