Skip to content

Conversation

@akshay-gupta7
Copy link
Contributor

@akshay-gupta7 akshay-gupta7 commented Oct 16, 2025

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

  • Verified against both public GitHub and GitHub Enterprise instances.
  • Ensured that API requests route through the correct endpoints.

Additional Notes (if any)

@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2025

🦋 Changeset detected

Latest commit: a5773f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

Commit SHA:20f7dbeff6807ee3a32f58fe04806b7de56dc05b
No changes to code coverage between the base branch and the head branch

Copy link

Copilot AI left a 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/v3 suffix normalization for GitHub Enterprise URLs in the Octokit client configuration
  • Updated Cypress test mocks to use the correct /api/v3 path 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

@akshay-gupta7 akshay-gupta7 requested a review from Copilot October 20, 2025 10:10
@akshay-gupta7 akshay-gupta7 self-assigned this Oct 20, 2025
Copy link

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

@akshay-gupta7 akshay-gupta7 marked this pull request as ready for review October 20, 2025 10:13
@akshay-gupta7 akshay-gupta7 requested a review from six7 October 20, 2025 12:42
@akshay-gupta7 akshay-gupta7 merged commit 3a10961 into main Nov 3, 2025
10 of 12 checks passed
@akshay-gupta7 akshay-gupta7 deleted the fix-github-enterprise-calls branch November 3, 2025 07:51
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.

Unable to setup GitHub Enterprise sync

3 participants