Skip to content
Merged

3.6.2 #1030

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,24 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0

- name: Create tag and GitHub release
run: |
git config user.name "github-actions[bot]"
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.
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.2]

### Fixed

- Scoped delete_zygosity_rule post delete hook, improving performance on delete

### Changed

- Removed unused dj_database_url dependency
- Omit WSGI from CI code coverage
- Changed default docker project name
- Use commit message for release description on squash commits to master
- Pin ruff and remove flake8

### Added

- DOI badge in README
- Release steps to README

## [3.6.1]

### Fixed
Expand All @@ -14,7 +33,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]

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion alyx/alyx/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = __version__ = '3.6.1'
VERSION = __version__ = '3.6.2'
5 changes: 2 additions & 3 deletions alyx/subjects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,9 @@ def genotype_from_litter(self, subject, force=False):
self._create_zygosity(subject, allele, z, force=force)


@receiver(post_delete)
@receiver(post_delete, sender=ZygosityRule)
def delete_zygosity_rule(sender, instance, **kwargs):
if isinstance(instance, ZygosityRule):
_update_zygosities(instance.line, instance.sequence0)
_update_zygosities(instance.line, instance.sequence0)


class AlleleManager(models.Manager):
Expand Down
22 changes: 11 additions & 11 deletions deploy/app/docker/settings-deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import os
import json
import dj_database_url
import logging
import dotenv
import urllib.parse
Expand All @@ -31,16 +30,17 @@

# %% Databases
SECRET_KEY = os.getenv('DJANGO_SECRET_KEY')
# Build the connection URL
POSTGRES_USER = urllib.parse.quote(os.getenv('POSTGRES_USER', ''))
POSTGRES_PASSWORD = urllib.parse.quote(os.getenv('POSTGRES_PASSWORD', ''))
POSTGRES_HOST = urllib.parse.quote(os.getenv('POSTGRES_HOST', ''))
POSTGRES_PORT = urllib.parse.quote(os.getenv('POSTGRES_PORT', '5432')) # Default PostgreSQL port
POSTGRES_DB = urllib.parse.quote(os.getenv('POSTGRES_DB', ''))
# the database details are provided in the form of an URL. The URL looks like:
# "postgres://USER:PASSWORD@HOST:PORT/DB_NAME"
database_url = f"postgres://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_HOST}:{POSTGRES_PORT}/{POSTGRES_DB}"
DATABASES = {"default": dj_database_url.parse(database_url)}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"USER": urllib.parse.quote(os.getenv('POSTGRES_USER', '')),
"PASSWORD": urllib.parse.quote(os.getenv('POSTGRES_PASSWORD', '')),
"HOST": urllib.parse.quote(os.getenv('POSTGRES_HOST', '')),
"NAME": urllib.parse.quote(os.getenv('POSTGRES_DB', '')),
# Default PostgreSQL port
"PORT": urllib.parse.quote(os.getenv('POSTGRES_PORT', '5432'))
}
}
# %% S3 access to write cache tables
# the s3 access details are provided in the form of a JSON string. The variable looks like:
# S3_ACCESS={"access_key":"xxxxx", "secret_key":"xxxxx", "region":"us-east-1"}
Expand Down
1 change: 1 addition & 0 deletions deploy/app/template.env
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ django-storages
django-structlog
django-test-without-migrations
djangorestframework
dj_database_url
drf-spectacular
docutils
dotenv
drfdocs
flake8
fonttools>=4.61.0
globus-cli>=3.41.0
globus-sdk>=4.3.0
Expand Down
4 changes: 4 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ source = alyx
concurrency = multiprocessing
parallel = True
omit =
*/wsgi.py
*/gunicorn_wsgi.py

[coverage:report]
exclude_lines =
Expand Down
Loading