Revision.DoesNotExist when pushing a tag without pushing the tag's commit on a branch
Sentry Issue: ARKINDEX-BACKEND-4M
Revision.DoesNotExist: Revision matching query does not exist.
(8 additional frame(s) were not displayed)
...
File "arkindex/dataimport/api.py", line 498, in post
File "arkindex/dataimport/providers.py", line 335, in handle_webhook
File "arkindex/dataimport/providers.py", line 301, in update_revision_refs
File "django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "django/db/models/query.py", line 431, in get
self.model._meta.object_name
Committing something, then pushing both the commit and the tag simultaneously or pushing only the tag without a commit causes a Revision.DoesNotExist, because GitLab sends the tag_push events to the webhook before the push events and Arkindex assumes a Revision already exists when a tag is pushed.
git checkout master
git commit --allow-empty -m nothing
git tag thetag
git push origin thetag
# -or -
git push origin master thetag