Skip to content

Conversation

filiptronicek
Copy link
Member

Description

Preps for NEXT-3410 by making sure all users who use the extension get their host set to https://gitpod.io, if they haven't set it to something else manually.

Related Issue(s)

Fixes NEXT-3408

How to test

  1. Make a fresh install of the extension
  2. In Chrome, go into Application -> Extension storage -> Gitpod -> Sync and see the value is set to "https://gitpod.io". If not, go to a page the extension is active on (such as this PR) and see again.

The rollout plan here is to let the extension explicitly set the hostname for a couple of weeks and then roll out a new version where the default is app.gitpod.io.

Copy link
Contributor

@Copilot 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 sets an explicit default Gitpod host for users who have not configured their endpoint manually. It updates the storage logic in both the dashboard content script and the button component to ensure the default endpoint ("https://gitpod.io") is applied appropriately.

  • Simplifies the conditional check for updating the endpoint in the dashboard script.
  • Removes the default parameter from the useStorage hook in the button component and adds an effect to initialize the default if unset.

Reviewed Changes

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

File Description
src/contents/gitpod-dashboard.ts Updates the logic for conditionally updating the stored endpoint.
src/button/button.tsx Removes the default from useStorage and adds a useEffect to set the default endpoint.
Comments suppressed due to low confidence (2)

src/button/button.tsx:53

  • [nitpick] Default address initialization logic appears in multiple locations; consider consolidating this logic into a shared module to prevent potential inconsistencies.
const actions = useMemo(() => {

src/contents/gitpod-dashboard.ts:26

  • Verify that removing the explicit check against DEFAULT_GITPOD_ENDPOINT does not unintentionally override a user-set default when running on gitpod.io. Consider ensuring that the logic maintains the intended behavior in all hosting environments.
if (!currentlyStoredEndpoint || new URL(currentlyStoredEndpoint).host !== currentHost) {

Copy link

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

@filiptronicek should we bump the version in package.json?

Copy link

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

Works as advertised. 😄

✅ to unblock

I'm not sure how we generally ship, but it seems like we should bump the version before we do (ref: #192 (review))

Copy link
Member Author

filiptronicek commented Apr 16, 2025

I usually make version upgrades with yarn version --patch and push to main, because it also takes care of creating the tag. See the relevant section in the README:

1. Bump up the version value inside `package.json` (`yarn version --patch` or `yarn version --minor`)
1. Push your changes to `main`

@filiptronicek filiptronicek merged commit 576981a into main Apr 16, 2025
1 of 2 checks passed
@filiptronicek filiptronicek deleted the ft/explicit-default-gitpod-host branch April 16, 2025 19:24
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