Skip to content

Add "Enable Prebuilds" to Project Settings – EXP-573 #18698

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

Merged
merged 36 commits into from
Sep 15, 2023

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Sep 11, 2023

Description

This should add an explicit "Enable Prebuilds" checkbox to project settings.

Not enabled Enabled
Screenshot 2023-09-13 at 15 25 54 Screenshot 2023-09-13 at 15 25 59

Pre-existing projects are treated as if prebuilds were enabled, i.e. if new settings aren't present prebuilds are enabled and you'd need to disable them manually. Prebuilds are disabled when new projects are created.

Visualizing the prebuild enablement state in the list of all projects

Screenshot 2023-09-13 at 15 22 52

New CTA on Project Created page guiding users to the project settings

Screenshot 2023-09-13 at 15 33 27

Known issues

  • webhooks aren't installed and no errors is shown
Summary generated by Copilot

🤖 Generated by Copilot at 4f80bee

No summary available (Limit exceeded: required to process 129049 tokens, but only 50000 are allowed per call)

Related Issue(s)

Fixes EXP-573

How to test

Unfortunately, this requires a full manual test of prebuild setups with all supported SCMs.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@geropl
Copy link
Member

geropl commented Sep 11, 2023

Can't test yet, it seems, to waiting with the ✔️ 🙃

@AlexTugarev AlexTugarev changed the title At/enablePrebuilds-settings Add "Enable Prebuilds" to Project Settings – EXP-573 Sep 11, 2023
<Heading2 className="mt-12">Prebuilds</Heading2>
<CheckboxInputField
label="Enable prebuilds"
hint="You need to have admin permissions on the repository in order to install a webhook for prebuilds."
Copy link
Member

@loujaybee loujaybee Sep 11, 2023

Choose a reason for hiding this comment

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

thought(blocking): I assume that clicking enable will install the webhook? If so, that's not super obvious to me as a user. Mentioning the "webhook" at all here feels confusing, could we leave it up to the error? e.g. the user clicks to enable, if incorrect permissions show an error with an action? There feels like too much information that we'd need to contain here, e.g. we'd also need to mention that this overrides the init and before steps of your .gitpod.yml. @gtsiolis -> Any chance we could do a quick mockup and iterate on the copy text for @AlexTugarev? Happy to do a quick sync tomorrow morning if needed to get this unblocked.

Copy link
Member Author

Choose a reason for hiding this comment

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

I assume that clicking enable will install the webhook?

yes

If so, that's not super obvious to me as a user.

that's not a change to current state at all. in fact, you would actually get feedback if it fails. today, if it fails, you wouldn't even notice as everything happens behind the scene and there is no feedback.

Mentioning the "webhook" at all here feels confusing, could we leave it up to the error? e.g. the user clicks to enable, if incorrect permissions show an error with an action?

yes. I like that! let's simplify the hint, not mentioning the webhook and improve the error message.
CTA? which one? I think the most we can do is point out to check write permissions in Gitpod and admin permissions on the project at the SCM provider.

👍🏻 for the sync, but I don't see a blocker her TBH. this is where we need input, thus please fill in the gaps 🙏🏻

@roboquat roboquat added size/XXL and removed size/XL labels Sep 12, 2023
@gtsiolis
Copy link
Contributor

Looking at UX changes now! 👀

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.

Leaving a first round of comments. 🥊

Also scheduled a sync with @AlexTugarev taking place in the next hour to discuss more about this. 💬

Also, thanks for the ping[1], @loujaybee.

Comment on lines +17 to 18
enablePrebuilds?: boolean;
useIncrementalPrebuilds?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

The backwards compatibility logic that undefined actually means enabled is very surprising. What are you concerns with usin the inverse logic internally? I.e. prebuildsDisabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

The backwards compatibility logic that undefined actually means enabled is very surprising.

Agree on that. I'd like to follow-up with a data migration separate from this PR and backfill all empty settings using a migration, then remove the compatibility lines. Would you be fine with that?

Using the inverse logic internally just for the sake of not dealing with the data migration sounds as odd as the compatibility mode.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you do a data migration, then I'd love to discuss if a shape for prebuilds as suggested by @geropl would make sense. Also would be good to name the property enabled instead of enable as the later sounds like an action and not like a state.

@mustard-mh
Copy link
Contributor

Found that CreateProject method on public-api don't have other addition settings passed [1]. Should we bring it to public-api too? Or leave it to another issue? @AlexTugarev

@AlexTugarev
Copy link
Member Author

AlexTugarev commented Sep 13, 2023

@mustard-mh, thanks for raising this!

Yes, we'd need to adjust the default value for new projects equally between the APIs! I'll take care of it. Just had a closer look. PAPI simply passes to server internally, so we're good here. CreateProject doesn't need to set any settings. ✔️

What's more surprising, there is no UpdateProject available in PAPI. 🤷🏻‍♂️ That's definitely out of scope here.

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.

Left two more comments with copy suggestions, to match the latest designs shared in a relevant discussion (internal). 🥊

Feel free to ignore if you think they cause more confusion. 🏓

@geropl
Copy link
Member

geropl commented Sep 14, 2023

Taking a look now 👀

@geropl
Copy link
Member

geropl commented Sep 14, 2023

mini-nit: Would be great if we could show the "Learn More" link also if the option is disabled, as that enables users in case they don't yet know about Prebuilds.
image

nit 2: Would be great to see some indication whether Prebuilds are enabled on this page (maybe all empty plus a central CTA "Enable Prebuilds" as we do in other places):
image

nit 3: When "Prebuilds" are disabled in the settings, I can still trigger a Prebuild manually (and I think that is good ™️ ). Still might be a question for another day/meeting/Slack thread: Have we already discussed/thought about naming it "Automatic Prebuilds"?

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.

Code LGTM, tested and works ✔️

@AlexTugarev
Copy link
Member Author

I moved the "Learn more" link, so that it's also present if prebuilds aren't enabled.

Next: testing once more with other SCM providers before landing this.

@AlexTugarev
Copy link
Member Author

Screenshot 2023-09-15 at 08 33 04

Fixed bug with BBS prebuilds via 418a1fa

@AlexTugarev
Copy link
Member Author

Screenshot 2023-09-15 at 08 57 08

Fixed GitLab prebuilds in 453bfb3

@AlexTugarev
Copy link
Member Author

Screenshot 2023-09-15 at 09 01 48

Checked with bitbucket.org 👍🏻

@AlexTugarev
Copy link
Member Author

/unhold

@roboquat roboquat merged commit cb3a7f0 into main Sep 15, 2023
@roboquat roboquat deleted the at/enablePrebuilds-settings branch September 15, 2023 07:07
@AlexTugarev AlexTugarev restored the at/enablePrebuilds-settings branch September 15, 2023 07:57
@svenefftinge svenefftinge deleted the at/enablePrebuilds-settings branch September 18, 2023 08:21
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.

10 participants