#107 trac import with custom fields set to "" fails
Closed: Fixed 7 years ago Opened 7 years ago by kevin.

Example traceback:

% pgimport push fudcon-planning.git
Before executing this command, you must have "Pagure Tickets" enabled from pagure project's settings. Continue? [y/N]: y
warning: not sending a push certificate since the receiving end does not support --signed push
remote: Files changed by new commits:
remote:
remote: repo: fudcon-planning None None
remote: To load: 414dfed777b54145b6158221faea2691
remote: Traceback (most recent call last):
remote: File "./hooks/post-receive.pagure-ticket", line 105, in <module>
remote: main(sys.argv[1:])
remote: File "./hooks/post-receive.pagure-ticket", line 101, in main
remote: run_as_post_receive_hook()
remote: File "./hooks/post-receive.pagure-ticket", line 97, in run_as_post_receive_hook
remote: json_data=json_data)
remote: File "/usr/lib/python2.7/site-packages/pagure/lib/git.py", line 546, in update_ticket_from_git
remote: json_data=json_data,
remote: File "/usr/lib/python2.7/site-packages/pagure/lib/git.py", line 475, in update_custom_field_from_json
remote: value=value,
remote: File "/usr/lib/python2.7/site-packages/pagure/lib/init.py", line 3530, in set_custom_key_value
remote: 'No value given to this new custom field: %s' % key.name
remote: pagure.exceptions.PagureException: No value given to this new custom field: blockedby
remote: Hook ./hooks/post-receive.pagure-ticket failed with error code 1
To ssh://pagure.io/tickets/fudcon-planning.git
* [new branch] master -> master

Probibly the importer should ignore custom fields with no value.


I'm not 100% sure I agree this is purely a pagure-importer bug.
The problem will probably also happen if someone checks out the tickets repo and updates a custom field value to "", in the belief that that sets it to empty.
I think Pagure should handle this more gracefully.

@vivekanand1101 changed the status to Closed

7 years ago

Login to comment on this ticket.

Metadata