Skip to content

Commit 8d09704

Browse files
authored
Remove support for 'online' binary downloads (#8505)
1 parent 14592c4 commit 8d09704

20 files changed

+241
-2926
lines changed

.github/workflows/ci_linux.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ jobs:
2222
run: yarn install
2323
working-directory: Extension
2424

25-
- name: Generate hashes for runtime dependency packages
26-
run: yarn run generatePackageHashes
27-
working-directory: Extension
28-
2925
- name: Compile Sources
3026
run: yarn run compile
3127
working-directory: Extension
3228

33-
- name: Validate Extension/package.json
34-
run: yarn run pr-check
35-
working-directory: Extension
36-
3729
- name: Run Linter
3830
run: yarn run lint
3931
working-directory: Extension
@@ -48,8 +40,8 @@ jobs:
4840
run: yarn run unitTests
4941
working-directory: Extension
5042

51-
- name: Run languageServer integration tests
52-
uses: GabrielBB/[email protected]
53-
with:
54-
run: yarn run integrationTests
55-
working-directory: Extension
43+
# - name: Run languageServer integration tests
44+
# uses: GabrielBB/[email protected]
45+
# with:
46+
# run: yarn run integrationTests
47+
# working-directory: Extension

.github/workflows/ci_mac.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ jobs:
2222
run: yarn install --network-timeout 100000
2323
working-directory: Extension
2424

25-
- name: Generate hashes for runtime dependency packages
26-
run: yarn run generatePackageHashes
27-
working-directory: Extension
28-
2925
- name: Compile Sources
3026
run: yarn run compile
3127
working-directory: Extension
3228

33-
- name: Validate Extension/package.json
34-
run: yarn run pr-check
35-
working-directory: Extension
36-
3729
- name: Run Linter
3830
run: yarn run lint
3931
working-directory: Extension
@@ -48,8 +40,8 @@ jobs:
4840
run: yarn run unitTests
4941
working-directory: Extension
5042

51-
- name: Run languageServer integration tests
52-
uses: GabrielBB/[email protected]
53-
with:
54-
run: yarn run integrationTests
55-
working-directory: Extension
43+
# - name: Run languageServer integration tests
44+
# uses: GabrielBB/[email protected]
45+
# with:
46+
# run: yarn run integrationTests
47+
# working-directory: Extension

.github/workflows/ci_windows.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ jobs:
2222
run: yarn install
2323
working-directory: Extension
2424

25-
- name: Generate hashes for runtime dependency packages
26-
run: yarn run generatePackageHashes
27-
working-directory: Extension
28-
2925
- name: Compile Sources
3026
run: yarn run compile
3127
working-directory: Extension
3228

33-
- name: Validate Extension/package.json
34-
run: yarn run pr-check
35-
working-directory: Extension
36-
3729
- name: Run Linter
3830
run: yarn run lint
3931
working-directory: Extension
@@ -46,6 +38,6 @@ jobs:
4638
run: yarn run unitTests
4739
working-directory: Extension
4840

49-
- name: Run languageServer integration tests
50-
run: yarn run integrationTests
51-
working-directory: Extension
41+
# - name: Run languageServer integration tests
42+
# run: yarn run integrationTests
43+
# working-directory: Extension

Extension/gulpfile.js

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ gulp.task('lint', function () {
7171
.pipe(eslint.failAfterError());
7272
});
7373

74-
gulp.task('pr-check', (done) => {
75-
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString());
76-
if (packageJson.activationEvents.length !== 1 && packageJson.activationEvents[0] !== '*') {
77-
console.log('Please make sure to not check in package.json that has been rewritten by the extension activation. If you intended to have changes in package.json, please only check-in your changes. If you did not, please run `git checkout -- package.json`.');
78-
done();
79-
process.exit(1);
80-
}
81-
82-
done();
83-
});
84-
8574

8675
// ****************************
8776
// Command: translations-export
@@ -301,109 +290,6 @@ gulp.task("translations-import", (done) => {
301290
}));
302291
});
303292

304-
// ****************************
305-
// Command: generate-package-hashes
306-
// Generates a hash for each dependency package
307-
// ****************************
308-
309-
async function DownloadFile(urlString) {
310-
const buffers = [];
311-
return new Promise((resolve, reject) => {
312-
const req = https.request(urlString, (response) => {
313-
if (response.statusCode === 301 || response.statusCode === 302) {
314-
// Redirect - download from new location
315-
let redirectUrl;
316-
if (typeof response.headers.location === "string") {
317-
redirectUrl = response.headers.location;
318-
} else {
319-
if (!response.headers.location) {
320-
console.log(`Invalid download location received`);
321-
return reject();
322-
}
323-
redirectUrl = response.headers.location[0];
324-
}
325-
console.log(`Using redirectUrl: '${redirectUrl}'`);
326-
return resolve(DownloadFile(redirectUrl));
327-
} else if (response.statusCode !== 200) {
328-
if (response.statusCode === undefined || response.statusCode === null) {
329-
console.log("unknown error code.");
330-
return reject();
331-
}
332-
console.log(`failed with error code: '${response.statusCode}'`);
333-
return reject();
334-
}
335-
336-
response.on('data', (data) => {
337-
buffers.push(data);
338-
});
339-
340-
response.on('end', () => {
341-
if (buffers.length > 0) {
342-
return resolve(Buffer.concat(buffers));
343-
} else {
344-
return reject();
345-
}
346-
});
347-
348-
response.on('error', err => {
349-
console.log(`problem with request: '${err.message}'`);
350-
return reject();
351-
});
352-
});
353-
354-
req.on('error', err => {
355-
console.log(`problem with request: '${err.message}'`);
356-
return reject();
357-
});
358-
359-
// Execute the request
360-
req.end();
361-
});
362-
363-
}
364-
365-
async function generatePackageHashes(packageJson) {
366-
const downloadAndGetHash = async (url) => {
367-
console.log(url);
368-
try {
369-
const buf = await DownloadFile(url);
370-
if (buf) {
371-
const hash = crypto.createHash('sha256');
372-
hash.update(buf);
373-
const value = hash.digest('hex').toUpperCase();
374-
return value;
375-
}
376-
return undefined;
377-
} catch (err) {
378-
return undefined;
379-
}
380-
};
381-
382-
for (let dependency of packageJson.runtimeDependencies) {
383-
console.log(`-------- Downloading package: '${dependency.description}' --------`);
384-
const hash = await downloadAndGetHash(dependency.url);
385-
if (hash) {
386-
dependency.integrity = hash;
387-
console.log(`integrity: '${hash}'`);
388-
} else {
389-
console.log(`No hash generated for package '${dependency.description}`);
390-
}
391-
console.log(`\n`);
392-
}
393-
394-
let content = JSON.stringify(packageJson, null, 2);
395-
return content;
396-
}
397-
398-
gulp.task('generate-package-hashes', async (done) => {
399-
const packageJsonPath = './package.json';
400-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
401-
const content = await generatePackageHashes(packageJson);
402-
fs.writeFileSync(packageJsonPath, content);
403-
done();
404-
});
405-
406-
407293
// ****************************
408294
// Command: translations-generate
409295
// The following is used to import an i18n directory structure and generate files used at runtime.

0 commit comments

Comments
 (0)