diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3ad0c23..ef31053e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.event.workflow_run.head_sha }} + fetch-depth: 0 - name: Create tag and GitHub release run: | @@ -59,7 +60,16 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git tag -a "$VERSION" -m "Release $VERSION" git push origin "$VERSION" - gh release create "$VERSION" --title "$VERSION" --generate-notes + + PREV_TAG=$(git describe --tags --abbrev=0 --match '[0-9]*.[0-9]*.[0-9]*' "$VERSION^" 2>/dev/null || true) + if [[ -n "$PREV_TAG" && "$(git rev-list --count "$PREV_TAG..$VERSION")" == "1" ]]; then + # Single squash commit since the last release: use its message verbatim + # instead of --generate-notes, which would just restate the same one commit. + NOTES="$(git log -1 --format=%B "$VERSION")" + gh release create "$VERSION" --title "$VERSION" --notes "$NOTES" + else + gh release create "$VERSION" --title "$VERSION" --generate-notes + fi # A tag pushed by GITHUB_TOKEN does not trigger build-image.yml's push-tags event # (GitHub suppresses it to avoid recursion), so dispatch the build explicitly. diff --git a/CHANGELOG.md b/CHANGELOG.md index affe6b02..6b937c91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Worklfow tests now run in parallel and asserts no new migrations +- Workflow tests now run in parallel and asserts no new migrations ## [3.6.0] diff --git a/README.md b/README.md index 84d9aacb..830d67df 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Github Actions](https://github.com/cortex-lab/alyx/actions/workflows/main.yml/badge.svg)](https://github.com/cortex-lab/alyx/actions/) [![Coverage Status](https://coveralls.io/repos/github/cortex-lab/alyx/badge.svg?branch=github_action)](https://coveralls.io/github/cortex-lab/alyx?branch=master) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21513696.svg)](https://doi.org/10.5281/zenodo.21513696) Database for experimental neuroscience laboratories @@ -34,12 +35,18 @@ Contribution checklist: - [ ] update version number in `./alyx/alyx/__init__.py` - [ ] update `CHANGELOG.md` +Release process: +1. Open a PR from your feature branch into dev +2. On dev, bump the Alyx version and update the changelog +3. Open a PR from dev to master +4. When CI passes, make a squash commit into master using the version as the commit title, and changelog section as the message +5. Actions will automatically create a new release, deploy containers, and assign a DOI ### Running tests Continuous integration is set up. But before submitting a PR or commit,the tests can run locally. First install the test dependencies with `pip install -r requirements_test.txt`. - `./manage.py test -n --parallel` parallel test without migrations (fastest) - - `./manage.py test` test with migrations (recommended if model changes) + - `./manage.py test` test with migrations (recommended if models change) ### Documentation contribution guide diff --git a/deploy/app/template.env b/deploy/app/template.env index 4176616e..bf8a9463 100644 --- a/deploy/app/template.env +++ b/deploy/app/template.env @@ -13,6 +13,7 @@ GLOBUS_CLIENT_ID=525cc543-8ccb-4d11-8036-af332da5eafd TZ=UTC # Alyx datetime timezone. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones DJANGO_MEDIA_ROOT=~/uploaded DJANGO_TABLES_ROOT=~/tables +COMPOSE_PROJECT_NAME=alyx-deploy # DJANGO_MEDIA_ROOT=~/scratch/uploaded # add if local storage # DJANGO_TABLES_ROOT=~/scratch/uploaded # add if local storage # DJANGO_MEDIA_S3=https://alyx-uploaded.s3.eu-west-2.amazonaws.com/uploaded/ # add if s3 (overrides local media) diff --git a/requirements_test.txt b/requirements_test.txt index 17ffb944..f1154b5f 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,6 +1,10 @@ # for code coverage coverage coveralls +# pin ruff explicitly -- it's otherwise pulled in transitively and unpinned via ONE-api, +# so a new ruff release can silently start failing CI with no code change at all (see +# cortex-lab/alyx#1027: ruff 0.16.0 added new default rules, 821 new findings overnight) +ruff==0.15.22 # for ONE cache table generation tests pyarrow pandas diff --git a/setup.cfg b/setup.cfg index 84140abf..d98a681c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,8 @@ source = alyx concurrency = multiprocessing parallel = True omit = + */wsgi.py + */gunicorn_wsgi.py [coverage:report] exclude_lines =