Skip to content

Commit 4fde52e

Browse files
committed
Initial commit for open-source release
0 parents  commit 4fde52e

File tree

114 files changed

+24387
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+24387
-0
lines changed

.copier-answers.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v4.2.5
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: unianalytics.jupyterlab@hotmail.com
5+
author_name: Uni Analytics
6+
data_format: string
7+
file_extension: ''
8+
has_binder: true
9+
has_settings: true
10+
kind: server
11+
labextension_name: jupyterlab_unianalytics_dashboard
12+
mimetype: ''
13+
mimetype_name: ''
14+
project_short_description: A JupyterLab dashboard extension to visualize data from
15+
students.
16+
python_name: jupyterlab_unianalytics_dashboard
17+
repository: https://github.com/chili-epfl/jupyter-analytics-dashboard
18+
test: true
19+
viewer_name: ''
20+

.github/workflows/binder-on-pr.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Binder Badge
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
binder:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
13+
with:
14+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build.yml

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: '*'
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Base Setup
22+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
23+
24+
- name: Install dependencies
25+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
26+
27+
- name: Lint the extension
28+
run: |
29+
set -eux
30+
jlpm
31+
jlpm run lint:check
32+
33+
- name: Test the extension
34+
run: |
35+
set -eux
36+
jlpm run test
37+
38+
- name: Build the extension
39+
run: |
40+
set -eux
41+
python -m pip install .[test]
42+
43+
pytest -vv -r ap --cov jupyterlab_unianalytics_dashboard
44+
jupyter server extension list
45+
jupyter server extension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK"
46+
47+
jupyter labextension list
48+
jupyter labextension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK"
49+
python -m jupyterlab.browser_check
50+
51+
- name: Package the extension
52+
run: |
53+
set -eux
54+
55+
pip install build
56+
python -m build
57+
pip uninstall -y "jupyterlab_unianalytics_dashboard" jupyterlab
58+
59+
- name: Upload extension packages
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: extension-artifacts
63+
path: dist/jupyterlab_unianalytics_dashboard*
64+
if-no-files-found: error
65+
66+
test_isolated:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- name: Install Python
72+
uses: actions/setup-python@v4
73+
with:
74+
python-version: '3.9'
75+
architecture: 'x64'
76+
- uses: actions/download-artifact@v4
77+
with:
78+
name: extension-artifacts
79+
- name: Install and Test
80+
run: |
81+
set -eux
82+
# Remove NodeJS, twice to take care of system and locally installed node versions.
83+
sudo rm -rf $(which node)
84+
sudo rm -rf $(which node)
85+
86+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_unianalytics_dashboard*.whl
87+
88+
89+
jupyter server extension list
90+
jupyter server extension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK"
91+
92+
jupyter labextension list
93+
jupyter labextension list 2>&1 | grep -ie "jupyterlab_unianalytics_dashboard.*OK"
94+
python -m jupyterlab.browser_check --no-browser-test
95+
96+
integration-tests:
97+
name: Integration tests
98+
needs: build
99+
runs-on: ubuntu-latest
100+
101+
env:
102+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
103+
104+
steps:
105+
- name: Checkout
106+
uses: actions/checkout@v3
107+
108+
- name: Base Setup
109+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
110+
111+
- name: Download extension package
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: extension-artifacts
115+
116+
- name: Install the extension
117+
run: |
118+
set -eux
119+
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_unianalytics_dashboard*.whl
120+
121+
- name: Install dependencies
122+
working-directory: ui-tests
123+
env:
124+
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
125+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
126+
run: jlpm install
127+
128+
- name: Set up browser cache
129+
uses: actions/cache@v3
130+
with:
131+
path: |
132+
${{ github.workspace }}/pw-browsers
133+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
134+
135+
- name: Install browser
136+
run: jlpm playwright install chromium
137+
working-directory: ui-tests
138+
139+
- name: Execute integration tests
140+
working-directory: ui-tests
141+
run: |
142+
jlpm playwright test
143+
144+
- name: Upload Playwright Test report
145+
if: always()
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: jupyterlab_unianalytics_dashboard-playwright-tests
149+
path: |
150+
ui-tests/test-results
151+
ui-tests/playwright-report
152+
153+
# check_links:
154+
# name: Check Links
155+
# runs-on: ubuntu-latest
156+
# timeout-minutes: 15
157+
# steps:
158+
# - uses: actions/checkout@v3
159+
# - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
160+
# - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check_release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
- name: Base Setup
19+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
- name: Check Release
21+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
22+
with:
23+
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Upload Distributions
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: jupyterlab_unianalytics_dashboard-releaser-dist-${{ github.run_number }}
30+
path: .jupyter_releaser_checkout/dist

.github/workflows/enforce-label.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- name: enforce-triage-label
13+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/prep-release.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
# silent:
16+
# description: "Set a placeholder in the changelog and don't publish the release."
17+
# required: false
18+
# type: boolean
19+
since:
20+
description: "Use PRs with activity since this date or git reference"
21+
required: false
22+
since_last_stable:
23+
description: "Use PRs with activity since the last stable git tag"
24+
required: false
25+
type: boolean
26+
jobs:
27+
prep_release:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
31+
32+
- name: Prep Release
33+
id: prep-release
34+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
35+
with:
36+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
37+
version_spec: ${{ github.event.inputs.version_spec }}
38+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
39+
branch: ${{ github.event.inputs.branch }}
40+
# silent: ${{ github.event.inputs.silent }}
41+
since: ${{ github.event.inputs.since }}
42+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
43+
44+
- name: "** Next Step **"
45+
run: |
46+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

.github/workflows/publish-release.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'Step 2: Publish Release'
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: 'The target branch'
7+
required: false
8+
release_url:
9+
description: 'The URL of the draft GitHub release'
10+
required: false
11+
steps_to_skip:
12+
description: 'Comma separated list of steps to skip'
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
# permissions:
19+
# # This is useful if you want to use PyPI trusted publisher
20+
# # and NPM provenance
21+
# id-token: write
22+
steps:
23+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
24+
25+
- name: Populate Release
26+
id: populate-release
27+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
28+
with:
29+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
30+
branch: ${{ github.event.inputs.branch }}
31+
release_url: ${{ github.event.inputs.release_url }}
32+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
33+
34+
- name: Finalize Release
35+
id: finalize-release
36+
env:
37+
# The following are needed if you use legacy PyPI set up
38+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
39+
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
40+
TWINE_USERNAME: __token__
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
43+
with:
44+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
45+
release_url: ${{ steps.populate-release.outputs.release_url }}
46+
47+
- name: '** Next Step **'
48+
if: ${{ success() }}
49+
run: |
50+
echo "Verify the final release"
51+
echo ${{ steps.finalize-release.outputs.release_url }}
52+
53+
- name: '** Failure Message **'
54+
if: ${{ failure() }}
55+
run: |
56+
echo "Failed to Publish the Draft Release Url:"
57+
echo ${{ steps.populate-release.outputs.release_url }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update Playwright Snapshots
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
update-snapshots:
13+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update snapshots') }}
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: React to the triggering comment
18+
run: |
19+
gh api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions --raw-field 'content=+1'
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Checkout the branch from the PR that triggered the job
29+
run: gh pr checkout ${{ github.event.issue.number }}
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Base Setup
34+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
35+
36+
- name: Install dependencies
37+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
38+
39+
- name: Install extension
40+
run: |
41+
set -eux
42+
jlpm
43+
python -m pip install .
44+
45+
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
# Playwright knows how to start JupyterLab server
49+
start_server_script: 'null'
50+
test_folder: ui-tests

0 commit comments

Comments
 (0)