Skip to content

Commit

Permalink
Merge dandi archive updates from december 2023 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Kanzer authored and Aaron Kanzer committed Jan 3, 2024
2 parents 77e2308 + 65eca4a commit 7573af2
Show file tree
Hide file tree
Showing 171 changed files with 3,855 additions and 11,954 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install tox
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cli-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
docker image save -o dandiarchive-api.tgz dandiarchive/dandiarchive-api
- name: Upload Docker image tarball
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dandiarchive-api.tgz
path: dandiarchive-api.tgz
Expand All @@ -50,15 +50,15 @@ jobs:
DANDI_TESTS_PULL_DOCKER_COMPOSE: 0
steps:
- name: Download Docker image tarball
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dandiarchive-api.tgz

- name: Import Docker image
run: docker image load -i dandiarchive-api.tgz

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: yarn run lint --no-fix

- name: Type-check Vue app
run: yarn run type
run: yarn run type-check

- name: Build Vue app
run: yarn run build
Expand Down Expand Up @@ -70,9 +70,9 @@ jobs:
DANDI_ALLOW_LOCALHOST_URLS: 1

# Web client env vars
VUE_APP_DANDI_API_ROOT: http://localhost:8000/api/
VUE_APP_OAUTH_API_ROOT: http://localhost:8000/oauth/
VUE_APP_OAUTH_CLIENT_ID: Dk0zosgt1GAAKfN8LT4STJmLJXwMDPbYWYzfNtAl
VITE_APP_DANDI_API_ROOT: http://localhost:8000/api/
VITE_APP_OAUTH_API_ROOT: http://localhost:8000/oauth/
VITE_APP_OAUTH_CLIENT_ID: Dk0zosgt1GAAKfN8LT4STJmLJXwMDPbYWYzfNtAl

# E2E tests env vars
CLIENT_URL: http://localhost:8085
Expand All @@ -82,7 +82,6 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'
cache-dependency-path: web/yarn.lock

Expand All @@ -92,7 +91,7 @@ jobs:
working-directory: web

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -116,23 +115,23 @@ jobs:

- name: Install E2E tests
run: yarn install --frozen-lockfile
working-directory: web/test
working-directory: e2e

- name: Lint E2E tests
run: yarn run lint --no-fix --max-warnings=0
working-directory: web/test
working-directory: e2e

- name: Run E2E tests
run: |
# start vue dev server and wait for it to start
yarn --cwd .. run serve 2> /dev/null &
yarn --cwd ../web/ run dev 2> /dev/null &
while ! nc -z localhost 8085; do
sleep 3
done
# start the dandi-api server
python ../../manage.py runserver &
python ../manage.py runserver &
# run the E2E tests
yarn run test
working-directory: web/test
working-directory: e2e
139 changes: 139 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,142 @@
# v0.3.69 (Wed Dec 20 2023)

#### 🐛 Bug Fix

- Approval view: automatically redirect back to page after authentication [#1786](https://github.com/dandi/dandi-archive/pull/1786) ([@mvandenburgh](https://github.com/mvandenburgh))
- Remove explicit dependency on `pydantic` [#1796](https://github.com/dandi/dandi-archive/pull/1796) ([@mvandenburgh](https://github.com/mvandenburgh))

#### Authors: 1

- Mike VanDenburgh ([@mvandenburgh](https://github.com/mvandenburgh))

---

# v0.3.68 (Wed Dec 20 2023)

#### 🐛 Bug Fix

- Update + Reconfigure Vue Sentry SDK [#1795](https://github.com/dandi/dandi-archive/pull/1795) ([@mvandenburgh](https://github.com/mvandenburgh))
- Remove old squashed migrations [#1778](https://github.com/dandi/dandi-archive/pull/1778) ([@brianhelba](https://github.com/brianhelba))
- Fix S101 Use of `assert` detected [#1783](https://github.com/dandi/dandi-archive/pull/1783) ([@brianhelba](https://github.com/brianhelba))

#### Authors: 2

- Brian Helba ([@brianhelba](https://github.com/brianhelba))
- Mike VanDenburgh ([@mvandenburgh](https://github.com/mvandenburgh))

---

# v0.3.67 (Thu Dec 14 2023)

#### 🐛 Bug Fix

- Convert `rest.ts` to composition API [#1774](https://github.com/dandi/dandi-archive/pull/1774) ([@mvandenburgh](https://github.com/mvandenburgh))
- Add login redirect to user dashboard [#1781](https://github.com/dandi/dandi-archive/pull/1781) ([@mvandenburgh](https://github.com/mvandenburgh))
- Add embargo re-design doc [#1772](https://github.com/dandi/dandi-archive/pull/1772) ([@AlmightyYakob](https://github.com/AlmightyYakob))
- Ensure that creating the default OAuth2 Application works on staging [#1779](https://github.com/dandi/dandi-archive/pull/1779) ([@brianhelba](https://github.com/brianhelba))
- Squash migrations for "api", "analytics", and "zarr" apps [#1777](https://github.com/dandi/dandi-archive/pull/1777) ([@brianhelba](https://github.com/brianhelba))
- Fix issues found by Ruff [#1776](https://github.com/dandi/dandi-archive/pull/1776) ([@brianhelba](https://github.com/brianhelba))
- Switch frontend build process from Webpack to Vite [#1725](https://github.com/dandi/dandi-archive/pull/1725) ([@mvandenburgh](https://github.com/mvandenburgh))
- Fix FBT001 Boolean-typed positional argument in function definition [#1765](https://github.com/dandi/dandi-archive/pull/1765) ([@brianhelba](https://github.com/brianhelba))
- Fix RET505 Unnecessary `else` / `elif` after `return` statement [#1752](https://github.com/dandi/dandi-archive/pull/1752) ([@brianhelba](https://github.com/brianhelba))
- Avoid clobbering version metadata when calculating assets summary [#1557](https://github.com/dandi/dandi-archive/pull/1557) ([@danlamanna](https://github.com/danlamanna))
- Add upload/asset blob garbage collection design doc [#1733](https://github.com/dandi/dandi-archive/pull/1733) ([@mvandenburgh](https://github.com/mvandenburgh))
- Fix DJ008 Model does not define `__str__` method [#1767](https://github.com/dandi/dandi-archive/pull/1767) ([@brianhelba](https://github.com/brianhelba))
- [FIX] serviceUrl replacement [#1770](https://github.com/dandi/dandi-archive/pull/1770) ([@magland](https://github.com/magland))

#### 🏠 Internal

- [gh-actions](deps): Bump actions/setup-python from 4 to 5 [#1780](https://github.com/dandi/dandi-archive/pull/1780) ([@dependabot[bot]](https://github.com/dependabot[bot]))
- `test_zarr.py`: Import `EMPTY_CHECKSUM` from `zarr_checksum` [#1775](https://github.com/dandi/dandi-archive/pull/1775) ([@jwodder](https://github.com/jwodder))

#### Authors: 7

- [@dependabot[bot]](https://github.com/dependabot[bot])
- Brian Helba ([@brianhelba](https://github.com/brianhelba))
- Dan LaManna ([@danlamanna](https://github.com/danlamanna))
- Jacob Nesbitt ([@AlmightyYakob](https://github.com/AlmightyYakob))
- Jeremy Magland ([@magland](https://github.com/magland))
- John T. Wodder II ([@jwodder](https://github.com/jwodder))
- Mike VanDenburgh ([@mvandenburgh](https://github.com/mvandenburgh))

---

# v0.3.66 (Fri Dec 01 2023)

#### 🐛 Bug Fix

- Fix invalid contributors causing crash [#1771](https://github.com/dandi/dandi-archive/pull/1771) ([@mvandenburgh](https://github.com/mvandenburgh))
- Remove unnecessary quote escaping [#1766](https://github.com/dandi/dandi-archive/pull/1766) ([@brianhelba](https://github.com/brianhelba))
- Fix a test failure [#1768](https://github.com/dandi/dandi-archive/pull/1768) ([@brianhelba](https://github.com/brianhelba))
- Fix issues found by Ruff [#1763](https://github.com/dandi/dandi-archive/pull/1763) ([@brianhelba](https://github.com/brianhelba))
- WIP: Fix RET503 Missing explicit `return` at the end of function able to return non-`None` value [#1762](https://github.com/dandi/dandi-archive/pull/1762) ([@brianhelba](https://github.com/brianhelba))
- Fix issues found by Ruff [#1748](https://github.com/dandi/dandi-archive/pull/1748) ([@brianhelba](https://github.com/brianhelba))
- Fix G004 Logging statement uses f-string [#1750](https://github.com/dandi/dandi-archive/pull/1750) ([@brianhelba](https://github.com/brianhelba))
- Fix S113 Probable use of requests call without timeout [#1751](https://github.com/dandi/dandi-archive/pull/1751) ([@brianhelba](https://github.com/brianhelba))
- Upgrade django-s3-file-field [#1735](https://github.com/dandi/dandi-archive/pull/1735) ([@brianhelba](https://github.com/brianhelba))
- Fix N818 Exception name should be named with an Error suffix [#1749](https://github.com/dandi/dandi-archive/pull/1749) ([@brianhelba](https://github.com/brianhelba))

#### Authors: 2

- Brian Helba ([@brianhelba](https://github.com/brianhelba))
- Mike VanDenburgh ([@mvandenburgh](https://github.com/mvandenburgh))

---

# v0.3.65 (Wed Nov 22 2023)

#### 🐛 Bug Fix

- Check that path is an asset before proceeding [#1759](https://github.com/dandi/dandi-archive/pull/1759) ([@AlmightyYakob](https://github.com/AlmightyYakob))

#### Authors: 1

- Jacob Nesbitt ([@AlmightyYakob](https://github.com/AlmightyYakob))

---

# v0.3.64 (Wed Nov 22 2023)

#### 🐛 Bug Fix

- adjust neurosift service endpoint URL, passing additional info [#1706](https://github.com/dandi/dandi-archive/pull/1706) ([@magland](https://github.com/magland) [@waxlamp](https://github.com/waxlamp))
- Optimize dandiset owner PUT endpoint [#1737](https://github.com/dandi/dandi-archive/pull/1737) ([@mvandenburgh](https://github.com/mvandenburgh) [@AlmightyYakob](https://github.com/AlmightyYakob))

#### Authors: 4

- Jacob Nesbitt ([@AlmightyYakob](https://github.com/AlmightyYakob))
- Jeremy Magland ([@magland](https://github.com/magland))
- Mike VanDenburgh ([@mvandenburgh](https://github.com/mvandenburgh))
- Roni Choudhury ([@waxlamp](https://github.com/waxlamp))

---

# v0.3.63 (Tue Nov 21 2023)

#### 🐛 Bug Fix

- Fix race condition in version PUT endpoint [#1757](https://github.com/dandi/dandi-archive/pull/1757) ([@mvandenburgh](https://github.com/mvandenburgh))

#### Authors: 1

- Mike VanDenburgh ([@mvandenburgh](https://github.com/mvandenburgh))

---

# v0.3.62 (Fri Nov 17 2023)

#### 🐛 Bug Fix

- [DATALAD RUNCMD] Replace youtube URL with the one with @dandiarchive [#1754](https://github.com/dandi/dandi-archive/pull/1754) ([@yarikoptic](https://github.com/yarikoptic))
- Fix style issues found by Ruff [#1741](https://github.com/dandi/dandi-archive/pull/1741) ([@brianhelba](https://github.com/brianhelba))

#### Authors: 2

- Brian Helba ([@brianhelba](https://github.com/brianhelba))
- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic))

---

# v0.3.61 (Thu Nov 09 2023)

#### 🐛 Bug Fix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated by Django 4.1.4 on 2023-04-10 21:09

import django.core.validators
from django.db import migrations, models

Expand Down Expand Up @@ -33,7 +31,13 @@ class Migration(migrations.Migration):
('embargoed', models.BooleanField()),
],
options={
'unique_together': {('name', 'embargoed')},
'unique_together': set(),
},
),
migrations.AddConstraint(
model_name='processeds3log',
constraint=models.UniqueConstraint(
fields=('name', 'embargoed'), name='analytics_processeds3log_unique_name_embargoed'
),
),
]

This file was deleted.

19 changes: 11 additions & 8 deletions dandiapi/analytics/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@


class ProcessedS3Log(models.Model):
class Meta:
constraints = [
models.UniqueConstraint(
fields=['name', 'embargoed'],
name='%(app_label)s_%(class)s_unique_name_embargoed',
)
]

name = models.CharField(
max_length=36,
validators=[
Expand All @@ -20,3 +12,14 @@ class Meta:
)
# This is necessary to determine which bucket the logfile corresponds to
embargoed = models.BooleanField()

class Meta:
constraints = [
models.UniqueConstraint(
fields=['name', 'embargoed'],
name='%(app_label)s_%(class)s_unique_name_embargoed',
)
]

def __str__(self) -> str:
return self.name
17 changes: 10 additions & 7 deletions dandiapi/analytics/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@


def _bucket_objects_after(bucket: str, after: str | None) -> Generator[dict, None, None]:
assert bucket in [
if bucket not in {
settings.DANDI_DANDISETS_LOG_BUCKET_NAME,
settings.DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME,
]
}:
raise ValueError(f'Non-log bucket: {bucket}')
embargoed = bucket == settings.DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME
s3 = get_boto_client(get_storage() if not embargoed else get_embargo_storage())
kwargs = {}
Expand All @@ -40,10 +41,11 @@ def _bucket_objects_after(bucket: str, after: str | None) -> Generator[dict, Non
@shared_task(queue='s3-log-processing', soft_time_limit=60, time_limit=80)
def collect_s3_log_records_task(bucket: LogBucket) -> None:
"""Dispatch a task per S3 log file to process for download counts."""
assert bucket in [
if bucket not in {
settings.DANDI_DANDISETS_LOG_BUCKET_NAME,
settings.DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME,
]
}:
raise RuntimeError
embargoed = bucket == settings.DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME
after = ProcessedS3Log.objects.filter(embargoed=embargoed).aggregate(last_log=Max('name'))[
'last_log'
Expand All @@ -62,10 +64,11 @@ def process_s3_log_file_task(bucket: LogBucket, s3_log_key: str) -> None:
asset blobs. Prevents duplicate processing with a unique constraint on the ProcessedS3Log name
and embargoed fields.
"""
assert bucket in [
if bucket not in {
settings.DANDI_DANDISETS_LOG_BUCKET_NAME,
settings.DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME,
]
}:
raise RuntimeError
embargoed = bucket == settings.DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME

# short circuit if the log file has already been processed. note that this doesn't guarantee
Expand Down Expand Up @@ -93,7 +96,7 @@ def process_s3_log_file_task(bucket: LogBucket, s3_log_key: str) -> None:
log.save()
except IntegrityError as e:
if 'unique_name_embargoed' in str(e):
logger.info(f'Already processed log file {s3_log_key}, embargo: {embargoed}')
logger.info('Already processed log file %s, embargo: %s', s3_log_key, embargoed)
return

# note this task is run serially per log file. this is to avoid the contention between
Expand Down
3 changes: 2 additions & 1 deletion dandiapi/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_queryset(self, request):
)
)

@admin.action(description="Export selected users\' emails")
@admin.action(description="Export selected users' emails")
def export_emails_to_plaintext(self, request, queryset):
response = HttpResponse(content_type='text/plain')
writer = csv.writer(response)
Expand Down Expand Up @@ -142,6 +142,7 @@ def queryset(self, request, queryset):
status = self.value()
if status:
return queryset.filter(status=status)
return None


@admin.register(Version)
Expand Down
Loading

0 comments on commit 7573af2

Please sign in to comment.