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

Support for multi-repo projects #7785

Merged
merged 2 commits into from
Mar 10, 2022
Merged

Support for multi-repo projects #7785

merged 2 commits into from
Mar 10, 2022

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Jan 23, 2022

This PR introduces the possibility to describe dev environments that span multiple repositories. Such a project consists of a main repository, that contains the configuration for the project's dev environment using the .gitpod.yml as usual. The additional repositories don't have a configuration on their own but all point to the main repository's configuration. Here's a loom video showing this in action.

The pointing is done bi-directionally in the repositories .gitpod.yml.
The main repository's .gitpod.yml contains a list of additionalRepositories.

How to test (example contexts)

A team with projects is set up: Join the team

Repo Context
main repo default Open in Gitpod
main repo pull request Open in Gitpod
sub repo default Open in Gitpod
sub repo issue Open in Gitpod
sub repo pull request Open in Gitpod

fixes #7608

Things that knowingly are not perfect yet

Multi-repo projects don't have a great representation in the UI (dashboard) yet. One still has to install webhooks/GitHub App on all participating repositories to have the webhook trigger pushevents. Webhooks coming from subrepos are treated as events for the project that contains the main configuration. That's correct but i should be visually clearer, that the project spans multiple repos and also the detail information on prebuilds should list all participating commits.

The idea is to ship a first preview version to get more feedback from users and complete the feature based on what we learn from that.

Documentation

TODO: Add Draft PR for Docs

Release Notes

Support for multi-repository setups

@roboquat
Copy link
Contributor

@svenefftinge: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@svenefftinge svenefftinge changed the title Se-multi-repo Support for multi-repo projects Jan 23, 2022
@codecov
Copy link

codecov bot commented Jan 23, 2022

Codecov Report

Merging #7785 (36ee357) into main (3ef1e86) will decrease coverage by 1.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7785      +/-   ##
==========================================
- Coverage   12.31%   11.17%   -1.14%     
==========================================
  Files          20       18       -2     
  Lines        1161      993     -168     
==========================================
- Hits          143      111      -32     
+ Misses       1014      880     -134     
+ Partials        4        2       -2     
Flag Coverage Δ
components-gitpod-cli-app 11.17% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/auth.go
components/local-app/pkg/auth/pkce.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ef1e86...36ee357. Read the comment docs.

@svenefftinge svenefftinge force-pushed the se-multi-repo branch 3 times, most recently from 739ab95 to 711a613 Compare January 26, 2022 16:35
@roboquat roboquat added size/XL and removed size/XXL labels Jan 26, 2022
@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign csweichel, geropl after the PR has been reviewed.
You can assign the PR to them by writing /assign @csweichel @geropl in a comment when ready.

Associated issue: #7608

The full list of commands accepted by this bot can be found 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 added size/XXL and removed size/XL labels Jan 26, 2022
@svenefftinge
Copy link
Member Author

svenefftinge commented Jan 26, 2022

/werft run

👍 started the job as gitpod-build-se-multi-repo.9

@svenefftinge svenefftinge force-pushed the se-multi-repo branch 6 times, most recently from 4a05700 to 75f6232 Compare February 10, 2022 13:08
@svenefftinge
Copy link
Member Author

svenefftinge commented Feb 11, 2022

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-se-multi-repo.17

@svenefftinge svenefftinge force-pushed the se-multi-repo branch 2 times, most recently from 872e82a to 04766eb Compare February 14, 2022 08:25
@svenefftinge svenefftinge marked this pull request as ready for review February 14, 2022 08:28
jldec
jldec previously approved these changes Mar 6, 2022
Copy link
Contributor

@jldec jldec left a comment

Choose a reason for hiding this comment

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

lgtm

@svenefftinge svenefftinge dismissed stale reviews from jldec and csweichel via e695cf8 March 8, 2022 11:42
@svenefftinge svenefftinge force-pushed the se-multi-repo branch 5 times, most recently from b9e17e3 to 8fd641d Compare March 8, 2022 16:58
@svenefftinge
Copy link
Member Author

svenefftinge commented Mar 9, 2022

/werft run

👍 started the job as gitpod-build-se-multi-repo.43

@svenefftinge
Copy link
Member Author

svenefftinge commented Mar 9, 2022

/werft run clean-slate-deployment

👍 started the job as gitpod-build-se-multi-repo.44

@svenefftinge
Copy link
Member Author

svenefftinge commented Mar 9, 2022

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-se-multi-repo.45

@jldec
Copy link
Contributor

jldec commented Mar 10, 2022

Tested prebuilds and projects with a 2-repo setup as per draft docs

  • fullstack-frontend - main configuration
  • fullstack-backend
  • created projects on a team for both repos
  • pushed to branch on backend - saw prebuild in frontend project - no prebuilds visible in backend project
  • correctly opened workspace using branch and PR contexts from backend repo
  • pushed to matching branches on both repos
  • correctly opened contexts with matching branches from both frontend and backend

project list - note backend branch name in frontend project tile

Screenshot 2022-03-10 at 09 43 22

all prebuilds on main repo project

Screenshot 2022-03-10 at 09 43 50

no prebuilds on sub-repo project

Screenshot 2022-03-10 at 10 02 58

matching branches

Screenshot 2022-03-10 at 09 55 58

Copy link
Contributor

@jldec jldec left a comment

Choose a reason for hiding this comment

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

LGTM based on testing in dev environment.

@roboquat roboquat merged commit cc2f3b3 into main Mar 10, 2022
@roboquat roboquat deleted the se-multi-repo branch March 10, 2022 10:16

public async up(queryRunner: QueryRunner): Promise<void> {
if (!(await columnExists(queryRunner, "d_b_prebuilt_workspace_updatable", "commitSHA"))) {
await queryRunner.query("ALTER TABLE d_b_prebuilt_workspace_updatable ADD COLUMN commitSHA varchar(255) NOT NULL");
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you add a NOT NULL column to an existing table, without a default value? 🤔

Maybe this should be NULL, since commitSHA can be undefined in DBPrebuiltWorkspaceUpdatable.

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed in #8711

@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production size/XXL team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Epic: Multi-repo Workspaces
7 participants