Skip to content

Commit bd1a86a

Browse files
committed
Update the template
1 parent df588af commit bd1a86a

File tree

4 files changed

+43
-4
lines changed

4 files changed

+43
-4
lines changed

.copier-answers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v4.3.0
2+
_commit: v4.3.4
33
_src_path: https://github.com/jupyterlab/extension-template
44
author_email: ''
55
author_name: Datalayer
@@ -12,3 +12,4 @@ project_short_description: A Jupyter Server extension to execute code cell from
1212
python_name: jupyter_server_nbmodel
1313
repository: https://github.com/datalayer/jupyter-server-nbmodel
1414
test: true
15+

.github/workflows/update-integration-tests.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ permissions:
1010

1111
jobs:
1212
update-snapshots:
13-
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update snapshots') }}
13+
if: >
14+
(
15+
github.event.issue.author_association == 'OWNER' ||
16+
github.event.issue.author_association == 'COLLABORATOR' ||
17+
github.event.issue.author_association == 'MEMBER'
18+
) && github.event.issue.pull_request && contains(github.event.comment.body, 'please update snapshots')
1419
runs-on: ubuntu-latest
1520

1621
steps:
@@ -25,10 +30,40 @@ jobs:
2530
with:
2631
token: ${{ secrets.GITHUB_TOKEN }}
2732

33+
- name: Get PR Info
34+
id: pr
35+
env:
36+
PR_NUMBER: ${{ github.event.issue.number }}
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
GH_REPO: ${{ github.repository }}
39+
COMMENT_AT: ${{ github.event.comment.created_at }}
40+
run: |
41+
pr="$(gh api /repos/${GH_REPO}/pulls/${PR_NUMBER})"
42+
head_sha="$(echo "$pr" | jq -r .head.sha)"
43+
pushed_at="$(echo "$pr" | jq -r .pushed_at)"
44+
45+
if [[ $(date -d "$pushed_at" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then
46+
echo "Updating is not allowed because the PR was pushed to (at $pushed_at) after the triggering comment was issued (at $COMMENT_AT)"
47+
exit 1
48+
fi
49+
50+
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT
51+
2852
- name: Checkout the branch from the PR that triggered the job
29-
run: gh pr checkout ${{ github.event.issue.number }}
3053
env:
3154
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: gh pr checkout ${{ github.event.issue.number }}
56+
57+
- name: Validate the fetched branch HEAD revision
58+
env:
59+
EXPECTED_SHA: ${{ steps.pr.outputs.head_sha }}
60+
run: |
61+
actual_sha="$(git rev-parse HEAD)"
62+
63+
if [[ "$actual_sha" != "$EXPECTED_SHA" ]]; then
64+
echo "The HEAD of the checked out branch ($actual_sha) differs from the HEAD commit available at the time when trigger comment was submitted ($EXPECTED_SHA)"
65+
exit 1
66+
fi
3267
3368
- name: Base Setup
3469
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -48,3 +83,4 @@ jobs:
4883
# Playwright knows how to start JupyterLab server
4984
start_server_script: 'null'
5085
test_folder: ui-tests
86+
npm_client: jlpm

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![Github Actions Status](https://github.com/datalayer/jupyter-server-nbmodel/workflows/Build/badge.svg)](https://github.com/datalayer/jupyter-server-nbmodel/actions/workflows/build.yml)
44
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/datalayer/jupyter-server-nbmodel/main?urlpath=lab)
5+
6+
57
A Jupyter Server extension to execute code cell from the server.
68

79
This extension is composed of a Python package named `jupyter_server_nbmodel`

ui-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ in [jupyter_server_test_config.py](./jupyter_server_test_config.py).
1212

1313
The default configuration will produce video for failing tests and an HTML report.
1414

15-
> There is a new experimental UI mode that you may fall in love with; see [that video](https://www.youtube.com/watch?v=jF0yA-JLQW0).
15+
> There is a UI mode that you may like; see [that video](https://www.youtube.com/watch?v=jF0yA-JLQW0).
1616
1717
## Run the tests
1818

0 commit comments

Comments
 (0)