Skip to content

Commit db751f2

Browse files
authored
Merge pull request #144 from datajoint/dev
`dev` -> `master`
2 parents 51943de + 7485419 commit db751f2

File tree

115 files changed

+9421
-16833
lines changed

Some content is hidden

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

115 files changed

+9421
-16833
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pharus
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Report
11+
12+
### Description
13+
A clear and concise description of what is the overall operation that is intended to be performed that resulted in an error.
14+
15+
### Reproducibility
16+
Include:
17+
- OS (WIN | MACOS | Linux)
18+
- DataJoint LabBook Version
19+
- MySQL Version
20+
- MySQL Deployment Strategy (local-native | local-docker | remote)
21+
- Minimum number of steps to reliably reproduce the issue
22+
- Complete error stack as a result of evaluating the above steps
23+
24+
### Expected Behavior
25+
A clear and concise description of what you expected to happen.
26+
27+
### Screenshots
28+
If applicable, add screenshots to help explain your problem.
29+
30+
### Additional Research and Context
31+
Add any additional research or context that was conducted in creating this report.
32+
33+
For example:
34+
- Related GitHub issues and PR's either within this repository or in other relevant repositories.
35+
- Specific links to specific lines or a focus within source code.
36+
- Relevant summary of Maintainers development meetings, milestones, projects, etc.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: DataJoint Contribution Guideline
4+
url: https://docs.datajoint.io/python/community/02-Contribute.html
5+
about: Please make sure to review the DataJoint Contribution Guideline
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for a new feature
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Request
11+
12+
### Problem
13+
A clear and concise description how this idea has manifested and the context. Elaborate on the need for this feature and/or what could be improved. Ex. I'm always frustrated when [...]
14+
15+
### Requirements
16+
A clear and concise description of the requirements to satisfy the new feature. Detail what you expect from a successful implementation of the feature. Ex. When using this feature, it should [...]
17+
18+
### Justification
19+
Provide the key benefits in making this a supported feature. Ex. Adding support for this feature would ensure [...]
20+
21+
### Alternative Considerations
22+
Do you currently have a work-around for this? Provide any alternative solutions or features you've considered.
23+
24+
### Related Errors
25+
Add any errors as a direct result of not exposing this feature.
26+
27+
Please include steps to reproduce provided errors as follows:
28+
- OS (WIN | MACOS | Linux)
29+
- DataJoint LabBook Version
30+
- MySQL Version
31+
- MySQL Deployment Strategy (local-native | local-docker | remote)
32+
- Minimum number of steps to reliably reproduce the issue
33+
- Complete error stack as a result of evaluating the above steps
34+
35+
### Screenshots
36+
If applicable, add screenshots to help explain your feature.
37+
38+
### Additional Research and Context
39+
Add any additional research or context that was conducted in creating this feature request.
40+
41+
For example:
42+
- Related GitHub issues and PR's either within this repository or in other relevant repositories.
43+
- Specific links to specific lines or a focus within source code.
44+
- Relevant summary of Maintainers development meetings, milestones, projects, etc.
45+
- Any additional supplemental web references or links that would further justify this feature request.

.github/workflows/development.yaml

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
name: Development
2+
on:
3+
pull_request:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
jobs:
8+
test-changelog:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Get changelog entry
13+
id: changelog_reader
14+
uses: guzman-raphael/changelog-reader-action@v5
15+
with:
16+
path: ./CHANGELOG.md
17+
- name: Verify changelog parsing
18+
env:
19+
TAG_NAME: ${{steps.changelog_reader.outputs.version}}
20+
RELEASE_NAME: Release ${{steps.changelog_reader.outputs.version}}
21+
BODY: ${{steps.changelog_reader.outputs.changes}}
22+
PRERELEASE: ${{steps.changelog_reader.outputs.status == 'prereleased'}}
23+
DRAFT: ${{steps.changelog_reader.outputs.status == 'unreleased'}}
24+
run: |
25+
echo "TAG_NAME=${TAG_NAME}"
26+
echo "RELEASE_NAME=${RELEASE_NAME}"
27+
echo "BODY=${BODY}"
28+
echo "PRERELEASE=${PRERELEASE}"
29+
echo "DRAFT=${DRAFT}"
30+
build-docs:
31+
needs: test-changelog
32+
runs-on: ubuntu-latest
33+
env:
34+
DOCKER_CLIENT_TIMEOUT: "120"
35+
COMPOSE_HTTP_TIMEOUT: "120"
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Compile docs static artifacts
39+
run: |
40+
export DJ_LABBOOK_VERSION=$(awk 'FNR==3' package.json | \
41+
awk '{split($0,a,":"); print a[2]}' | \
42+
awk -F'"' '{$0=$2}1')
43+
docker-compose -f docker-compose-docs.yaml up --exit-code-from docs-build --build
44+
echo "DJ_LABBOOK_VERSION=${DJ_LABBOOK_VERSION}" >> $GITHUB_ENV
45+
- name: Add docs static artifacts
46+
uses: actions/upload-artifact@v2
47+
with:
48+
name: docs-static-djlabbook-${{env.DJ_LABBOOK_VERSION}}
49+
path: docs/build/html
50+
retention-days: 1
51+
build:
52+
needs: test-changelog
53+
runs-on: ubuntu-latest
54+
env:
55+
DOCKER_CLIENT_TIMEOUT: "120"
56+
COMPOSE_HTTP_TIMEOUT: "120"
57+
steps:
58+
- uses: actions/checkout@v2
59+
- name: Compile static artifacts
60+
run: |
61+
export DJLABBOOK_VERSION=$(cat package.json | grep \"version\" | \
62+
awk -F\" '{print $4}')
63+
export HOST_UID=$(id -u)
64+
mkdir build
65+
docker-compose -f docker-compose-build.yaml up \
66+
--exit-code-from datajoint-labbook --build
67+
echo "DJLABBOOK_VERSION=${DJLABBOOK_VERSION}" >> $GITHUB_ENV
68+
- name: Add static artifacts
69+
uses: actions/upload-artifact@v2
70+
with:
71+
name: static-djlabbook-${{env.DJLABBOOK_VERSION}}
72+
path: build
73+
retention-days: 1
74+
test:
75+
needs: test-changelog
76+
runs-on: ubuntu-latest
77+
strategy:
78+
matrix:
79+
include:
80+
- py_ver: 3.8
81+
distro: alpine
82+
image: djbase
83+
env:
84+
PY_VER: ${{matrix.py_ver}}
85+
DISTRO: ${{matrix.distro}}
86+
IMAGE: ${{matrix.image}}
87+
DOCKER_CLIENT_TIMEOUT: "120"
88+
COMPOSE_HTTP_TIMEOUT: "120"
89+
steps:
90+
- uses: actions/checkout@v2
91+
with:
92+
submodules: true
93+
- name: Determine package version
94+
run: |
95+
DJLABBOOK_VERSION=$(cat package.json | grep \"version\" | awk -F\" '{print $4}')
96+
echo "DJLABBOOK_VERSION=${DJLABBOOK_VERSION}" >> $GITHUB_ENV
97+
- name: Run primary tests
98+
run: |
99+
export PHARUS_VERSION=$(cat pharus/pharus/version.py | tail -1 | \
100+
awk -F\' '{print $2}')
101+
export HOST_UID=$(id -u)
102+
docker-compose -f docker-compose-dev.yaml run -e CI=true datajoint-labbook \
103+
npm test -- --coverage
104+
publish-release:
105+
if: github.event_name == 'push'
106+
needs:
107+
- build
108+
- build-docs
109+
- test
110+
runs-on: ubuntu-latest
111+
outputs:
112+
release_upload_url: ${{steps.create_gh_release.outputs.upload_url}}
113+
steps:
114+
- uses: actions/checkout@v2
115+
- name: Determine package version
116+
run: |
117+
DJLABBOOK_VERSION=$(cat package.json | grep \"version\" | awk -F\" '{print $4}')
118+
echo "DJLABBOOK_VERSION=${DJLABBOOK_VERSION}" >> $GITHUB_ENV
119+
- name: Get changelog entry
120+
id: changelog_reader
121+
uses: guzman-raphael/changelog-reader-action@v5
122+
with:
123+
path: ./CHANGELOG.md
124+
version: ${{env.DJLABBOOK_VERSION}}
125+
- name: Fetch static artifacts
126+
uses: actions/download-artifact@v2
127+
with:
128+
name: static-djlabbook-${{env.DJLABBOOK_VERSION}}
129+
path: build
130+
- name: Compress static site artifacts
131+
run: zip -r static-djlabbook-${DJLABBOOK_VERSION}.zip build
132+
- name: Create GH release
133+
id: create_gh_release
134+
uses: actions/create-release@v1
135+
env:
136+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
137+
with:
138+
tag_name: ${{steps.changelog_reader.outputs.version}}
139+
release_name: Release ${{steps.changelog_reader.outputs.version}}
140+
body: ${{steps.changelog_reader.outputs.changes}}
141+
prerelease: ${{steps.changelog_reader.outputs.status == 'prereleased'}}
142+
draft: ${{steps.changelog_reader.outputs.status == 'unreleased'}}
143+
- name: Upload static site to release
144+
uses: actions/upload-release-asset@v1
145+
env:
146+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
147+
with:
148+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
149+
asset_path: static-djlabbook-${{env.DJLABBOOK_VERSION}}.zip
150+
asset_name: static-djlabbook-${{env.DJLABBOOK_VERSION}}.zip
151+
asset_content_type: application/zip
152+
- name: Upload deploy docker environment
153+
uses: actions/upload-release-asset@v1
154+
env:
155+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
156+
with:
157+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
158+
asset_path: docker-compose-deploy.yaml
159+
asset_name: docker-compose-deploy.yaml
160+
asset_content_type: application/yaml
161+
publish-docs:
162+
if: github.event_name == 'push'
163+
needs: publish-release
164+
runs-on: ubuntu-latest
165+
steps:
166+
- uses: actions/checkout@v2
167+
- name: Determine package version
168+
run: |
169+
export DJLABBOOK_VERSION=$(cat package.json | grep \"version\" | \
170+
awk -F\" '{print $4}')
171+
echo "DJLABBOOK_VERSION=${DJLABBOOK_VERSION}" >> $GITHUB_ENV
172+
- name: Fetch docs static artifacts
173+
uses: actions/download-artifact@v2
174+
with:
175+
name: docs-static-djlabbook-${{env.DJLABBOOK_VERSION}}
176+
path: docs/build/html
177+
- name: Commit documentation changes
178+
run: |
179+
git clone https://github.com/${GITHUB_REPOSITORY}.git \
180+
--branch gh-pages --single-branch gh-pages
181+
rm -R gh-pages/*
182+
cp -r docs/build/html/* gh-pages/
183+
cp .gitignore gh-pages/
184+
touch gh-pages/.nojekyll
185+
cd gh-pages
186+
git config --local user.email "[email protected]"
187+
git config --local user.name "GitHub Action"
188+
git add . --all
189+
git commit -m "Update documentation" -a || true
190+
# The above command will fail if no changes were present, so we ignore
191+
# the return code.
192+
- name: Push changes
193+
uses: ad-m/github-push-action@master
194+
with:
195+
branch: gh-pages
196+
directory: gh-pages
197+
github_token: ${{secrets.GITHUB_TOKEN}}
198+
- name: Compress docs static site artifacts
199+
run: zip -r docs-static-djlabbook-${DJLABBOOK_VERSION}.zip docs/build/html
200+
- name: Upload docs static site to release
201+
uses: actions/upload-release-asset@v1
202+
env:
203+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
204+
with:
205+
upload_url: ${{needs.publish-release.outputs.release_upload_url}}
206+
asset_path: "docs-static-djlabbook-${{env.DJLABBOOK_VERSION}}.zip"
207+
asset_name: "docs-static-djlabbook-${{env.DJLABBOOK_VERSION}}.zip"
208+
asset_content_type: application/zip
209+
# fail_on_unmatched_files: true

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
# docs
3+
/docs/build
4+
/docs/sphinx/_static/typedocs
25

36
# dependencies
47
/node_modules
@@ -22,4 +25,7 @@ npm-debug.log*
2225
yarn-debug.log*
2326
yarn-error.log*
2427

25-
.eslintcache
28+
.eslintcache
29+
.env
30+
docker-compose.y*ml
31+
.vscode

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "pharus"]
2+
path = pharus
3+
url = [email protected]:datajoint/pharus.git
4+
branch = master

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)