Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ARG TARGETOS

# Install dependencies
USER root
ARG LEEWAY_VERSION=0.10.6
ARG LEEWAY_VERSION=0.10.8
ENV LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE=8388608
ENV LEEWAY_WORKSPACE_ROOT=/workspace/gitpod
ENV LEEWAY_REMOTE_CACHE_BUCKET=leeway-cache-dev-3ac8ef5
Expand Down Expand Up @@ -336,12 +336,6 @@ RUN curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh |
&& nvm install v${NODE_VERSION} \
&& nvm alias default v${NODE_VERSION}"

# Disable npm/yarn lifecycle scripts by default (security hardening)
# To allow specific packages, use: npm rebuild <package> or yarn rebuild <package>
RUN npm config set ignore-scripts true --location=global && \
npm config set ignore-scripts true --location=user && \
echo 'ignore-scripts true' >> ~/.yarnrc

# Disable npx (security hardening - prevents arbitrary package execution)
# Remove npx from NVM and replace with stub that prints warning
RUN rm -f /usr/bin/npx /usr/local/bin/npx && \
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-gitpod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
FROM eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion .github/actions/deploy-monitoring-satellite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
FROM eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion .github/actions/preview-create/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
FROM eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
9 changes: 6 additions & 3 deletions .github/workflows/branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
runs-on: ubuntu-latest-16-cores
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
steps:
- uses: actions/checkout@v4
Expand All @@ -122,6 +122,7 @@ jobs:
shell: bash
env:
LEEWAY_REMOTE_CACHE_BUCKET: ${{needs.configuration.outputs.leeway_cache_bucket}}
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
run: |
leeway build dev/preview/previewctl:cli --cache remote
infrastructure:
Expand Down Expand Up @@ -180,7 +181,7 @@ jobs:
ports:
- 6379:6379
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
env:
DB_HOST: "mysql"
Expand Down Expand Up @@ -214,6 +215,7 @@ jobs:
JAVA_HOME: /home/gitpod/.sdkman/candidates/java/current
VERSION: ${{needs.configuration.outputs.version}}
LEEWAY_REMOTE_CACHE_BUCKET: ${{needs.configuration.outputs.leeway_cache_bucket}}
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
IMAGE_REPO_BASE: ${{needs.configuration.outputs.image_repo_base}}/dev
shell: bash
run: |
Expand Down Expand Up @@ -261,6 +263,7 @@ jobs:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
LEEWAY_REMOTE_CACHE_BUCKET: ${{needs.configuration.outputs.leeway_cache_bucket}}
IMAGE_REPO_BASE: ${{needs.configuration.outputs.image_repo_base}}/build
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true

# SCM tokens for integration tests
GITPOD_TEST_TOKEN_BITBUCKET: "${{ secrets.GITPOD_TEST_TOKEN_BITBUCKET }}"
Expand Down Expand Up @@ -516,7 +519,7 @@ jobs:
environment: branch-build
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
if: needs.configuration.outputs.with_integration_tests != '' && needs.configuration.outputs.is_scheduled_run != 'true'
concurrency:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
runs-on: ubuntu-latest-16-cores
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
steps:
- uses: actions/checkout@v4
Expand All @@ -125,6 +125,7 @@ jobs:
shell: bash
env:
LEEWAY_REMOTE_CACHE_BUCKET: ${{needs.configuration.outputs.leeway_cache_bucket}}
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
run: |
leeway build dev/preview/previewctl:cli --cache remote
infrastructure:
Expand Down Expand Up @@ -183,7 +184,7 @@ jobs:
ports:
- 6379:6379
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
env:
DB_HOST: "mysql"
Expand Down Expand Up @@ -217,6 +218,7 @@ jobs:
JAVA_HOME: /home/gitpod/.sdkman/candidates/java/current
VERSION: ${{needs.configuration.outputs.version}}
LEEWAY_REMOTE_CACHE_BUCKET: ${{needs.configuration.outputs.leeway_cache_bucket}}
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
IMAGE_REPO_BASE: ${{needs.configuration.outputs.image_repo_base}}/dev
shell: bash
run: |
Expand Down Expand Up @@ -264,6 +266,7 @@ jobs:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
LEEWAY_REMOTE_CACHE_BUCKET: ${{needs.configuration.outputs.leeway_cache_bucket}}
IMAGE_REPO_BASE: ${{needs.configuration.outputs.image_repo_base}}/build
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true

# SCM tokens for integration tests
GITPOD_TEST_TOKEN_BITBUCKET: "${{ secrets.GITPOD_TEST_TOKEN_BITBUCKET }}"
Expand Down Expand Up @@ -519,7 +522,7 @@ jobs:
environment: main-build
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
if: needs.configuration.outputs.with_integration_tests != '' && needs.configuration.outputs.is_scheduled_run != 'true'
concurrency:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/code-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
steps:
- uses: actions/checkout@v4
Expand All @@ -26,6 +26,7 @@ jobs:
PR_DESC: "${{ steps.pr-details.outputs.pr_body }}"
MAIN_BRANCH: ${{ (github.head_ref || github.ref) == 'refs/heads/main' }}
LEEWAY_REMOTE_CACHE_BUCKET: ${{ github.ref == 'refs/heads/main' && 'leeway-cache-main-c514a01' || 'leeway-cache-dev-3ac8ef5' }}
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
run: |
export LEEWAY_WORKSPACE_ROOT=$GITHUB_WORKSPACE

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ide-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
name: Configuration
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
outputs:
name: ${{ steps.configuration.outputs.name }}
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
needs: [configuration, infrastructure]
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
volumes:
- /var/tmp:/var/tmp
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/jetbrains-auto-update-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
update-jetbrains:
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -47,6 +47,7 @@ jobs:
env:
LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: "8388608"
LEEWAY_REMOTE_CACHE_BUCKET: ${{ github.ref == 'refs/heads/main' && 'leeway-cache-main-c514a01' || 'leeway-cache-dev-3ac8ef5' }}
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
run: |
echo "May upgrade latest ${{ inputs.productId }} image with ${{ steps.find-target.outputs.editorSummary }}"
imageRepoBase=${{ github.ref == 'refs/heads/main' && 'eu.gcr.io/gitpod-core-dev/build' || 'eu.gcr.io/gitpod-dev-artifact/build' }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/jetbrains-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
jobs:
jetbrains-smoke-test-linux:
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -89,6 +89,7 @@ jobs:
DISPLAY: ":10"
LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: "8388608"
LEEWAY_REMOTE_CACHE_BUCKET: "${{ needs.configuration.outputs.leeway_cache_bucket }}"
LEEWAY_CACHE_UPLOAD_IMMEDIATE: true
TEST_USE_LATEST: ${{ inputs.use_latest }}
run: |
export GATEWAY_LINK=$(jq -r '.inputs.secret_gateway_link' $GITHUB_EVENT_PATH)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-env-check-regressions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
if: ${{ needs.configuration.outputs.skip == 'false' }}
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
volumes:
- /var/tmp:/var/tmp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-env-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
if: github.event.ref_type == 'branch' || github.event.inputs.name != ''
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-env-gc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: "Find stale preview environments"
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
outputs:
names: ${{ steps.set-matrix.outputs.names }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workspace-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
name: Configuration
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
outputs:
name: ${{ steps.configuration.outputs.name }}
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
needs: [configuration, infrastructure]
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
options: --user root
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:main-gha.34181
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:fix-skip-if-empty-env-vars-gha.29
workspaceLocation: gitpod/gitpod-ws.code-workspace
checkoutLocation: gitpod
ports:
Expand Down
26 changes: 13 additions & 13 deletions components/content-service/pkg/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestGitStatus(t *testing.T) {
&Status{
porcelainStatus: porcelainStatus{
BranchOID: "(initial)",
BranchHead: "master",
BranchHead: "main",
},
},
nil,
Expand All @@ -53,7 +53,7 @@ func TestGitStatus(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
},
LatestCommit: notEmpty,
Expand All @@ -73,7 +73,7 @@ func TestGitStatus(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
UntrackedFiles: []string{"another-file"},
},
Expand All @@ -94,7 +94,7 @@ func TestGitStatus(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
UncommitedFiles: []string{"first-file"},
},
Expand All @@ -118,7 +118,7 @@ func TestGitStatus(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
},
UnpushedCommits: []string{notEmpty},
Expand Down Expand Up @@ -170,7 +170,7 @@ func TestGitStatus(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
UntrackedFiles: []string{"this/is/a/nested/test/first-file"},
},
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestGitStatusFromFiles(t *testing.T) {
&Status{
porcelainStatus: porcelainStatus{
BranchOID: "(initial)",
BranchHead: "master",
BranchHead: "main",
},
},
nil,
Expand All @@ -262,7 +262,7 @@ func TestGitStatusFromFiles(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
},
LatestCommit: notEmpty,
Expand All @@ -282,7 +282,7 @@ func TestGitStatusFromFiles(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
UntrackedFiles: []string{"another-file"},
},
Expand All @@ -303,7 +303,7 @@ func TestGitStatusFromFiles(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
UncommitedFiles: []string{"first-file"},
},
Expand All @@ -327,7 +327,7 @@ func TestGitStatusFromFiles(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
},
UnpushedCommits: []string{notEmpty},
Expand Down Expand Up @@ -379,7 +379,7 @@ func TestGitStatusFromFiles(t *testing.T) {
},
&Status{
porcelainStatus: porcelainStatus{
BranchHead: "master",
BranchHead: "main",
BranchOID: notEmpty,
UntrackedFiles: []string{"this/is/a/nested/test/first-file"},
},
Expand Down Expand Up @@ -437,7 +437,7 @@ func TestGitStatusFromFiles(t *testing.T) {
}

gitout, err = client.GitWithOutput(ctx, &errNoCommitsYet, "log", "--pretty=%H", "-n", "1")
if err != nil && !strings.Contains(err.Error(), "fatal: your current branch 'master' does not have any commits yet") {
if err != nil && !strings.Contains(err.Error(), "fatal: your current branch 'main' does not have any commits yet") {
t.Errorf("error calling GitWithOutput: %v", err)
return
}
Expand Down
7 changes: 4 additions & 3 deletions components/gitpod-protocol/src/util/skip-if.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
*/

/**
* Skips a Mocha TestSuite if a certain env var is not set and prints its
* Skips a Mocha TestSuite if a certain env var is not set or empty
* @param name The name of the env var the TestSuite depends on being present
*/
export function ifEnvVarNotSet(name: string): boolean {
const skip = process.env[name] === undefined;
const value = process.env[name];
const skip = value === undefined || value === "";
if (skip) {
console.log(`Skipping suite because env var '${name}' is not set`);
console.log(`Skipping suite because env var '${name}' is not set or empty`);
}
return skip;
}
Loading
Loading