-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[projects] try to authorize if necessary #5640
Conversation
@AlexTugarev please add a release note or |
8333a76
to
c83d0e6
Compare
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.
Thanks for giving this a go @AlexTugarev! 🗳️
@@ -121,6 +171,20 @@ export default function () { | |||
|
|||
return <> | |||
<Header title="Branches" subtitle={<h2 className="tracking-wide">View recent active branches for <a className="text-gray-500 hover:text-gray-800 font-semibold" href={project?.cloneUrl}>{project?.name}</a>.</h2>} /> | |||
|
|||
{showAuthModal && ( |
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.
issue: Do we also need to use the same auth flow when opening the configuration page as the user is stuck in detecting project configuration phase?
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.
the plan is to replicate it on the config page once it's working nicely here.
@@ -121,6 +171,20 @@ export default function () { | |||
|
|||
return <> | |||
<Header title="Branches" subtitle={<h2 className="tracking-wide">View recent active branches for <a className="text-gray-500 hover:text-gray-800 font-semibold" href={project?.cloneUrl}>{project?.name}</a>.</h2>} /> | |||
|
|||
{showAuthModal && ( |
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.
question: I have access to the Prebuilds page without authorizing with the provider which also includes commit information. Expected?
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.
Because this is all persisted on backend, yes.
Is there a problem with that?
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.
Does not look like a problem! ✔️
9b2499f
to
dfe9de6
Compare
f9045c7
to
ffc6905
Compare
ffc6905
to
adda6dc
Compare
/werft run 👍 started the job as gitpod-build-at-project-auth.12 |
Many thanks! Taking a look now 👀 |
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.
Many thanks @AlexTugarev!
Code looks good to me so far (please see in-line comments), but I couldn't test the PR, as I couldn't get it deployed properly (see Slack)
Could you please rebase this Pull Request and re-deploy it with a GitHub App integration? 😬 🙏
700bfc0
to
8bc6469
Compare
@jankeromnes, this isn't necessary. please try with a second account created with GitHub and visiting a project created with a first account (GitLab.) there are not specifics to GitHub which would require to set up the GH App in here. (just updated the description ☝🏻 ) |
/werft run 👍 started the job as gitpod-build-at-project-auth.21 🤞🏻 |
Thanks for noticing, @jankeromnes! There wasn't a spec for the configurator specifically but the current state looks good. 🍊 🍊 🍊 🍊 thought: I think using non-modal approach makes the flow less distruptive and more aligned with the rest of the product. For example, we don't use a modal to ask for authorization when needed (e.g. workspace loading screen) and using a modal could require us to render empty pages behind the modal (e.g empty branches list) which could look strange in terms of UX. Also, the already existing non-modal auth flow when adding a project, which is using the same pattern with the gray background to ask for user input or authorization, helps build a muscle memory across the product. 💭
I'd love to hear any feedback on this. Cc @AlexTugarev @jankeromnes |
Co-authored-by: Jan Keromnes <[email protected]>
1e21f41
to
c19ef64
Compare
@gtsiolis and @jankeromnes, what's left here to proceed? |
/werft run 👍 started the job as gitpod-build-at-project-auth.34 |
From my side, nothing left! 🎉 Thanks a lot for following up. 🙏 I'm happy to take another look in about an hour and approve. |
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.
Perfection ✨
Code looks good to me (especially with ?w=1
) and works as advertised! 🎉
One small error, but seems unrelated to this PR (i.e. maybe a follow-up?) -- When creating a new project as a new Member (i.e. not an Owner), I see an alert about not being authorized to create the project, however the project is created anyway? 😳 That's confusing. And when being upgraded from Member to Owner, the error on creation no longer shows up.
To reproduce:
- set up a team with 2 members (user A connected with GitHub, invites as "Member" user B connected with GitLab)
- (user B) try create a project from a GitLab repository, see error alert
- (user B) going to the Projects list, see that the project was actually created anyway
LGTM label has been added. Git tree hash: fcb8d1b6cdb18568cdad35f854f8ab6484525834
|
Great catch, @jankeromnes! I was able to reproduce this on staging and production. Upvoting for a follow-up issue. ⚾ |
@jankeromnes, good catch Update: @jankeromnes, please try to reproduce on staging or prod 🙏🏻 I followed your steps, but I couldn't reproduce. Actually it looks really like a token issue, it seems that your gitlab.com token was not found 🤷🏻♂️ |
/approve no-issue |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AlexTugarev, jankeromnes Associated issue: #5461 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 |
This is an alternative solution to the PR #5484 where we simply use project owner's token on the backend to serve the project details. Here we will ask the current user to authorize with a provider on demand, otherwise it wont load the details.
Related Issue(s)
Fixes #5461
How to test
Release Notes