Skip to content

Commit

Permalink
fix crypto handling (#11249) (#11252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Silvester committed Oct 7, 2021
1 parent 1886ef4 commit c6dc40f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/linuxtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
name: Linux
strategy:
matrix:
group: [integrity, integrity2, integrity3, release_check, docs, usage, usage2, splice_source, python, examples, interop, nonode, linkcheck, lint]
group: [integrity, integrity2, integrity3, release_test, docs, usage, usage2, splice_source, python, examples, interop, nonode, linkcheck, lint]
python: [3.6, 3.8]
include:
- group: release_check
- group: release_test
upload-output: true
exclude:
- group: integrity
Expand All @@ -25,7 +25,7 @@ jobs:
python: 3.6
- group: integrity3
python: 3.6
- group: release_check
- group: release_test
python: 3.6
- group: docs
python: 3.6
Expand Down
3 changes: 2 additions & 1 deletion builder/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export namespace Build {
output: {
path: path.resolve(path.join(themeOutput, 'themes', name)),
// we won't use these JS files, only the extracted CSS
filename: '[name].js'
filename: '[name].js',
hashFunction: 'sha256'
},
module: {
rules: [
Expand Down
6 changes: 6 additions & 0 deletions builder/src/webpack.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import * as path from 'path';
import * as webpack from 'webpack';
import crypto from 'crypto';

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = (algorithm: string) =>
cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm);

const rules = [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
Expand Down
2 changes: 1 addition & 1 deletion buildutils/src/ensure-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const URL_CONFIG = {
const MISSING: Dict<string[]> = {
'@jupyterlab/coreutils': ['path'],
'@jupyterlab/buildutils': ['path', 'webpack'],
'@jupyterlab/builder': ['path'],
'@jupyterlab/builder': ['path', 'crypto'],
'@jupyterlab/testutils': ['fs', 'path'],
'@jupyterlab/vega5-extension': ['vega-embed']
};
Expand Down
2 changes: 1 addition & 1 deletion dev_mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "BSD-3-Clause",
"scripts": {
"build": "npm run clean && webpack",
"build": "cat package.json && npm run clean && webpack",
"build:dev": "npm run build",
"build:prod": "webpack --config webpack.prod.config.js",
"build:prod:minimize": "webpack --config webpack.prod.minimize.config.js",
Expand Down
5 changes: 5 additions & 0 deletions scripts/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ fi
# create jupyter base dir (needed for config retrieval)
mkdir ~/.jupyter

# Set up git config
git config --global user.name foo
git config --global user.email foo@bar.com

# Install and enable the server extension
pip install -q --upgrade pip --user
pip --version
Expand All @@ -29,6 +33,7 @@ jupyter serverextension list 1>serverextensions 2>&1
cat serverextensions
cat serverextensions | grep -i "jupyterlab.*enabled"
cat serverextensions | grep -i "jupyterlab.*OK"
rm serverextensions

if [[ $GROUP == integrity ]]; then
pip install notebook==4.3.1
Expand Down
19 changes: 10 additions & 9 deletions scripts/ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,19 @@ if [[ $GROUP == integrity3 ]]; then
fi


if [[ $GROUP == release_check ]]; then
jlpm run publish:js --dry-run
jlpm run prepare:python-release
./scripts/release_test.sh
if [[ $GROUP == release_test ]]; then
# bump the version
git checkout -b test HEAD
jlpm bumpversion next --force

# Prep for using verdaccio during publish
# Use verdaccio during publish
node buildutils/lib/local-repository.js start
npm whoami
pushd packages/application
npm version patch
npm publish
popd

jlpm run publish:js --yes
jlpm run prepare:python-release
cat jupyterlab/staging/package.json
./scripts/release_test.sh
node buildutils/lib/local-repository.js stop
fi

Expand Down
18 changes: 9 additions & 9 deletions scripts/release_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ conda activate "$JLAB_TEST_ENV"
python -m pip install $(ls dist/*.whl)

cp examples/notebooks/*.ipynb $TEST_DIR/
cp -r jupyterlab/tests/mock_packages $TEST_DIR

pushd $TEST_DIR

JLAB_BROWSER_CHECK_OUTPUT=${OUTPUT_DIR} python -m jupyterlab.browser_check

popd
ls -ltr

pushd jupyterlab/tests/mock_packages
jupyter labextension install mimeextension --no-build --debug
jupyter labextension develop extension
jupyter labextension build extension
popd
JLAB_BROWSER_CHECK_OUTPUT=${OUTPUT_DIR} python -m jupyterlab.browser_check

pushd $TEST_DIR
# Remove node_modules to get a clean directory and build the extensions
rm -rf ./mock_packages/mimeextension/node_modules
rm -rf ./mock_packages/extension/node_modules
jupyter labextension install ./mock_packages/mimeextension --no-build --debug
jupyter labextension develop ./mock_packages/extension --debug
jupyter labextension build ./mock_packages/extension --debug

conda install --override-channels --strict-channel-priority -c conda-forge -c nodefaults -y ipywidgets altair matplotlib-base vega_datasets jupyterlab_widgets

Expand Down

0 comments on commit c6dc40f

Please sign in to comment.