Skip to content

Commit

Permalink
Merge branch 'master' into pr/89313
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Nov 4, 2020
2 parents e51cc0e + 4cd46e3 commit 0382313
Show file tree
Hide file tree
Showing 1,055 changed files with 26,661 additions and 12,274 deletions.
10 changes: 6 additions & 4 deletions .devcontainer/README.md
Expand Up @@ -18,9 +18,9 @@ This repository includes configuration for a development container for working w

> Note that the Remote - Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details.
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and select **Remote - Containers: Open Repository in Container...**.
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and select **Remote-Containers: Clone Repository in Container Volume...**.

> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or using the Hyper-V engine on Windows. We recommend the "open repository" approach instead since it uses "named volume" rather than the local filesystem.
> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or using the Hyper-V engine on Windows. We recommend the "clone repository in container" approach instead since it uses "named volume" rather than the local filesystem.
5. Type `https://github.com/microsoft/vscode` (or a branch or PR URL) in the input box and press <kbd>Enter</kbd>.

Expand All @@ -32,7 +32,7 @@ Next: **[Try it out!](#try-it)**

## Quick start - GitHub Codespaces

> **IMPORTANT:** The current user beta for GitHub Codespaces uses a "Basic" sized codespace which is too small to run a full build of VS Code. You'll soon be able to use a "Standard" sized codespace (4-core, 8GB) that will be better suited for this purpose.
> **IMPORTANT:** The current free user beta for GitHub Codespaces uses a "Basic" sized codespace which does not have enough RAM to run a full build of VS Code and will be considerably slower during codespace start and running VS Code. You'll soon be able to use a "Standard" sized codespace (4-core, 8GB) that will be better suited for this purpose (along with even larger sizes should you need it).
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and the **New codespace**

Expand Down Expand Up @@ -81,7 +81,9 @@ To start working with Code - OSS, follow these steps:
bash scripts/code.sh
```

2. After the build is complete, open a web browser and go to [http://localhost:6080](http://localhost:6080) or use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
Note that a previous run of `yarn install` will already be cached, so this step should simply pick up any recent differences.

2. After the build is complete, open a web browser or a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to the desktop environnement as described in the quick start and enter `vscode` as the password.

3. You should now see Code - OSS!

Expand Down
1 change: 1 addition & 0 deletions .devcontainer/cache/.gitignore
@@ -0,0 +1 @@
*.manifest
15 changes: 15 additions & 0 deletions .devcontainer/cache/before-cache.sh
@@ -0,0 +1,15 @@
#!/bin/bash

# This file establishes a basline for the reposuitory before any steps in the "prepare.sh"
# are run. Its just a find command that filters out a few things we don't need to watch.

set -e

SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)"
SOURCE_FOLDER="${1:-"."}"

cd "${SOURCE_FOLDER}"
echo "[$(date)] Generating ""before"" manifest..."
find -L . -not -path "*/.git/*" -and -not -path "${SCRIPT_PATH}/*.manifest" -type f > "${SCRIPT_PATH}/before.manifest"
echo "[$(date)] Done!"

28 changes: 28 additions & 0 deletions .devcontainer/cache/build-cache-image.sh
@@ -0,0 +1,28 @@
#!/bin/bash

# This file simply wraps the dockeer build command used to build the image with the
# cached result of the commands from "prepare.sh" and pushes it to the specified
# container image registry.

set -e

SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)"
CONTAINER_IMAGE_REPOSITORY="$1"
BRANCH="${2:-"master"}"

if [ "${CONTAINER_IMAGE_REPOSITORY}" = "" ]; then
echo "Container repository not specified!"
exit 1
fi

TAG="branch-${BRANCH//\//-}"
echo "[$(date)] ${BRANCH} => ${TAG}"
cd "${SCRIPT_PATH}/../.."

echo "[$(date)] Starting image build..."
docker build -t ${CONTAINER_IMAGE_REPOSITORY}:"${TAG}" -f "${SCRIPT_PATH}/cache.Dockerfile" .
echo "[$(date)] Image build complete."

echo "[$(date)] Pushing image..."
docker push ${CONTAINER_IMAGE_REPOSITORY}:"${TAG}"
echo "[$(date)] Done!"
21 changes: 21 additions & 0 deletions .devcontainer/cache/cache-diff.sh
@@ -0,0 +1,21 @@
#!/bin/bash

# This file is used to archive off a copy of any differences in the source tree into another location
# in the image. Once the codespace is up, this will be restored into its proper location (which is
# quick and happens parallel to other startup activities)

set -e

SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)"
SOURCE_FOLDER="${1:-"."}"
CACHE_FOLDER="${2:-"/usr/local/etc/devcontainer-cache"}"

echo "[$(date)] Starting cache operation..."
cd "${SOURCE_FOLDER}"
echo "[$(date)] Determining diffs..."
find -L . -not -path "*/.git/*" -and -not -path "${SCRIPT_PATH}/*.manifest" -type f > "${SCRIPT_PATH}/after.manifest"
grep -Fxvf "${SCRIPT_PATH}/before.manifest" "${SCRIPT_PATH}/after.manifest" > "${SCRIPT_PATH}/cache.manifest"
echo "[$(date)] Archiving diffs..."
mkdir -p "${CACHE_FOLDER}"
tar -cf "${CACHE_FOLDER}/cache.tar" --totals --files-from "${SCRIPT_PATH}/cache.manifest"
echo "[$(date)] Done! $(du -h "${CACHE_FOLDER}/cache.tar")"
14 changes: 14 additions & 0 deletions .devcontainer/cache/cache.Dockerfile
@@ -0,0 +1,14 @@
# This dockerfile is used to build up from a base image to create an image with cached results of running "prepare.sh".
# Other image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:dev

ARG USERNAME=node
COPY --chown=${USERNAME}:${USERNAME} . /repo-source-tmp/
RUN mkdir /usr/local/etc/devcontainer-cache \
&& chown ${USERNAME} /usr/local/etc/devcontainer-cache /repo-source-tmp \
&& su ${USERNAME} -c "\
cd /repo-source-tmp \
&& .devcontainer/cache/before-cache.sh \
&& .devcontainer/prepare.sh \
&& .devcontainer/cache/cache-diff.sh" \
&& rm -rf /repo-source-tmp
23 changes: 23 additions & 0 deletions .devcontainer/cache/restore-diff.sh
@@ -0,0 +1,23 @@
#!/bin/bash

# This file restores the results of the "prepare.sh" into their proper locations
# once the container has been created. It runs as a postCreateCommand which
# in GitHub Codespaces occurs parallel to other startup activities and does not
# really add to the overal startup time given how quick the operation ends up being.

set -e

SOURCE_FOLDER="$(cd "${1:-"."}" && pwd)"
CACHE_FOLDER="${2:-"/usr/local/etc/devcontainer-cache"}"

if [ ! -d "${CACHE_FOLDER}" ]; then
echo "No cache folder found."
exit 0
fi

echo "[$(date)] Expanding $(du -h "${CACHE_FOLDER}/cache.tar") file to ${SOURCE_FOLDER}..."
cd "${SOURCE_FOLDER}"
tar -xf "${CACHE_FOLDER}/cache.tar"
rm -f "${CACHE_FOLDER}/cache.tar"
echo "[$(date)] Done!"

11 changes: 6 additions & 5 deletions .devcontainer/devcontainer.json
Expand Up @@ -2,7 +2,7 @@
"name": "Code - OSS",

// Image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile
"image": "mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:dev",
"image": "mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:branch-master",

"workspaceMount": "source=${localWorkspaceFolder},target=/home/node/workspace/vscode,type=bind,consistency=cached",
"workspaceFolder": "/home/node/workspace/vscode",
Expand All @@ -15,15 +15,16 @@
"resmon.show.cpufreq": false
},

// noVNC, VNC ports, debug
// noVNC, VNC, debug ports
"forwardPorts": [6080, 5901, 9222],

"extensions": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"mutantdino.resourcemonitor",
"GitHub.vscode-pull-request-github"
"mutantdino.resourcemonitor"
],

// Optionally loads a cached yarn install for the repo
"postCreateCommand": ".devcontainer/cache/restore-diff.sh",

"remoteUser": "node"
}
10 changes: 10 additions & 0 deletions .devcontainer/prepare.sh
@@ -0,0 +1,10 @@
#!/bin/bash

# This file contains the steps that should be run when creating the intermediary image that contains
# contents for that should be in the image by default. It will be used to build up from the base image
# to create an image that speeds up first time use of the dev container by "caching" the results
# of these commands. Developers can still run these commands without an issue once the container is
# up, but only differences will be processed which also speeds up the first time these operations occur.

yarn install
yarn electron
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -5,6 +5,7 @@
**/vs/loader.js
**/insane/**
**/marked/**
**/semver/**
**/test/**/*.js
**/node_modules/**
**/vscode-api-tests/testWorkspace/**
Expand Down
11 changes: 3 additions & 8 deletions .eslintrc.json
Expand Up @@ -7,7 +7,8 @@
},
"plugins": [
"@typescript-eslint",
"jsdoc"
"jsdoc",
"mocha"
],
"rules": {
"constructor-super": "warn",
Expand Down Expand Up @@ -41,6 +42,7 @@
"no-var": "warn",
"jsdoc/no-types": "warn",
"semi": "off",
"mocha/no-exclusive-tests": "warn",
"@typescript-eslint/semi": "warn",
"@typescript-eslint/naming-convention": [
"warn",
Expand Down Expand Up @@ -521,7 +523,6 @@
"vscode-textmate",
"vscode-oniguruma",
"iconv-lite-umd",
"semver-umd",
"tas-client-umd",
"jschardet"
]
Expand Down Expand Up @@ -554,7 +555,6 @@
"vscode-textmate",
"vscode-oniguruma",
"iconv-lite-umd",
"semver-umd",
"jschardet"
]
},
Expand Down Expand Up @@ -585,7 +585,6 @@
"vscode-textmate",
"vscode-oniguruma",
"iconv-lite-umd",
"semver-umd",
"jschardet"
]
},
Expand Down Expand Up @@ -638,7 +637,6 @@
{
"target": "**/vs/workbench/contrib/extensions/browser/**",
"restrictions": [
"semver-umd",
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser}/**",
Expand All @@ -652,7 +650,6 @@
{
"target": "**/vs/workbench/contrib/update/browser/update.ts",
"restrictions": [
"semver-umd",
"vs/nls",
"vs/css!./**/*",
"**/vs/base/**/{common,browser}/**",
Expand Down Expand Up @@ -706,7 +703,6 @@
"vscode-textmate",
"vscode-oniguruma",
"iconv-lite-umd",
"semver-umd",
"jschardet"
]
},
Expand Down Expand Up @@ -740,7 +736,6 @@
"vscode-textmate",
"vscode-oniguruma",
"iconv-lite-umd",
"semver-umd",
"jschardet"
]
},
Expand Down
6 changes: 3 additions & 3 deletions .github/classifier.json
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vscode-github-triage-actions/master/classifier-deep/apply/apply-labels/deep-classifier-config.schema.json",
"vacation": ["joaomoreno"],
"vacation": [],
"assignees": {
"JacksonKearl": {"accuracy": 0.5}
},
Expand All @@ -20,8 +20,8 @@
"context-keys": {"assign": []},
"css-less-scss": {"assign": ["aeschli"]},
"custom-editors": {"assign": ["mjbvz"]},
"debug": {"assign": ["isidorn"]},
"debug-console": {"assign": ["isidorn"]},
"debug": {"assign": ["weinand"]},
"debug-console": {"assign": ["weinand"]},
"dialogs": {"assign": ["sbatten"]},
"diff-editor": {"assign": []},
"dropdown": {"assign": []},
Expand Down
10 changes: 6 additions & 4 deletions .github/subscribers.json
@@ -1,7 +1,9 @@
{
"label-to-subscribe-to": [
"list of usernames to subscribe",
"such as:",
"JacksonKearl"
"notebook": [
"claudiaregio",
"rchiodo",
"greazer",
"donjayamanne",
"jilljac"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/author-verified.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: v36
ref: v39
path: ./actions
- name: Install Actions
if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'author-verification-requested')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commands.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
with:
repository: 'microsoft/vscode-github-triage-actions'
path: ./actions
ref: v36
ref: v39
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run Commands
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deep-classifier-monitor.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: v36
ref: v39
path: ./actions
- name: Install Actions
run: npm install --production --prefix ./actions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deep-classifier-runner.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: v36
ref: v39
path: ./actions
- name: Install Actions
run: npm install --production --prefix ./actions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deep-classifier-scraper.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: v36
ref: v39
path: ./actions
- name: Install Actions
run: npm install --production --prefix ./actions
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/devcontainer-cache.yml
@@ -0,0 +1,41 @@
name: VS Code Repo Dev Container Cache Image Generation

on:
push:
# Currently doing this for master, but could be done for PRs as well
branches:
- 'master'

# Only updates to these files result in changes to installed packages, so skip otherwise
paths:
- '**/package-lock.json'
- '**/yarn.lock'

jobs:
devcontainer:
name: Generate cache image
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2

- name: Azure CLI login
id: az_login
uses: azure/login@v1
with:
creds: ${{ secrets.AZ_ACR_CREDS }}

- name: Build and push
id: build_and_push
run: |
set -e
ACR_REGISTRY_NAME=$(echo ${{ secrets.CONTAINER_IMAGE_REGISTRY }} | grep -oP '(.+)(?=\.azurecr\.io)')
az acr login --name $ACR_REGISTRY_NAME
GIT_BRANCH=$(echo "${{ github.ref }}" | grep -oP 'refs/(heads|tags)/\K(.+)')
if [ "$GIT_BRANCH" == "" ]; then GIT_BRANCH=master; fi
.devcontainer/cache/build-cache-image.sh "${{ secrets.CONTAINER_IMAGE_REGISTRY }}/public/vscode/devcontainers/repos/microsoft/vscode" "${GIT_BRANCH}"
2 changes: 1 addition & 1 deletion .github/workflows/english-please.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: 'microsoft/vscode-github-triage-actions'
ref: v36
ref: v39
path: ./actions
- name: Install Actions
if: contains(github.event.issue.labels.*.name, '*english-please')
Expand Down

0 comments on commit 0382313

Please sign in to comment.