Skip to content
Open
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
6 changes: 0 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
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.22

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.22

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.22

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
6 changes: 3 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.22
options: --user root
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -180,7 +180,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.22
options: --user root
env:
DB_HOST: "mysql"
Expand Down Expand Up @@ -516,7 +516,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.22
options: --user root
if: needs.configuration.outputs.with_integration_tests != '' && needs.configuration.outputs.is_scheduled_run != 'true'
concurrency:
Expand Down
6 changes: 3 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.22
options: --user root
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -183,7 +183,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.22
options: --user root
env:
DB_HOST: "mysql"
Expand Down Expand Up @@ -519,7 +519,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.22
options: --user root
if: needs.configuration.outputs.with_integration_tests != '' && needs.configuration.outputs.is_scheduled_run != 'true'
concurrency:
Expand Down
2 changes: 1 addition & 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.22
options: --user root
steps:
- uses: actions/checkout@v4
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.22
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.22
options: --user root
volumes:
- /var/tmp:/var/tmp
Expand Down
2 changes: 1 addition & 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.22
options: --user root
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 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.22
options: --user root
runs-on: ubuntu-latest
steps:
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.22
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.22
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.22
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.22
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.22
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.22
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;
}
6 changes: 0 additions & 6 deletions dev/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ RUN bash -c ". .nvm/nvm.sh \
&& nvm install $GITPOD_NODE_VERSION"
ENV PATH=/home/gitpod/.nvm/versions/node/v${GITPOD_NODE_VERSION}/bin:$PATH

# 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)
RUN sudo rm -f /usr/bin/npx /usr/local/bin/npx /home/gitpod/.nvm/versions/node/v${GITPOD_NODE_VERSION}/bin/npx && \
echo '#!/bin/sh' | sudo tee /usr/local/bin/npx > /dev/null && \
Expand Down
Loading