Handle annotated tag with no tagger
Git loader errors of type psycopg2.IntegrityError: null value in column "fullname" violates not-null constraint
[1] correspond to the processing of git annotated tags with no tagger, see for instance:
-
https://github.com/lightblueseas/file-worker/releases/tag/4.14.0
-
https://github.com/swissbyte/StepperDriver/releases/tag/1.0.0
Due to a non null constraint to the fullname
column of the person
table [2], the following exception is raised
in swh-storage:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/antoine/swh/swh-environment/swh-storage/swh/storage/api/server.py", line 163, in release_add
return encode_data(get_storage().release_add(**decode_request(request)))
File "/home/antoine/swh/swh-environment/swh-storage/swh/storage/storage.py", line 647, in release_add
db.release_add_from_temp(cur)
File "/home/antoine/swh/swh-environment/swh-storage/swh/storage/db.py", line 39, in _meth
self._cursor(cur).execute('SELECT %s()' % stored_proc)
psycopg2.IntegrityError: ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne « fullname »
DETAIL: La ligne en échec contient (27, null, null, null)
CONTEXT: instruction SQL « with t as (
select distinct author_fullname as fullname, author_name as name, author_email as email from tmp_release
) insert into person (fullname, name, email)
select fullname, name, email from t
where not exists (
select 1
from person p
where t.fullname = p.fullname
) »
fonction PL/pgsql swh_person_add_from_release(), ligne 3 à instruction SQL
instruction SQL « SELECT swh_person_add_from_release() »
fonction PL/pgsql swh_release_add(), ligne 3 à PERFORM
Removing the non null constraint seems to fix the issue while preserving correct release identifier computation once retrieved from the swh database.
Migrated from T1342 (view on Phabricator)