Skip to content

refactor: tidy up the forge adapter interface#2874

Open
afonsojramos wants to merge 8 commits intomainfrom
refactor-forge-adapter-interface
Open

refactor: tidy up the forge adapter interface#2874
afonsojramos wants to merge 8 commits intomainfrom
refactor-forge-adapter-interface

Conversation

@afonsojramos
Copy link
Copy Markdown
Member

Summary

Three follow-up cleanups on top of the forge adapter interface, each as its own commit:

  • Move GitHub-specific auth helpers (extractHostVersion, getGitHubAuthBaseUrl, getDeveloperSettingsURL, getNewTokenURL, getNewOAuthAppURL, isValidToken, isValidClientId) out of shared auth/utils.ts and into a new forges/github/auth.ts. Tests followed.
  • Drop the answeredDiscussion capability from the shared ForgeCapabilities contract. It only ever drove GitHub GraphQL query construction, so it now lives privately as supportsAnsweredDiscussion inside forges/github/capabilities.ts. isAnsweredDiscussionFeatureSupported removed from api/features.ts along with the Gitea stub.
  • Rename getDeveloperSettingsUrlgetAccountSettingsUrl on the ForgeAdapter interface (and openDeveloperSettingsopenAccountSettings on the consumer). The "developer settings" wording was GitHub-flavoured; the new name reads cleanly for any forge.

Test plan

  • pnpm exec tsc --noEmit — clean
  • pnpm exec biome check on touched files — only pre-existing warnings
  • pnpm exec vitest --run — 1040/1040 pass

Closes #2873

@github-actions github-actions Bot added the refactor Refactoring of existing feature label May 10, 2026
Comment thread src/renderer/utils/auth/flows.ts Outdated
…r-interface

# Conflicts:
#	src/renderer/routes/Accounts.tsx
#	src/renderer/utils/api/features.test.ts
#	src/renderer/utils/api/features.ts
#	src/renderer/utils/auth/utils.test.ts
#	src/renderer/utils/auth/utils.ts
#	src/renderer/utils/forges/gitea/adapter.test.ts
#	src/renderer/utils/forges/github/adapter.test.ts
#	src/renderer/utils/forges/github/client.ts
#	src/renderer/utils/system/links.test.ts
Comment thread src/renderer/context/App.tsx Outdated
import { clearState, loadState, saveState } from '../utils/core/storage';
import {
exchangeAuthCodeForAccessToken,
performGitHubWebOAuth,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not at a computer atm, but is there an alternate way for Apps to use the forge interface than GitHub forge specific imports?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah... That's fair, let me give this a try

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Take a look if it looks okay as is

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of existing feature

Development

Successfully merging this pull request may close these issues.

refactor: forge adapter tidy up

2 participants