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

Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 #7206

Merged
merged 3 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useTabs": true,
"printWidth": 120,
"semi": true,
"singleQuote": true
}
2 changes: 1 addition & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron"
target "4.2.9"
target "4.2.10"
runtime "electron"
2 changes: 1 addition & 1 deletion build/.cachesalt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019-07-11T05:47:05.444Z
2019-08-30T20:24:23.714Z
9 changes: 9 additions & 0 deletions build/azure-pipelines/common/publish-webview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
REPO="$(pwd)"

# Publish webview contents
PACKAGEJSON="$REPO/package.json"
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")

node build/azure-pipelines/common/publish-webview.js "$REPO/src/vs/workbench/contrib/webview/browser/pre/"
87 changes: 87 additions & 0 deletions build/azure-pipelines/common/publish-webview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as azure from 'azure-storage';
import * as mime from 'mime';
import * as minimist from 'minimist';
import { basename, join } from 'path';

const fileNames = [
'fake.html',
'host.js',
'index.html',
'main.js',
'service-worker.js'
];

async function assertContainer(blobService: azure.BlobService, container: string): Promise<void> {
await new Promise((c, e) => blobService.createContainerIfNotExists(container, { publicAccessLevel: 'blob' }, err => err ? e(err) : c()));
}

async function doesBlobExist(blobService: azure.BlobService, container: string, blobName: string): Promise<boolean | undefined> {
const existsResult = await new Promise<azure.BlobService.BlobResult>((c, e) => blobService.doesBlobExist(container, blobName, (err, r) => err ? e(err) : c(r)));
return existsResult.exists;
}

async function uploadBlob(blobService: azure.BlobService, container: string, blobName: string, file: string): Promise<void> {
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
contentSettings: {
contentType: mime.lookup(file),
cacheControl: 'max-age=31536000, public'
}
};

await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(container, blobName, file, blobOptions, err => err ? e(err) : c()));
}

async function publish(commit: string, files: readonly string[]): Promise<void> {

console.log('Publishing...');
console.log('Commit:', commit);
const storageAccount = process.env['AZURE_WEBVIEW_STORAGE_ACCOUNT']!;

const blobService = azure.createBlobService(storageAccount, process.env['AZURE_WEBVIEW_STORAGE_ACCESS_KEY']!)
.withFilter(new azure.ExponentialRetryPolicyFilter(20));

await assertContainer(blobService, commit);

for (const file of files) {
const blobName = basename(file);
const blobExists = await doesBlobExist(blobService, commit, blobName);
if (blobExists) {
console.log(`Blob ${commit}, ${blobName} already exists, not publishing again.`);
continue;
}
console.log('Uploading blob to Azure storage...');
await uploadBlob(blobService, commit, blobName, file);
}

console.log('Blobs successfully uploaded.');
}

function main(): void {
const commit = process.env['BUILD_SOURCEVERSION'];

if (!commit) {
console.warn('Skipping publish due to missing BUILD_SOURCEVERSION');
return;
}

const opts = minimist(process.argv.slice(2));
const [directory] = opts._;

const files = fileNames.map(fileName => join(directory, fileName));

publish(commit, files).catch(err => {
console.error(err);
process.exit(1);
});
}

if (process.argv.length < 3) {
console.error('Usage: node publish.js <directory>');
process.exit(-1);
}
main();
7 changes: 5 additions & 2 deletions build/azure-pipelines/darwin/continuous-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ steps:
vstsFeed: '$(ArtifactFeed)'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"
- script: |
yarn --frozen-lockfile
displayName: Install Dependencies
Expand All @@ -24,8 +24,11 @@ steps:
yarn gulp electron-x64
displayName: Download Electron
- script: |
yarn gulp hygiene
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn gulp tslint
displayName: Run TSLint Checks
- script: |
yarn monaco-compile-check
displayName: Run Monaco Editor Checks
Expand Down
28 changes: 18 additions & 10 deletions build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down Expand Up @@ -102,20 +102,28 @@ steps:
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
# to run with these builds instead of running out of sources.
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`"
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
./scripts/test-integration.sh --build --tfs "Integration Tests"
displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
set -e
cd test/smoke
yarn compile
cd -
yarn smoketest --web --headless
continueOnError: true
displayName: Run web smoke tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
# Web Smoke Tests disabled due to https://github.com/microsoft/vscode/issues/80308
# - script: |
# set -e
# cd test/smoke
# yarn compile
# cd -
# yarn smoketest --web --headless
# continueOnError: true
# displayName: Run web smoke tests
# condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
set -e
Expand Down
17 changes: 7 additions & 10 deletions build/azure-pipelines/exploration-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
pool:
vmImage: 'Ubuntu-16.04'

trigger:
branches:
include: ['master']
pr:
branches:
include: ['master']

steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -31,13 +38,3 @@ steps:
git push origin HEAD:electron-6.0.x

displayName: Sync & Merge Exploration

trigger: none
pr: none

schedules:
- cron: "0 5 * * Mon-Fri"
displayName: Mon-Fri at 7:00
branches:
include:
- master
7 changes: 5 additions & 2 deletions build/azure-pipelines/linux/continuous-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
vstsFeed: '$(ArtifactFeed)'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"
- script: |
yarn --frozen-lockfile
displayName: Install Dependencies
Expand All @@ -32,8 +32,11 @@ steps:
yarn gulp electron-x64
displayName: Download Electron
- script: |
yarn gulp hygiene
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks
- script: |
yarn gulp tslint
displayName: Run TSLint Checks
- script: |
yarn monaco-compile-check
displayName: Run Monaco Editor Checks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down
9 changes: 8 additions & 1 deletion build/azure-pipelines/linux/product-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down Expand Up @@ -105,7 +105,14 @@ steps:
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
# to run with these builds instead of running out of sources.
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests"
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-x64"
displayName: Run integration tests
Expand Down
4 changes: 2 additions & 2 deletions build/azure-pipelines/linux/snap-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down Expand Up @@ -51,4 +51,4 @@ steps:
# Publish snap package
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-x64" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-x64" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
4 changes: 2 additions & 2 deletions build/azure-pipelines/product-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- template: linux/snap-build-linux.yml

- job: LinuxArmhf
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true'), ne(variables['VSCODE_QUALITY'], 'stable'))
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true'))
pool:
vmImage: 'Ubuntu-16.04'
variables:
Expand All @@ -78,7 +78,7 @@ jobs:
- template: linux/product-build-linux-multiarch.yml

- job: LinuxAlpine
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true'), ne(variables['VSCODE_QUALITY'], 'stable'))
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true'))
pool:
vmImage: 'Ubuntu-16.04'
variables:
Expand Down
14 changes: 11 additions & 3 deletions build/azure-pipelines/product-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

- task: AzureKeyVault@1
Expand Down Expand Up @@ -87,9 +87,10 @@ steps:

- script: |
set -e
yarn gulp hygiene
yarn gulp hygiene --skip-tslint
yarn gulp tslint
yarn monaco-compile-check
displayName: Run hygiene checks
displayName: Run hygiene, tslint and monaco compile checks
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
Expand All @@ -98,6 +99,13 @@ steps:
displayName: Extract Telemetry
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

- script: |
set -e
AZURE_WEBVIEW_STORAGE_ACCESS_KEY="$(vscode-webview-storage-key)" \
./build/azure-pipelines/common/publish-webview.sh
displayName: Publish Webview
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

- script: |
set -e
yarn gulp compile-build
Expand Down
18 changes: 17 additions & 1 deletion build/azure-pipelines/publish-types/publish-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,23 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
CHANNEL="G1C14HJ2F"

if [ "$TAG_VERSION" == "1.999.0" ]; then
MESSAGE="<!here>. Someone pushed 1.999.0 tag. Please delete it ASAP from remote and local."

curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
-H 'Content-type: application/json; charset=utf-8' \
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE"'"}' \
https://slack.com/api/chat.postMessage

exit 1
fi
displayName: Check 1.999.0 tag

- bash: |
# Install build dependencies
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/sync-mooncake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down
2 changes: 1 addition & 1 deletion build/azure-pipelines/web/product-build-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
inputs:
versionSpec: "1.10.1"
versionSpec: "1.x"

- task: AzureKeyVault@1
displayName: 'Azure Key Vault: Get Secrets'
Expand Down
Loading