Skip to content

Commit ab8dbf5

Browse files
committed
Merge branch 'main' into aa/enable-gha
2 parents 9873a39 + 1624cc6 commit ab8dbf5

File tree

136 files changed

+3613
-1415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+3613
-1415
lines changed

.github/CODEOWNERS

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/components/common-go @gitpod-io/engineering-staff-engineers
99
/components/content-service-api @gitpod-io/engineering-workspace
1010
/components/content-service @gitpod-io/engineering-workspace
11-
/components/dashboard @gitpod-io/engineering-webapp
11+
/components/dashboard @gitpod-io/engineering-webapp @gtsiolis
1212
/components/docker-up @gitpod-io/engineering-workspace
1313
/components/ee/agent-smith @gitpod-io/engineering-workspace
1414
/components/ee/db-sync @gitpod-io/engineering-webapp
@@ -27,13 +27,15 @@
2727
/components/image-builder-api @csweichel @geropl
2828
/components/image-builder-bob @gitpod-io/engineering-workspace
2929
/components/image-builder-mk3 @gitpod-io/engineering-workspace
30-
/components/installation-telemetry @gitpod-io/engineering-delivery-operations-experience
31-
/components/kots-config-check @gitpod-io/engineering-delivery-operations-experience
30+
/components/installation-telemetry @gitpod-io/engineering-security-infrastructure-and-delivery
31+
/components/kots-config-check @gitpod-io/engineering-security-infrastructure-and-delivery
3232
/components/toxic-config @gitpod-io/engineering-webapp
33-
/install @gitpod-io/engineering-delivery-operations-experience
34-
/install/installer @gitpod-io/engineering-delivery-operations-experience
33+
/install @gitpod-io/engineering-security-infrastructure-and-delivery
34+
/install/installer @gitpod-io/engineering-security-infrastructure-and-delivery
3535
# For testdata a single review from anyone who is allowed to review PRs is sufficent.
3636
/install/installer/cmd/testdata
37+
# Allow everyone to approve config changes
38+
/install/installer/pgk/config
3739
/install/installer/pkg/components/agent-smith @gitpod-io/engineering-workspace
3840
/install/installer/pkg/components/blobserve @gitpod-io/engineering-ide
3941
/install/installer/pkg/components/components-ide @gitpod-io/engineering-ide
@@ -82,7 +84,7 @@
8284
/components/supervisor @gitpod-io/engineering-ide
8385
/components/usage @gitpod-io/engineering-webapp
8486
/components/usage-api @gitpod-io/engineering-webapp
85-
/components/workspace-rollout-job @gitpod-io/engineering-delivery-operations-experience @gitpod-io/engineering-workspace
87+
/components/workspace-rollout-job @gitpod-io/engineering-security-infrastructure-and-delivery @gitpod-io/engineering-workspace
8688
/components/workspacekit @gitpod-io/engineering-workspace
8789
/components/ws-daemon-api @aledbf @Furisto
8890
/components/ws-daemon @gitpod-io/engineering-workspace
@@ -95,28 +97,28 @@
9597
/dev/gpctl @gitpod-io/engineering-workspace
9698
/dev/gpctl/api/ @gitpod-io/engineering-webapp
9799
/dev/loadgen @gitpod-io/engineering-workspace
98-
/dev/preview @gitpod-io/engineering-delivery-operations-experience
100+
/dev/preview @gitpod-io/engineering-security-infrastructure-and-delivery
99101
# The deploy-gitpod.sh is shared between all teams.
100102
/dev/preview/workflow/preview/deploy-gitpod.sh
101-
/operations/observability/mixins @gitpod-io/engineering-delivery-operations-experience
102-
/operations/observability/mixins/platform @gitpod-io/engineering-delivery-operations-experience
103+
/operations/observability/mixins @gitpod-io/engineering-security-infrastructure-and-delivery
104+
/operations/observability/mixins/platform @gitpod-io/engineering-security-infrastructure-and-delivery
103105
/operations/observability/mixins/IDE @gitpod-io/engineering-ide
104106
/operations/observability/mixins/meta @gitpod-io/engineering-webapp
105107
/operations/observability/mixins/workspace @gitpod-io/engineering-workspace
106-
/operations/observability/mixins/cross-teams @gitpod-io/engineering-workspace @gitpod-io/engineering-webapp @gitpod-io/engineering-ide @gitpod-io/engineering-delivery-operations-experience
108+
/operations/observability/mixins/cross-teams @gitpod-io/engineering-workspace @gitpod-io/engineering-webapp @gitpod-io/engineering-ide @gitpod-io/engineering-security-infrastructure-and-delivery
107109

108-
/.werft/observability @gitpod-io/engineering-delivery-operations-experience
110+
/.werft/observability @gitpod-io/engineering-security-infrastructure-and-delivery
109111

110112
/.werft/ide-* @gitpod-io/engineering-ide
111-
/.werft/platform-* @gitpod-io/engineering-delivery-operations-experience
113+
/.werft/platform-* @gitpod-io/engineering-security-infrastructure-and-delivery
112114
/.werft/webapp-* @gitpod-io/engineering-webapp
113115
/.werft/workspace-* @gitpod-io/engineering-workspace
114-
/.werft/self-hosted-* @gitpod-io/engineering-delivery-operations-experience
115-
/.werft/*installer-tests* @gitpod-io/engineering-delivery-operations-experience
116-
/.werft/jobs/build/self-hosted-* @gitpod-io/engineering-delivery-operations-experience
116+
/.werft/self-hosted-* @gitpod-io/engineering-security-infrastructure-and-delivery
117+
/.werft/*installer-tests* @gitpod-io/engineering-security-infrastructure-and-delivery
118+
/.werft/jobs/build/self-hosted-* @gitpod-io/engineering-security-infrastructure-and-delivery
117119

118-
/dev/preview/infrastructure/harvester @gitpod-io/engineering-delivery-operations-experience
119-
/dev/preview/workflow @gitpod-io/engineering-delivery-operations-experience
120+
/dev/preview/infrastructure/harvester @gitpod-io/engineering-security-infrastructure-and-delivery
121+
/dev/preview/workflow @gitpod-io/engineering-security-infrastructure-and-delivery
120122

121123
.github/workflows/ide-*.yml @gitpod-io/engineering-ide
122124

.github/actions/deploy-gitpod/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ previewctl get-credentials --gcp-service-account "${PREVIEW_ENV_DEV_SA_KEY_PATH}
3030
PREVIEW_NAME="$(previewctl get-name --branch "${INPUT_NAME}")"
3131
export PREVIEW_NAME
3232

33+
for var in WITH_WS_MANAGER_MK2 WITH_DEDICATED_EMU WITH_EE_LICENSE WITH_SLOW_DATABASE ANALYTICS WORKSPACE_FEATURE_FLAGS; do
34+
input="INPUT_${var}"
35+
export GITPOD_${var}=${!input}
36+
done
37+
3338
previewctl install-context --branch "${PREVIEW_NAME}" --log-level debug --timeout 10m --gcp-service-account "${PREVIEW_ENV_DEV_SA_KEY_PATH}"
3439
leeway run dev/preview:deploy-gitpod
3540
previewctl report >> "${GITHUB_STEP_SUMMARY}"

.github/actions/deploy-gitpod/metadata.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ inputs:
1313
previewctl_hash:
1414
description: "The Leeway hash of the dev/preview/previewctl:docker package to be used when downloading previewclt"
1515
required: false
16+
with_ws_manager_mk2:
17+
description: "Use WS Manager MK2"
18+
required: false
19+
with_dedicated_emu:
20+
description: "Dedicated Auth"
21+
required: false
22+
with_ee_licencse:
23+
description: "Use EE license"
24+
required: false
25+
with_slow_database:
26+
description: "Use slow database"
27+
required: false
28+
analytics:
29+
description: "With analytics"
30+
required: false
31+
workspace_feature_flags:
32+
description: "Workspace feature flags"
33+
required: false
1634
runs:
1735
using: "docker"
1836
image: "Dockerfile"

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,24 @@ Does this PR require updates to the documentation at www.gitpod.io/docs?
3737
leeway-target=components:all
3838
- [ ] /werft no-test
3939
Run Leeway with `--dont-test`
40+
41+
<details>
42+
<summary>Publish Options</summary>
43+
4044
- [ ] /werft publish-to-npm
45+
- [ ] /werft publish-to-jb-marketplace
46+
</details>
47+
48+
<details>
49+
<summary>Installer Options</summary>
50+
51+
- [ ] with-ee-license
52+
- [ ] with-slow-database
53+
- [ ] with-dedicated-emulation
54+
- [ ] with-ws-manager-mk2
55+
- [ ] workspace-feature-flags
56+
Add desired feature flags to the end of the line above, space separated
57+
</details>
4158

4259
#### Preview Environment Options:
4360
- [ ] /werft with-local-preview

.github/workflows/build.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Build
22
on:
33
pull_request:
4-
types: [opened, edited]
4+
types: [opened, synchronize, edited]
55
push:
6+
branches: [main]
67

78
jobs:
89

@@ -22,6 +23,13 @@ jobs:
2223
build_leeway_target: ${{ steps.output.outputs.build_leeway_target }}
2324
with_large_vm: ${{ steps.output.outputs.with_large_vm }}
2425
publish_to_npm: ${{ steps.output.outputs.publish_to_npm }}
26+
publish_to_jbmp: ${{ steps.output.outputs.publish_to_jbmp }}
27+
with_ws_manager_mk2: ${{ steps.output.outputs.with_ws_manager_mk2 }}
28+
with_dedicated_emulation: ${{ steps.output.outputs.with_dedicated_emulation }}
29+
with_ee_license: ${{ steps.output.outputs.with_ee_license }}
30+
with_slow_database: ${{ steps.output.outputs.with_slow_database }}
31+
analytics: ${{ steps.output.outputs.analytics }}
32+
workspace_feature_flags: ${{ steps.output.outputs.workspace_feature_flags }}
2533
steps:
2634
- name: "Determine Branch"
2735
id: branches
@@ -42,6 +50,13 @@ jobs:
4250
echo "build_leeway_target=$(echo "$PR_DESC" | sed -n -e 's/^.*leeway-target=//p' | sed 's/\r$//')"
4351
echo "with_large_vm=${{ contains(github.event.pull_request.body, '[X] /werft with-large-vm') }}"
4452
echo "publish_to_npm=${{ contains(github.event.pull_request.body, '[X] /werft publish-to-npm') }}"
53+
echo "publish_to_jbmp=${{ contains(github.event.pull_request.body, '[X] /werft publish-to-jb-marketplace') }}"
54+
echo "with_ws_manager_mk2=${{ contains(github.event.pull_request.body, '[X] with-ws-manager-mk2') }}"
55+
echo "with_dedicated_emulation=${{ contains(github.event.pull_request.body, '[X] with-dedicated-emulation') }}"
56+
echo "with_ee_license=${{ contains(github.event.pull_request.body, '[X] with-ee-license') }}"
57+
echo "with_slow_database=${{ contains(github.event.pull_request.body, '[X] with-slow-database') }}"
58+
echo "analytics=${{ contains(github.event.pull_request.body, '[X] analytics') }}"
59+
echo "workspace_feature_flags=$(echo "$PR_DESC" | grep -oP '(?<=\[X\] workspace-feature-flags).*')"
4560
} >> $GITHUB_OUTPUT
4661
4762
build-previewctl:
@@ -165,6 +180,8 @@ jobs:
165180
secrets: |-
166181
segment-io-token:gitpod-core-dev/segment-io-token
167182
npm-auth-token:gitpod-core-dev/npm-auth-token
183+
jb-marketplace-publish-token:gitpod-core-dev/jb-marketplace-publish-token
184+
codecov-token:gitpod-core-dev/codecov
168185
- name: Leeway Build
169186
id: leeway
170187
shell: bash
@@ -177,7 +194,10 @@ jobs:
177194
PR_NO_TEST: ${{needs.configuration.outputs.build_no_test}}
178195
PR_LEEWAY_TARGET: ${{needs.configuration.outputs.build_leeway_target}}
179196
NPM_AUTH_TOKEN: '${{ steps.secrets.outputs.npm-auth-token }}'
180-
PUBLISH_TO_NPM: ${{ needs.configuration.outputs.publish_to_npm == 'true' || needs.configuration.outputs.is_main_branch == 'true' }}
197+
PUBLISH_TO_NPM: ${{ needs.configuration.outputs.publish_to_npm == 'true' || needs.configuration.outputs.is_main_branch == 'true' }}
198+
JB_MARKETPLACE_PUBLISH_TOKEN: '${{ steps.secrets.outputs.jb-marketplace-publish-token }}'
199+
PUBLISH_TO_JBPM: ${{ needs.configuration.outputs.publish_to_jbmp == 'true' || needs.configuration.outputs.is_main_branch == 'true' }}
200+
CODECOV_TOKEN: '${{ steps.secrets.outputs.codecov-token }}'
181201
run: |
182202
[[ "$PR_NO_CACHE" = "true" ]] && CACHE="none" || CACHE="remote"
183203
[[ "$PR_NO_TEST" = "true" ]] && TEST="--dont-test" || TEST=""
@@ -192,9 +212,11 @@ jobs:
192212
--cache $CACHE \
193213
$TEST \
194214
-Dversion=$VERSION \
215+
-DlocalAppVersion=$VERSION \
195216
-DSEGMENT_IO_TOKEN=$SEGMENT_IO_TOKEN \
196217
-DpublishToNPM="${PUBLISH_TO_NPM}" \
197218
-DnpmPublishTrigger="${NPM_PUBLISH_TRIGGER}" \
219+
-DpublishToJBMarketplace="${PUBLISH_TO_JBPM}" \
198220
--coverage-output-path=/__w/gitpod/gitpod/test-coverage-report \
199221
--report report.html || RESULT=$?
200222
set +x
@@ -226,6 +248,12 @@ jobs:
226248
version: ${{needs.configuration.outputs.version}}
227249
sa_key: ${{ secrets.GCP_CREDENTIALS }}
228250
previewctl_hash: ${{ needs.build-previewctl.outputs.previewctl_hash }}
251+
with_ws_manager_mk2: ${{needs.configuration.outputs.with_ws_manager_mk2}}
252+
with_dedicated_emulation: ${{needs.configuration.outputs.with_dedicated_emulation}}
253+
with_ee_license: ${{needs.configuration.outputs.with_ee_license}}
254+
with_slow_database: ${{needs.configuration.outputs.with_slow_database}}
255+
analytics: ${{needs.configuration.outputs.analytics}}
256+
workspace_feature_flags: ${{needs.configuration.outputs.workspace_feature_flags}}
229257

230258
monitoring:
231259
name: "Install Monitoring Satellite"

WORKSPACE.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defaultArgs:
77
publishToNPM: true
88
publishToJBMarketplace: true
99
localAppVersion: unknown
10-
codeCommit: a22e18bcce821d889b541107a695dd93835c7cc7
10+
codeCommit: 0180d69921094cacdaa8d4b6ef007a0783a95e3b
1111
codeVersion: 1.75.0
1212
codeQuality: stable
1313
noVerifyJBPlugin: false
@@ -22,6 +22,7 @@ defaultArgs:
2222
jbBackendVersion: "latest"
2323
REPLICATED_API_TOKEN: ""
2424
REPLICATED_APP: ""
25+
dockerVersion: 20.10.17
2526
provenance:
2627
enabled: true
2728
slsa: true

components/common-go/kubernetes/kubernetes.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,27 @@ func GetCondition(conds []metav1.Condition, tpe string) *metav1.Condition {
171171
}
172172
return nil
173173
}
174+
175+
// ConditionPresentAndTrue returns whether a condition is present and its status set to True.
176+
func ConditionPresentAndTrue(cond []metav1.Condition, tpe string) bool {
177+
for _, c := range cond {
178+
if c.Type == tpe {
179+
return c.Status == metav1.ConditionTrue
180+
}
181+
}
182+
return false
183+
}
184+
185+
// ConditionWithStatusAndReason returns whether a condition is present, and with the given Reason.
186+
func ConditionWithStatusAndReason(cond []metav1.Condition, tpe string, status bool, reason string) bool {
187+
st := metav1.ConditionFalse
188+
if status {
189+
st = metav1.ConditionTrue
190+
}
191+
for _, c := range cond {
192+
if c.Type == tpe {
193+
return c.Type == tpe && c.Status == st && c.Reason == reason
194+
}
195+
}
196+
return false
197+
}

components/common-go/namegen/workspaceid.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,25 @@ import (
1313
"strings"
1414
)
1515

16-
// WorkspaceIDPattern is the expected Worksapce ID pattern
16+
// PossibleWorkspaceIDPatterns
1717
// gitpod-protocol/src/util/generate-workspace-id.ts is authoritative over the generation
1818
// ws-proxy/pkg/proxy/workspacerouter.go is authoritative for this regexp
19+
var PossibleWorkspaceIDPatterns = []string{
20+
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
21+
"[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}",
22+
}
23+
24+
var workspaceIDPattern = regexp.MustCompile(getWorkspaceIDPatternStr())
1925

20-
var WorkspaceIDPattern = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}$`)
26+
// getWorkspaceIDPatternStr is the expected Workspace ID pattern str
27+
// ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}$
28+
func getWorkspaceIDPatternStr() string {
29+
patterns := []string{}
30+
for _, p := range PossibleWorkspaceIDPatterns {
31+
patterns = append(patterns, fmt.Sprintf("^%s$", p))
32+
}
33+
return strings.Join(patterns, "|")
34+
}
2135

2236
func GenerateWorkspaceID() (string, error) {
2337
s1, err := chooseRandomly(colors, 1)
@@ -41,8 +55,8 @@ var (
4155
)
4256

4357
func ValidateWorkspaceID(id string) error {
44-
if !WorkspaceIDPattern.MatchString(id) {
45-
return fmt.Errorf("id '%s' does not match workspace ID regex '%s': %w", id, WorkspaceIDPattern.String(), InvalidWorkspaceID)
58+
if !workspaceIDPattern.MatchString(id) {
59+
return fmt.Errorf("id '%s' does not match workspace ID regex '%s': %w", id, workspaceIDPattern.String(), InvalidWorkspaceID)
4660
}
4761

4862
return nil

components/dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"scripts": {
6767
"start": "craco start",
6868
"build": "craco build --verbose",
69+
"lint": "eslint --ext=.jsx,.js,.tsx,.ts ./src",
6970
"test": "yarn test:unit && ./scripts/run-integration-tests.sh",
7071
"test:unit": "craco test --all --watchAll=false",
7172
"test:unit:watch": "craco test --all",

components/dashboard/src/app/AppRoutes.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const Members = React.lazy(() => import(/* webpackPrefetch: true */ "../teams/Me
6969
const TeamSettings = React.lazy(() => import(/* webpackPrefetch: true */ "../teams/TeamSettings"));
7070
const TeamBilling = React.lazy(() => import(/* webpackPrefetch: true */ "../teams/TeamBilling"));
7171
const SSO = React.lazy(() => import(/* webpackPrefetch: true */ "../teams/SSO"));
72+
const TeamGitIntegrations = React.lazy(() => import(/* webpackPrefetch: true */ "../teams/GitIntegrationsPage"));
7273
const NewProject = React.lazy(() => import(/* webpackPrefetch: true */ "../projects/NewProject"));
7374
const Projects = React.lazy(() => import(/* webpackPrefetch: true */ "../projects/Projects"));
7475
const Project = React.lazy(() => import(/* webpackPrefetch: true */ "../projects/Project"));
@@ -221,6 +222,9 @@ export const AppRoutes: FunctionComponent<AppRoutesProps> = ({ user, teams }) =>
221222
<p className="mt-4 text-lg text-gitpod-red">{decodeURIComponent(getURLHash())}</p>
222223
</div>
223224
</Route>
225+
<Route exact path="/teams">
226+
<Redirect to="/old-team-plans" />
227+
</Route>
224228
<Route exact path="/old-team-plans" component={ChargebeeTeams} />
225229
{/* TODO remove the /teams/join navigation after a few weeks */}
226230
<Route exact path="/teams/join" component={JoinTeam} />
@@ -229,6 +233,8 @@ export const AppRoutes: FunctionComponent<AppRoutesProps> = ({ user, teams }) =>
229233
<Route exact path="/members" component={Members} />
230234
<Route exact path="/projects" component={Projects} />
231235
<Route exact path="/settings" component={TeamSettings} />
236+
<Route exact path="/settings/git" component={TeamGitIntegrations} />
237+
{/* TODO: migrate other org settings pages underneath /settings prefix */}
232238
<Route exact path="/billing" component={TeamBilling} />
233239
<Route exact path="/sso" component={SSO} />
234240
<Route exact path={`/projects/:projectSlug`} component={Project} />
@@ -241,6 +247,34 @@ export const AppRoutes: FunctionComponent<AppRoutesProps> = ({ user, teams }) =>
241247
<Route path={["/t/"]} exact>
242248
<Redirect to="/projects" />
243249
</Route>
250+
{/* redirect for old user settings slugs */}
251+
<Route path="/account" exact>
252+
<Redirect to={settingsPathAccount} />
253+
</Route>
254+
<Route path="/integrations" exact>
255+
<Redirect to={settingsPathIntegrations} />
256+
</Route>
257+
<Route path="/notifications" exact>
258+
<Redirect to={settingsPathNotifications} />
259+
</Route>
260+
<Route path="/billing" exact>
261+
<Redirect to={settingsPathBilling} />
262+
</Route>
263+
<Route path="/plans" exact>
264+
<Redirect to={settingsPathPlans} />
265+
</Route>
266+
<Route path="/preferences" exact>
267+
<Redirect to={settingsPathPreferences} />
268+
</Route>
269+
<Route path="/variables" exact>
270+
<Redirect to={settingsPathVariables} />
271+
</Route>
272+
<Route path="/tokens">
273+
<Redirect to={settingsPathPersonalAccessTokens} />
274+
</Route>
275+
<Route path="/keys" exact>
276+
<Redirect to={settingsPathSSHKeys} />
277+
</Route>
244278
<Route
245279
path="*"
246280
render={(_match) => {

0 commit comments

Comments
 (0)