From f8d5e4eca972b76ccf1a6e5dd7f818923d8dadfe Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Thu, 9 Oct 2025 19:50:23 -0400 Subject: [PATCH 01/20] Remove user_migration scripts These were added by #59, to migrate users from Girder to Django. --- dandiapi/api/__init__.py | 4 -- .../management/commands/depose_placeholder.py | 20 -------- .../commands/depose_placeholders.py | 12 ----- .../management/commands/list_placeholders.py | 18 -------- dandiapi/api/user_migration.py | 46 ------------------- 5 files changed, 100 deletions(-) delete mode 100644 dandiapi/api/management/commands/depose_placeholder.py delete mode 100644 dandiapi/api/management/commands/depose_placeholders.py delete mode 100644 dandiapi/api/management/commands/list_placeholders.py delete mode 100644 dandiapi/api/user_migration.py diff --git a/dandiapi/api/__init__.py b/dandiapi/api/__init__.py index 0fa5df86a..e69de29bb 100644 --- a/dandiapi/api/__init__.py +++ b/dandiapi/api/__init__.py @@ -1,4 +0,0 @@ -from __future__ import annotations - -# TODO: remove this after migration is complete -import dandiapi.api.user_migration # noqa: F401 diff --git a/dandiapi/api/management/commands/depose_placeholder.py b/dandiapi/api/management/commands/depose_placeholder.py deleted file mode 100644 index 651916218..000000000 --- a/dandiapi/api/management/commands/depose_placeholder.py +++ /dev/null @@ -1,20 +0,0 @@ -from __future__ import annotations - -from django.contrib.auth.models import User -import djclick as click - -from dandiapi.api.user_migration import copy_ownership - - -@click.command() -@click.argument('placeholder_email') -@click.argument('github_email') -def depose_placeholder(*, placeholder_email: str, github_email: str): - placeholder_user = User.objects.get(email=placeholder_email) - github_user = User.objects.get(email=github_email) - - click.echo(f'Replacing {placeholder_email} with {github_email}') - copy_ownership(placeholder_user, github_user) - - click.echo(f'Deleting {placeholder_email}') - placeholder_user.delete() diff --git a/dandiapi/api/management/commands/depose_placeholders.py b/dandiapi/api/management/commands/depose_placeholders.py deleted file mode 100644 index 1fd7d5cfd..000000000 --- a/dandiapi/api/management/commands/depose_placeholders.py +++ /dev/null @@ -1,12 +0,0 @@ -from __future__ import annotations - -from django.contrib.auth.models import User -import djclick as click - -from dandiapi.api.user_migration import depose_placeholder - - -@click.command() -def depose_placeholders(): - for user in User.objects.all(): - depose_placeholder(user) diff --git a/dandiapi/api/management/commands/list_placeholders.py b/dandiapi/api/management/commands/list_placeholders.py deleted file mode 100644 index 86f462af7..000000000 --- a/dandiapi/api/management/commands/list_placeholders.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import annotations - -from django.contrib.auth.models import User -import djclick as click - - -@click.command() -def list_placeholders(): - """ - Return a list of all user emails who still have a placeholder in Django. - - This may be useful to contact all users who have yet to log in. - """ - placeholder_emails = User.objects.filter(email__startswith='placeholder_').values_list( - 'email', flat=True - ) - emails = [email[12:] for email in placeholder_emails] - click.echo(' '.join(emails)) diff --git a/dandiapi/api/user_migration.py b/dandiapi/api/user_migration.py deleted file mode 100644 index 51c804c16..000000000 --- a/dandiapi/api/user_migration.py +++ /dev/null @@ -1,46 +0,0 @@ -from __future__ import annotations - -import logging - -from allauth.account.signals import user_logged_in -from django.dispatch import receiver - -logger = logging.getLogger(__name__) - - -def copy_ownership(placeholder_user, user): - """Copy dandiset ownership from a placeholder user to the real user.""" - from guardian.shortcuts import assign_perm, get_objects_for_user, remove_perm - - from dandiapi.api.models import Dandiset - - owned_dandisets = get_objects_for_user(placeholder_user, 'owner', Dandiset) - logger.info('%s owns %s', placeholder_user, owned_dandisets) - for dandiset in owned_dandisets: - logger.info('Moving ownership on %s', dandiset.identifier) - assign_perm('owner', user, dandiset) - remove_perm('owner', placeholder_user, dandiset) - - -def depose_placeholder(user): - """Replace a placeholder user with a real user, if a placeholder exists.""" - from django.contrib.auth.models import User - - placeholder_email = 'placeholder_' + user.email - try: - placeholder_user = User.objects.get(email=placeholder_email) - except User.DoesNotExist: - # No placeholder user, nothing to do - return - - logger.info('Replacing %s with %s', placeholder_user, user) - copy_ownership(placeholder_user, user) - # The placeholder user has no further purpose, delete it - logger.info('Deleting %s', placeholder_user) - placeholder_user.delete() - - -@receiver(user_logged_in) -def user_log_in_listener(*, sender, user, **kwargs): - """Attempt replace a placeholder user every time a real user logs in.""" - depose_placeholder(user) From 50b3790ba440cc764b778e51a6bfec48329c3ae4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 21:13:10 +0000 Subject: [PATCH 02/20] [gh-actions](deps): Bump actions/checkout from 5 to 6 Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/backend-ci.yml | 2 +- .github/workflows/backend-production-deploy.yml | 4 ++-- .github/workflows/backend-staging-deploy.yml | 2 +- .github/workflows/cli-integration.yml | 2 +- .github/workflows/frontend-ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 4282ee9fc..e3c0dadf1 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -57,7 +57,7 @@ jobs: DJANGO_DANDI_INSTANCE_IDENTIFIER: "RRID:ABC_123456" DJANGO_DANDI_DOI_API_PREFIX: "10.80507" steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags - name: Install uv diff --git a/.github/workflows/backend-production-deploy.yml b/.github/workflows/backend-production-deploy.yml index 193eb097c..8d7d3da18 100644 --- a/.github/workflows/backend-production-deploy.yml +++ b/.github/workflows/backend-production-deploy.yml @@ -20,7 +20,7 @@ jobs: name: Update release branch runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags token: ${{ secrets.GH_TOKEN }} # TODO: switch to GITHUB_TOKEN @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-22.04 needs: reset-release-branch steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags ref: release diff --git a/.github/workflows/backend-staging-deploy.yml b/.github/workflows/backend-staging-deploy.yml index f3e1f7bd5..283989b23 100644 --- a/.github/workflows/backend-staging-deploy.yml +++ b/.github/workflows/backend-staging-deploy.yml @@ -23,7 +23,7 @@ jobs: name: Deploy to Heroku runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags diff --git a/.github/workflows/cli-integration.yml b/.github/workflows/cli-integration.yml index 17b28c282..0b7390859 100644 --- a/.github/workflows/cli-integration.yml +++ b/.github/workflows/cli-integration.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out this repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 7ce03f8eb..e67402954 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -13,7 +13,7 @@ jobs: working-directory: web runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags @@ -87,7 +87,7 @@ jobs: VITE_APP_OAUTH_API_ROOT: http://localhost:8000/oauth/ VITE_APP_OAUTH_CLIENT_ID: Dk0zosgt1GAAKfN8LT4STJmLJXwMDPbYWYzfNtAl steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f49540df1..13cb1e1df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # fetch history for all branches and tags token: ${{ secrets.GH_TOKEN }} # TODO: switch to GITHUB_TOKEN From 921b95b7fcf2f9bf556fe19e6d97d678cd49d705 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 21:02:58 +0000 Subject: [PATCH 03/20] [gh-actions](deps): Bump actions/upload-artifact from 5 to 6 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/cli-integration.yml | 2 +- .github/workflows/frontend-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli-integration.yml b/.github/workflows/cli-integration.yml index 17b28c282..31c83e1d8 100644 --- a/.github/workflows/cli-integration.yml +++ b/.github/workflows/cli-integration.yml @@ -34,7 +34,7 @@ jobs: docker image save -o dandiarchive-api.tgz dandiarchive/dandiarchive-api - name: Upload Docker image tarball - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: dandiarchive-api.tgz path: dandiarchive-api.tgz diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml index 7ce03f8eb..69257210c 100644 --- a/.github/workflows/frontend-ci.yml +++ b/.github/workflows/frontend-ci.yml @@ -130,7 +130,7 @@ jobs: # run the tests cd e2e && npx playwright test - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 if: always() with: name: playwright-report From 85a5275ee2176c3957d9dec3e31da1b941c2ce4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 21:03:03 +0000 Subject: [PATCH 04/20] [gh-actions](deps): Bump actions/download-artifact from 6 to 7 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/cli-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-integration.yml b/.github/workflows/cli-integration.yml index 17b28c282..d426df315 100644 --- a/.github/workflows/cli-integration.yml +++ b/.github/workflows/cli-integration.yml @@ -54,7 +54,7 @@ jobs: DANDI_TESTS_PULL_DOCKER_COMPOSE: 0 steps: - name: Download Docker image tarball - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: dandiarchive-api.tgz From f1cc28ada2d2cf16ed65d3e39790477fd7fd1346 Mon Sep 17 00:00:00 2001 From: Nicole Tregoning Date: Wed, 31 Dec 2025 11:46:24 -0500 Subject: [PATCH 05/20] Update code snippet to show correct dandi instance in cli command dandi upload --- .../FileBrowser/FileUploadInstructions.vue | 12 ++++++++++-- .../DandisetLandingView/DandisetValidationErrors.vue | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/src/components/FileBrowser/FileUploadInstructions.vue b/web/src/components/FileBrowser/FileUploadInstructions.vue index 2d69117ac..de343e162 100644 --- a/web/src/components/FileBrowser/FileUploadInstructions.vue +++ b/web/src/components/FileBrowser/FileUploadInstructions.vue @@ -26,7 +26,7 @@
> cd {{ dandisetIdentifier }}
> dandi organize <source_folder> -f dry
> dandi organize <source_folder>
-
> dandi upload
+
> dandi upload -i {{ instanceName }}
@@ -48,13 +48,21 @@