Skip to content

Conversation

@filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Jul 8, 2024

Description

Starting with this PR, when you enable prebuilds on a repository, there no longer will be a webhook installed on the underlying scm-hosted repo. Instead, prebuilds will be triggered based on workspace activity, or in other words, a prebuild will trigger any time a workspace is created on a repo which has them enabled. This of course still takes prebuild preferences into account, so commit intervals, branch matching strategies and other settings still apply.

This is how the setup will look like for current repos:

graph TD
    subgraph GitHub
        GHRepo[Repository]
    end
    subgraph Gitpod
        GPRepo[Configured Repository]
        Workspace[Workspace]
    end

    GHRepo -- Webhook --> GPRepo
    GHRepo -- Code --> Workspace
    GPRepo -- Code push Trigger --> Prebuild[Prebuild]
    Workspace -- Workspace Creation Trigger --> Prebuild
Loading

And for new repositories, without purely activity-based

graph TD
    subgraph GitHub
        GHRepo[Repository]
    end
    subgraph Gitpod
        GPRepo[Configured Repository]
        Workspace[Workspace]
    end

    GHRepo -- Code --> Workspace
    Workspace -- Workspace Creation Trigger --> Prebuild
Loading

Related Issue(s)

Fixes ENT-435

How to test

In order to test, you can follow these steps:

  1. In the preview environment, configure a repository under Repository settings. It should preferably be some throwaway repo to which you can push to (for instance, feel free to fork https://github.com/filiptronicek/test-foofies/ from which you can run ./commits.sh <n>)
  2. Enable prebuilds for the repository and create a new workspace with it
  3. You should see a new prebuild being triggered after your workspace has started
  4. Try creating another workspace from the same repo to see that:
    a. The prebuild was used for the workspace
    b. No new prebuild was triggered
  5. Now, push 21 commits to your repo and start a new workspace on it, it should trigger a prebuild

Documentation

https://github.com/gitpod-io/website/pull/4756

Preview status

https://ft-activit0b1202b619.preview.gitpod-dev.com/workspaces

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
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • 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

@filiptronicek filiptronicek changed the base branch from gpl/282-cleanup to gpl/prebuild-cleanup July 8, 2024 15:20
Base automatically changed from gpl/prebuild-cleanup to main July 10, 2024 08:50
@filiptronicek filiptronicek self-assigned this Jul 11, 2024
@filiptronicek filiptronicek force-pushed the ft/activity-based-prebuilds branch from 541cd87 to aff1d1a Compare July 11, 2024 15:47
@roboquat roboquat added size/L and removed size/XL labels Jul 11, 2024
configuration: Configuration;
};

const COACHMARK_KEY = "new_prebuilds_trigger_notification";
Copy link
Member Author

@filiptronicek filiptronicek Jul 11, 2024

Choose a reason for hiding this comment

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

It's not really a coach mark, but I for some reason couldn't imagine coachmarksDismissals being used for anything else in #19413 🤦

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, hindsight's 20/20

@roboquat roboquat added size/XXL and removed size/L labels Jul 11, 2024
Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

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

Sweet! ❤️ Love how much complexity this removes

@filiptronicek filiptronicek force-pushed the ft/activity-based-prebuilds branch from 6540554 to 378040e Compare July 12, 2024 11:57
@filiptronicek
Copy link
Member Author

:shipit:

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.

4 participants