Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79200f7

Browse files
author
Eclipse Che Sync
committed
Rebase against the upstream b782ae6
vscode-upstream-sha1: b782ae6
2 parents 813fb8a + b782ae6 commit 79200f7

21 files changed

Lines changed: 1056 additions & 246 deletions

File tree

code/.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@
526526
"name": "Monaco Editor Playground",
527527
"type": "chrome",
528528
"request": "launch",
529-
"url": "https://microsoft.github.io/monaco-editor/playground.html?source=http%3A%2F%2Flocalhost%3A5001%2Fout%2Fvs",
529+
"url": "http://localhost:5001",
530530
"preLaunchTask": "Launch Http Server",
531531
"presentation": {
532532
"group": "monaco",

code/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@
125125
],
126126
"application.experimental.rendererProfiling": true,
127127
"editor.experimental.asyncTokenization": true,
128-
"diffEditor.diffAlgorithm": "experimental"
128+
"editor.experimental.asyncTokenizationVerification": true,
129129
}

code/.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
// Used for monaco editor playground launch config
261261
"label": "Launch Http Server",
262262
"type": "shell",
263-
"command": "node_modules/.bin/http-server --cors --port 5001 -a 127.0.0.1 -c-1 -s",
263+
"command": "node_modules/.bin/ts-node -T ./scripts/playground-server",
264264
"isBackground": true,
265265
"problemMatcher": {
266266
"pattern": {

code/build/azure-pipelines/win32/product-build-win32.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,28 @@ steps:
8282
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
8383
displayName: Setup NPM Authentication
8484

85+
- powershell: |
86+
mkdir -Force .build/node-gyp
87+
displayName: Create custom node-gyp directory
88+
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
89+
90+
- powershell: |
91+
. ../../build/azure-pipelines/win32/exec.ps1
92+
$ErrorActionPreference = "Stop"
93+
# TODO: Should be replaced with upstream URL once https://github.com/nodejs/node-gyp/pull/2825
94+
# gets merged.
95+
exec { git clone https://github.com/rzhao271/node-gyp.git . } "Cloning rzhao271/node-gyp failed"
96+
exec { git checkout 102b347da0c92c29f9c67df22e864e70249cf086 } "Checking out 102b347 failed"
97+
exec { npm install } "Building rzhao271/node-gyp failed"
98+
displayName: Install custom node-gyp
99+
workingDirectory: .build/node-gyp
100+
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
101+
85102
- powershell: |
86103
. build/azure-pipelines/win32/exec.ps1
87104
. build/azure-pipelines/win32/retry.ps1
88105
$ErrorActionPreference = "Stop"
106+
$env:npm_config_node_gyp="$(Join-Path $pwd.Path '.build/node-gyp/bin/node-gyp.js')"
89107
$env:npm_config_arch="$(VSCODE_ARCH)"
90108
$env:CHILD_CONCURRENCY="1"
91109
retry { exec { yarn --frozen-lockfile --check-files } }

code/extensions/github/src/branchProtection.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ export class GithubBranchProtectionProvider implements BranchProtectionProvider
8585
await this.updateBranchProtection();
8686
}
8787

88+
private async checkPushPermission(repository: { owner: string; repo: string }): Promise<boolean> {
89+
try {
90+
const octokit = await getOctokit();
91+
const response = await octokit.repos.get({ ...repository });
92+
93+
return response.data.permissions?.push === true;
94+
} catch {
95+
// todo@lszomoru - add logging
96+
return false;
97+
}
98+
}
99+
88100
private async updateHEADBranchProtection(): Promise<void> {
89101
try {
90102
const HEAD = this.repository.state.HEAD;
@@ -106,6 +118,10 @@ export class GithubBranchProtectionProvider implements BranchProtectionProvider
106118
return;
107119
}
108120

121+
if (!(await this.checkPushPermission(repository))) {
122+
return;
123+
}
124+
109125
const octokit = await getOctokit();
110126
const response = await octokit.repos.getBranch({ ...repository, branch: HEAD.name });
111127

@@ -131,6 +147,10 @@ export class GithubBranchProtectionProvider implements BranchProtectionProvider
131147
continue;
132148
}
133149

150+
if (!(await this.checkPushPermission(repository))) {
151+
continue;
152+
}
153+
134154
const octokit = await getOctokit();
135155

136156
let page = 1;

code/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@
171171
"gulp-sourcemaps": "^3.0.0",
172172
"gulp-svgmin": "^4.1.0",
173173
"gulp-untar": "^0.0.7",
174-
"http-server": "^14.1.1",
175174
"husky": "^0.13.1",
176175
"innosetup": "6.0.5",
177176
"is": "^3.1.0",

0 commit comments

Comments
 (0)