-
-
Notifications
You must be signed in to change notification settings - Fork 210
fix enterprise github base api url #3652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: a5773f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
|
Commit SHA:20f7dbeff6807ee3a32f58fe04806b7de56dc05b |
There was a problem hiding this comment.
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 the base API URL configuration for GitHub Enterprise instances. Previously, the plugin used the default GitHub API URL regardless of the provided base URL, breaking compatibility with GitHub Enterprise servers that require custom API endpoints.
Key Changes:
- Added automatic
/api/v3suffix normalization for GitHub Enterprise URLs in the Octokit client configuration - Updated Cypress test mocks to use the correct
/api/v3path for all GitHub API endpoints - Enhanced test coverage with comprehensive URL normalization scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/tokens-studio-for-figma/src/storage/GithubTokenStorage.ts |
Implements normalizeGitHubEnterpriseBaseUrl() method to automatically append /api/v3 to GitHub Enterprise URLs when configuring Octokit client |
packages/tokens-studio-for-figma/src/storage/__tests__/GithubTokenStorage.test.ts |
Adds comprehensive test suite covering URL normalization edge cases including trailing slashes, existing /api/v3 paths, whitespace, and default GitHub.com behavior |
packages/tokens-studio-for-figma/cypress/support/mockEnv.js |
Updates all intercepted GitHub API endpoint URLs to include /api/v3 path, ensuring Cypress tests align with the corrected API structure |
packages/tokens-studio-for-figma/cypress/e2e/branches.cy.js |
Adjusts branch switching test to remove error dialog handling and add timeout for improved stability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Why does this PR exist?
Closes #3650
What does this pull request do?
This pull request fixes the base API URL configuration for GitHub Enterprise. Previously, the plugin was using the default GitHub API URL, which caused issues when connecting to GitHub Enterprise instances that require a custom API base URL. With this update, the plugin correctly utilizes the enterprise-specific API endpoint, ensuring compatibility and proper communication with GitHub Enterprise servers.
Testing this change
Additional Notes (if any)