mantisbt-plugins / source-integration

Source control integration plugin framework for MantisBT, including support for Github, Gitlab, Bitbucket, Gitea, Gitweb, Cgit, Subversion, Mercurial and more
http://noswap.com/projects/source-integration/
MIT License
181 stars 130 forks source link

CGit: error when parsing user without email #387

Closed rick-gnous closed 2 years ago

rick-gnous commented 2 years ago

On some CGit instances, committer or author hasn't any email. It made an error, but I can't find a repo without email to get it (the error was found on a cgit instance which close).

dregad commented 2 years ago

Since I do not use Cgit, this unfortunately does not give enough information to fix the issue, so need to rely on the community to either provide detailed error and steps to reproduce, or a pull request with a patch.

dregad commented 2 years ago

I can't find a repo without email to get it

@rick-gnous just thinking, if you have a working Cgit setup with a test repository to work with, you should be able to create a dummy commit having author and committer without e-mail, like so

GIT_COMMITTER_EMAIL='<>' git commit --author="Dummy <>" -m "Author&committer without email"
rick-gnous commented 2 years ago

I'll try that

rick-gnous commented 2 years ago

Got this error, I'll try to fix that

APPLICATION ERROR #401

Database query failed. Error received from database was #-1: ERROR: null value in column "author_email" violates not-null constraint
DETAIL: Failing row contains (15552, 20, 57dd3b6430213e685719049f3155890e44b8a45e, master, 0, 1970-01-01 00:00:00, , test, , , , null, null, null, 0). for the query: INSERT INTO mantis_plugin_Source_changeset_table ( repo_id, revision, parent, branch, user_id,
timestamp, author, message, info, ported, author_email, committer, committer_email, committer_id
) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14 ).
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
rick-gnous commented 2 years ago

Seem working