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

Laushinka/login 6826 #7046

Merged
merged 3 commits into from
Dec 7, 2021
Merged

Laushinka/login 6826 #7046

merged 3 commits into from
Dec 7, 2021

Conversation

laushinka
Copy link
Contributor

@laushinka laushinka commented Dec 2, 2021

Description

Unlogged visitors using a prefix are shown:

  1. No welcome section
  2. More relevant text
  3. A button to continue only with the corresponding Git provider

Screenshot 2021-12-06 at 11 37 35

Screenshot 2021-12-07 at 09 24 29

Related Issue(s)

Fixes #6826
Depends on #7081

How to test

  1. Append a repo URL to https://laushinka-login-6826.staging.gitpod-dev.com/#
  2. See the changed page

Release Notes

Unlogged visitors using a prefix will be shown a more direct login page.

Documentation

Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

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

Many thanks for improving the login screen UX!

Unfortunately, there still seems to be some uncertainty around what exactly the page should look like in #6826, but I guess this PR can be adjusted when the final design is agreed upon.

(I have a slight suspicion that we might move to something like #6826 (comment) but with a dropdown element to the Continue with GitHub button as shown in PROPOSAL in #6826 (comment) -- but let's see).

I gave this a try, and it seems to work as intended in various scenarios. 👍

Except, however, that it always shows the welcome screen for me (while the PR description says "1. No welcome section"). Maybe that's unintended?

No repo With GitHub repo With GitLab repo
Screenshot 2021-12-03 at 09 35 19 Screenshot 2021-12-03 at 09 35 43 Screenshot 2021-12-03 at 09 36 08

Also left some minor thoughts in the code, but please let me know if you'd like a more thorough code review at this point -- happy to do that! 😊

components/dashboard/src/Login.tsx Outdated Show resolved Hide resolved
components/dashboard/src/App.test.ts Outdated Show resolved Hide resolved
@laushinka
Copy link
Contributor Author

laushinka commented Dec 3, 2021

Except, however, that it always shows the welcome screen for me (while the PR description says "1. No welcome section"). Maybe that's unintended?

@jankeromnes Oh this shouldn't have happened. I will check, thanks!

please let me know if you'd like a more thorough code review at this point

I'm always happy with that! We can also do it synchronously if that works for you? 🤗

@jankeromnes
Copy link
Contributor

jankeromnes commented Dec 3, 2021

please let me know if you'd like a more thorough code review at this point

I'm always happy with that! We can also do it synchronously if that works for you? 🤗

Sure! More than happy to sync on this -- how about this afternoon, e.g. 14:00 or 15:00? (Or please feel free to pick any time you like here 😁)

I often feel like we should do more pair programming at Gitpod, but somehow there is always a bit of friction to set it up, so I end up never doing it. 🙈 Thanks for providing this opportunity! 🙏

@laushinka
Copy link
Contributor Author

laushinka commented Dec 3, 2021

I often feel like we should do more pair programming at Gitpod, but somehow there is always a bit of friction to set it up, so I end up never doing it. 🙈 Thanks for providing this opportunity! 🙏

💯💯💯💯💯💯

@roboquat
Copy link
Contributor

roboquat commented Dec 3, 2021

@Foge9627: changing LGTM is restricted to collaborators

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@laushinka laushinka force-pushed the laushinka/login-6826 branch 2 times, most recently from 013a256 to e0ad6a6 Compare December 3, 2021 11:56
@laushinka
Copy link
Contributor Author

laushinka commented Dec 3, 2021

Except, however, that it always shows the welcome screen for me (while the PR description says "1. No welcome section"). Maybe that's unintended?

@jankeromnes Push fixed! Fish puxed! (I think my brain is ready for the weekend) Pushed fix! We can still go through the code later in the call :)

@laushinka
Copy link
Contributor Author

laushinka commented Dec 3, 2021

/werft run

👍 started the job as gitpod-build-laushinka-login-6826.18

@laushinka
Copy link
Contributor Author

laushinka commented Dec 3, 2021

/werft run

👍 started the job as gitpod-build-laushinka-login-6826.19

@laushinka
Copy link
Contributor Author

laushinka commented Dec 3, 2021

Build finally green again after werft issue fixed. Ready for another code review if you'd like @jankeromnes. (I don't mean this weekend of course 🙈)

@jldec
Copy link
Contributor

jldec commented Dec 5, 2021

/werft run

👍 started the job as gitpod-build-laushinka-login-6826.20

@jldec
Copy link
Contributor

jldec commented Dec 6, 2021

Thanks @laushinka - nice and clean :)

I'm missing the Gitpod name on the page somewhere.

The "Log in / Sign up" should not be bigger than the line below it, which carries an equally important messge.
Screenshot 2021-12-06 at 00 24 35

I got into trouble trying to login with GitLab (ended up on another login page with 3 buttons) - I would suggest giving the GitLab flow a little more testing.

@svenefftinge
Copy link
Member

Looks like the version from the first comment was implemented and not the one that I understood was agreed on. Is that intentional?

@jankeromnes
Copy link
Contributor

jankeromnes commented Dec 6, 2021

Build finally green again after werft issue fixed.

Hooray! 🙌

Ready for another code review if you'd like @jankeromnes. (I don't mean this weekend of course 🙈)

Thanks Laurie! 🙏😊 Sure, I'm happy to do another code review (could you please re-request review in the top right of this PR? This helps me differentiate PRs between "work in progress" and "blocked until reviewed" 😇). However, I also agree with Sven: Could you first please adjust the design to this version? I agree the issue isn't very clear (so many design variations 🙈) but I think that one is the current best compromise.

@laushinka
Copy link
Contributor Author

Looks like the version from the first comment was implemented and not the one that I understood was agreed on. Is that intentional?

@svenefftinge I can do this version - it did get confusing inside the issue, but I will take the comments in this PR as final, and specify that in the issue as well. cc @jldec to make sure we're aligned.

@laushinka
Copy link
Contributor Author

Will plug in the experiments code once this is merged.

@laushinka
Copy link
Contributor Author

laushinka commented Dec 7, 2021

@geropl Please review the experiments code 🙏🏽

@jankeromnes
Copy link
Contributor

jankeromnes commented Dec 7, 2021

Thanks again @laushinka! Taking another look now/soon 😇

(EDIT: Will check the theme fixes when the build is done 😋)

@@ -28,6 +28,7 @@ const Experiments = {
* Experiment "example" will be activate on login for 10% of all clients.
*/
// "example": 0.1,
"login-from-context-6826": 0.5,
Copy link
Member

Choose a reason for hiding this comment

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

Some documentation incl. a link to this PR would be nice!

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, side question: Can you manually "force" A or B to test code-dev deployments?

Copy link
Member

@geropl geropl Dec 7, 2021

Choose a reason for hiding this comment

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

Can you manually "force" A or B to test code-dev deployments?

Sure, you have to manipulate localStorage in your web dev tools. They are configured to be stable atm, so will happily accept your changes.

Update: just recognized that this is not true, actually! And found a bug in the experiment impl (not this PR). Will fix after lunch. 🙃

Copy link
Member

Choose a reason for hiding this comment

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

PR: #7103


useEffect(() => {
(async () => {
setAuthProviders(await getGitpodService().server.getAuthProviders());
})();
}, [])

if (Experiment.has(experiment)) {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

@laushinka My bad, turns our React does not like this: build failed with Line 83:9: React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render react-hooks/rules-of-hooks.

Then the if(Experiment.hat... goes into the useEffect, on top-level. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes just saw this as well


useEffect(() => {
(async () => {
setAuthProviders(await getGitpodService().server.getAuthProviders());
})();
}, [])

if (Experiment.has(experiment)) {
Copy link
Contributor

@jankeromnes jankeromnes Dec 7, 2021

Choose a reason for hiding this comment

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

React doesn't seem to like the conditional useEffect.

Maybe always run the useEffect, but do if (!Experiment.has(experiment)) { return; } at the top of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes just realized this too

@geropl
Copy link
Member

geropl commented Dec 7, 2021

@laushinka Sorry for the additional confusion - and thx for fixing. 🙏 Here's a follow-up PR to fix other issues as well: #7103

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Cannot test - "max number of users for licence" reached 🤷

But tested before, and code lgtm, so: 👍

@roboquat
Copy link
Contributor

roboquat commented Dec 7, 2021

LGTM label has been added.

Git tree hash: 26cdb08ca8eb7574a013df588f0031e3827e8a76

@roboquat
Copy link
Contributor

roboquat commented Dec 7, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Foge9627, geropl

Associated issue: #6826

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

The pull request process is described 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

@roboquat roboquat merged commit 7b7193d into main Dec 7, 2021
@roboquat roboquat deleted the laushinka/login-6826 branch December 7, 2021 12:50
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Dec 9, 2021
@jldec
Copy link
Contributor

jldec commented Dec 12, 2021

See followups #7188 and #7138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customize the Login page for unauthenticated users arriving from an "Open in Gitpod" context
7 participants