Skip to content
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

Properly handle provider host name when using http(s) prefix when adding a new integration #7831

Merged
merged 3 commits into from
Feb 28, 2022

Conversation

Shulammite-Aso
Copy link
Contributor

@Shulammite-Aso Shulammite-Aso commented Jan 26, 2022

Description

When a user has manually included http(s) prefixes in their provider hostname, strip it off so that it uses only the gitpod provided prefix in the configured URL and Redirect URL.

Related Issue(s)

Fixes #7492

How to test

Go to dashboard and under integrations try to add new integration with a self-hosted instance of a provider, then notice that any HTTP(s) prefix is removed from the configured URL

Release Notes

Git Integrations UI – improve handling of host name.

Documentation

@gtsiolis
Copy link
Contributor

gtsiolis commented Jan 26, 2022

Thanks for contributing, @Shulammite-Aso! 🍊

/werft run

👍 started the job as gitpod-build-verify-provider-hostname-fork.0

@gtsiolis gtsiolis requested a review from a team January 26, 2022 10:19
@codecov
Copy link

codecov bot commented Jan 26, 2022

Codecov Report

Merging #7831 (ea71364) into main (63f8448) will increase coverage by 1.57%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            main    #7831      +/-   ##
=========================================
+ Coverage   8.62%   10.20%   +1.57%     
=========================================
  Files         33       18      -15     
  Lines       2341     1009    -1332     
=========================================
- Hits         202      103      -99     
+ Misses      2135      905    -1230     
+ Partials       4        1       -3     
Flag Coverage Δ
components-gitpod-cli-app 10.20% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
installer-raw-app ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
installer/pkg/components/ws-manager/configmap.go
installer/pkg/components/ws-manager/role.go
components/local-app/pkg/auth/pkce.go
installer/pkg/components/ws-manager/deployment.go
installer/pkg/common/display.go
installer/pkg/common/ca.go
installer/pkg/common/render.go
components/local-app/pkg/auth/auth.go
installer/pkg/components/ws-manager/rolebinding.go
installer/pkg/common/objects.go
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63f8448...ea71364. Read the comment docs.

@gtsiolis
Copy link
Contributor

gtsiolis commented Jan 26, 2022

@Shulammite-Aso You'll need to sign a Contributor License Agreement (CLA)[1] once before merging your first contribution. Looping in @meysholdt to reach out about the CLA. 🏓

@gtsiolis gtsiolis removed the request for review from a team January 26, 2022 10:39
@gtsiolis gtsiolis added do-not-merge/cla-pending CLA has not been signed team: webapp Issue belongs to the WebApp team labels Jan 26, 2022
@Shulammite-Aso
Copy link
Contributor Author

@meysholdt how do i sign the Contributor license agreement? I followed this link provided in the docs here to see if it provides hints on how to sign it, but it appears the link is broken.

@csweichel
Copy link
Contributor

cc @meysholdt

@meysholdt
Copy link
Member

Hi @Shulammite-Aso, I've sent the CLA via email / DocuSign.

@Shulammite-Aso
Copy link
Contributor Author

Hi @meysholdt i just signed the document.

@meysholdt
Copy link
Member

Hi @Shulammite-Aso! Awesome, thank you for signing!

@meysholdt meysholdt added cla: accepted ✔️ and removed do-not-merge/cla-pending CLA has not been signed labels Feb 2, 2022
Copy link
Contributor

@JanKoehnlein JanKoehnlein left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the change. I've proposed a few changes.

components/dashboard/src/settings/Integrations.tsx Outdated Show resolved Hide resolved
components/dashboard/src/settings/Integrations.tsx Outdated Show resolved Hide resolved
use 'startsWith' method to strip off http(s) from provider hostname
@roboquat
Copy link
Contributor

roboquat commented Feb 2, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from jankoehnlein after the PR has been reviewed.

Associated issue: #7492

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

@Shulammite-Aso thanks for the contribution!

I left some comments. The main issue remains is, that Gitpod won't accept http URLs for provider connections on the server side.

components/dashboard/src/settings/Integrations.tsx Outdated Show resolved Hide resolved
components/dashboard/src/settings/Integrations.tsx Outdated Show resolved Hide resolved
@stale
Copy link

stale bot commented Feb 18, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Feb 18, 2022
@AlexTugarev AlexTugarev removed the meta: stale This issue/PR is stale and will be closed soon label Feb 18, 2022
@Shulammite-Aso Shulammite-Aso requested a review from a team February 19, 2022 03:12
@AlexTugarev
Copy link
Member

AlexTugarev commented Feb 21, 2022

/werft run

👍 started the job as gitpod-build-verify-provider-hostname-fork.1

@AlexTugarev
Copy link
Member

AlexTugarev commented Feb 21, 2022

Let's verify with a preview environment and lend this PR

Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @Shulammite-Aso!
🎉 🎉 🎉

@Shulammite-Aso
Copy link
Contributor Author

Hi @gtsiolis this PR is approved, is it now ready to get merged?

@gtsiolis
Copy link
Contributor

gtsiolis commented Feb 28, 2022

Hey, @Shulammite-Aso! I wanted to confirm internally that the signed CLA is in place and stored for future contributions.

Let's merge this. 🚀

Thanks @AlexTugarev @JanKoehnlein @meysholdt @csweichel for helping move this forward! 🏀

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

LGTM

@gtsiolis
Copy link
Contributor

@JanKoehnlein could you approve this to unblock merging[1]?

Copy link
Contributor

@JanKoehnlein JanKoehnlein left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot for this contribution

@roboquat roboquat merged commit d4a2db8 into gitpod-io:main Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly handle provider host name when using http(s) prefix when adding a new integration
7 participants