Skip to content

[public-api] migrate PrebuildService #19062

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 1 commit into from
Nov 21, 2023
Merged

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Nov 12, 2023

Description

Summary generated by Copilot

🤖 Generated by Copilot at ccd31b6

Migrate the dashboard components and services from the server API to the new public API for prebuilds, defined in prebuild.proto and implemented in public-api.ts and json-rpc-prebuild-client.ts. Add error handling to watchWorkspace and move and rename the PrebuildLogs component.

Related Issue(s)

Fixes EXP-850

How to test

  • Create a project and enable configuration for it. Use something simple to build like https://github.com/akosyakov/parcel-demo. You may need to grant permissions to GitHub auth provider in User -> Preferences.
  • Go to brances page of the project and trigger a prebuild there for the branch, observe that it goes via all phases, you can see logs and eventually see it ready.
  • Start a workspace from it, observe that it goes via all phases as well, stop workspace.
  • Trigger a prebuild again from the branches page, now use cancel to check that it is stopped.
  • Go to the overview page of all projects and check that you can see the state of latest prebuild form there and navigate to it.
  • Go to prebuilds page of the project and trigger the prebuild from there, observe that the prebuild is reflected in list of prebuilds.

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

@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from ccd31b6 to ba8d3a4 Compare November 12, 2023 22:33
@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from ba8d3a4 to 8d11a3d Compare November 13, 2023 15:03
@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from 8d11a3d to 88aa78d Compare November 14, 2023 09:28
@akosyakov akosyakov mentioned this pull request Nov 14, 2023
14 tasks
@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from 88aa78d to 3f324fa Compare November 14, 2023 11:28
@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from 3f324fa to 1011e90 Compare November 15, 2023 12:51
Base automatically changed from ak/prebuild_api to main November 16, 2023 13:10
@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from f44c51c to 9c269ac Compare November 16, 2023 13:39

// This is used to version the cache
// If data we cache changes in a non-backwards compatible way, increment this version
// That will bust any previous cache versions a client may have stored
const CACHE_VERSION = "3";
const CACHE_VERSION = "5";
Copy link
Member Author

Choose a reason for hiding this comment

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

bumping up cache!

@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch 5 times, most recently from 034237a to cb3b524 Compare November 17, 2023 14:24
@@ -76,6 +87,139 @@ export class PrebuildManager {
return undefined;
}

public async *watchPrebuildStatus(userId: string, configurationId: string): AsyncGenerator<PrebuildWithStatus> {
Copy link
Member Author

Choose a reason for hiding this comment

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

this one is new, and used only by gRPC

@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from cb3b524 to 2a1566a Compare November 19, 2023 20:29
@akosyakov akosyakov marked this pull request as ready for review November 20, 2023 09:52
@akosyakov akosyakov requested a review from a team as a code owner November 20, 2023 09:52
@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from 2a1566a to e2f5a26 Compare November 20, 2023 11:52
Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

@akosyakov, just tested the default flows with prebuilds, and it seems to work just fine. Code changes looks good, but it's a big 🐋 of a PR.

Should we also test with FF enabled? 🤷🏻

Please rebase, so we can proceed.

@akosyakov
Copy link
Member Author

but it's a big 🐋 of a PR.

yeah, I mean we can ask to double test by @mustard-mh to have more confidence

Should we also test with FF enabled? 🤷🏻

We can do it, but let's after approving JSON-RPC shim. That it does not cause confusion between testers.

@akosyakov akosyakov force-pushed the ak/migrate_prebuild_service branch from e2f5a26 to ac1cc39 Compare November 21, 2023 14:17
@akosyakov
Copy link
Member Author

rebased, but now we need to wait for a build

Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

LGTM!

@akosyakov
Copy link
Member Author

@mustard-mh do you want to give it a go just to boost our confidence a bit 😄

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

Log will be duplicated after prebuild is succeed, but not harmful (maybe it's the same in Cloud now)

✅ Test it works as promised 🚀

@akosyakov
Copy link
Member Author

on gitpod.io it looks like @mustard-mh the same?
Screenshot 2023-11-21 at 16 12 47

@akosyakov
Copy link
Member Author

/unhold

@roboquat roboquat merged commit 6933bab into main Nov 21, 2023
@roboquat roboquat deleted the ak/migrate_prebuild_service branch November 21, 2023 15:15
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.

6 participants