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

[projects] always enable New Workspace button on config page #6389

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Oct 25, 2021

Playing around with New Workspace button to trigger a prebuild and launch a workspace for that.

Triggering a prebuild, or waiting for the response seems to add ~2 seconds. I'm not sure if we'll see timing issue if the await would be removed, at least I couldn't force a second prebuild on the same sha+config.

2021-10-26 14 24 33

Resolves #6303

Always enable the New Workspace button on the Configuration Page.

@svenefftinge
Copy link
Member

svenefftinge commented Oct 26, 2021

I thought we could just show one button, that would use the https://gitpod.io/#prebuild context URL.
People would end up on the prebuild page (optionally skip it ) and automatically land in a workspace.

I think we should add something like "What's a prebuild?" to this screen. cc @gtsiolis
Screenshot 2021-10-26 at 14 55 19

@AlexTugarev
Copy link
Member Author

I thought we could just show one button, that would use the https://gitpod.io/#prebuild context URL.

as the prebuild context url was subject to be phased out for regular usage, it wasn't considered for prebuilds with the additional configuration, as far as I see. given that, the only path to use the config in a following prebuild is to store it first, trigger a new prebuild, and then start a workspace.

Comment on lines 46 to 47
- init: echo 'TODO: build project'
command: echo 'TODO: start app'`
Copy link
Contributor

Choose a reason for hiding this comment

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

I like what you did here (undetected project yaml using valid echo commands) 🙂 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlexTugarev, unfortunately the yaml doesn't parse : inside a string unless the whole value is quoted.
I recommend using the | and putting the echo command like you have it indented on the next line.

tasks: 
- init: |
    echo 'TODO: build project'

  command: |
    echo 'TODO: start app'

Copy link
Member Author

Choose a reason for hiding this comment

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

nice catch! thanks!

@@ -239,7 +239,7 @@ function App() {
<Route path="/admin/workspaces" component={WorkspacesSearch} />

<Route path={["/", "/login"]} exact>
<Redirect to="/workspaces" />
<Redirect to="/workspaces?blabla" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this ?blabla here?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, that's a leftover. (I had a hard time to convince react router to redirect to /#context_url and this was a test to see where the redirect broke. then just forgot to remove it. )

Copy link
Contributor

Choose a reason for hiding this comment

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

:)

@jldec
Copy link
Contributor

jldec commented Oct 26, 2021

Thanks @AlexTugarev

This does accomplish the main objective of unblocking users who get stuck with invalid yaml 👍

I do have similar feedback as @svenefftinge. I think new users will still be confused by 2 buttons especially when the less familiar "Run Prebuild" button is the green one.

Screenshot 2021-10-26 at 16 44 37

I propose the following small UI changes to address this
I am also open to Sven's suggestion, if you think the work/risk involved to do that is not much more

UI Proposal

  • swap the order of the 2 buttons.
  • make "New Workspace" the green one (now on the right)
  • make "Run Prebuild" not-green.
  • change the help text in the pane to include a link to the prebuild docs as well i.e.

No Recent Prebuild
Edit the project configuration on the left to get started. Learn more about prebuilds and .gitpod.yml

@jldec
Copy link
Contributor

jldec commented Oct 27, 2021

@gtsiolis wdyt - are you 👍 with this?

It seems like the easiest way to reduce confusion about 2 buttons, and also preserve the abililty to do a quick inner-loop edit-run-prebuild.

UI Proposal

  • swap the order of the 2 buttons.
  • make "New Workspace" the green one (now on the right)
  • make "Run Prebuild" not-green.
  • change the help text in the pane to include a link to the prebuild docs as well i.e.

cc: @svenefftinge

@gtsiolis
Copy link
Contributor

gtsiolis commented Oct 27, 2021

/werft run

👍 started the job as gitpod-build-at-new-workspace.4

@gtsiolis
Copy link
Contributor

gtsiolis commented Oct 27, 2021

Looking at this now! 👀

@AlexTugarev
Copy link
Member Author

AlexTugarev commented Oct 27, 2021

/werft run

👍 started the job as gitpod-build-at-new-workspace.6

@jldec
Copy link
Contributor

jldec commented Oct 28, 2021

Discussed with @AlexTugarev and @gtsiolis

Decided to resolve #6303 with minimal button changes and not remove the logs output from the project configuration page in this PR.

Will track that work separately in #5785

@AlexTugarev AlexTugarev force-pushed the at/new-workspace branch 3 times, most recently from 9c07e42 to e735b4f Compare October 28, 2021 10:58
@AlexTugarev AlexTugarev marked this pull request as ready for review October 28, 2021 11:04
@AlexTugarev
Copy link
Member Author

AlexTugarev commented Oct 28, 2021

@jldec, please have a look again. 🙏🏻

Comment on lines 46 to 47
- init: echo 'TODO: build project'
command: echo 'TODO: start app'`
Copy link
Contributor

Choose a reason for hiding this comment

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

@AlexTugarev, unfortunately the yaml doesn't parse : inside a string unless the whole value is quoted.
I recommend using the | and putting the echo command like you have it indented on the next line.

tasks: 
- init: |
    echo 'TODO: build project'

  command: |
    echo 'TODO: start app'

@jldec
Copy link
Contributor

jldec commented Oct 28, 2021

b.t.w
I recommend https://onlineyamltools.com/convert-yaml-to-json for testing yaml,
and https://yaml-multiline.info/ for multiline docs

@gptest1
Copy link

gptest1 commented Oct 28, 2021

@AlexTugarev do you think we could allow the NewWorkspaceButton without waiting for isDetecting? Detection is currently not working for private repos and maybe it might fail for other reasons in future, so allowing the flow to continue to the New Workspace without detection would be better IMO.

Alternatively, the detection could block theflow for a 1 or 2 seconds, but then time-out (or err-out) and allow New Workspace to continue.

@roboquat roboquat added the lgtm label Oct 28, 2021
@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: 410513446588bce9969b63355689c46eb76a0d94

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jldec

Associated issue: #6303

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 14a5405 into main Oct 28, 2021
@roboquat roboquat deleted the at/new-workspace branch October 28, 2021 21:43
@jldec
Copy link
Contributor

jldec commented Oct 28, 2021

I resolved the "requested changes" (yaml fix) which triggered an approved review, and then a merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable "New Workspace" button in Project Configuration without first having to use "Run Prebuild" button
6 participants