Git import fails when GPG-signed

Asked by Giovanni Santini on 2017-02-17

Problem (TL;DR): As in title.

Description:
I set up a git import for FreshPlayerPlugin in order to have automated daily builds.
I was reported that autobuilds were not available even though commits were available upstream.
I've noticed then that automatic imports were failing.
So I tried to run an import and I had this error log:

...
2017-02-17 11:55:24 INFO
Traceback (most recent call last):
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/scripts/code-import-worker.py", line 106, in <module>
    sys.exit(script.main())
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/scripts/code-import-worker.py", line 101, in main
    return import_worker.run()
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/lib/lp/codehosting/codeimport/worker.py", line 617, in run
    return self._doImport()
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/lib/lp/codehosting/codeimport/worker.py", line 820, in _doImport
    inter_branch.fetch(limit=revision_limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/bzrplugins/git/branch.py", line 722, in fetch
    self.fetch_objects(stop_revision, fetch_tags=fetch_tags, limit=limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/bzrplugins/git/branch.py", line 745, in fetch_objects
    determine_wants, self.source.mapping, limit=limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/bzrplugins/git/fetch.py", line 718, in fetch_objects
    limit)
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/bzrplugins/git/fetch.py", line 484, in import_git_objects
    mapping.revision_id_foreign_to_bzr)
  File "/srv/importd.launchpad.net/production/launchpad-rev-18326/bzrplugins/git/mapping.py", line 334, in import_commit
    raise UnknownCommitExtra(commit, [item[0] for item in commit.extra])
bzrlib.plugins.git.errors.UnknownCommitExtra: Unknown extra fields in <Commit af485a6d8f860929f696a4d296c013e506cf4e66>: ['gpgsig'].
Import failed:
Traceback (most recent call last):
Failure: twisted.internet.error.ProcessTerminated: A process has ended with a probable error condition: process ended with exit code 1.

A possible solution would be to totally drop the GPG signature field...
Else, the good solution would be to implement GPG signature support for commits.

The involved git import:
https://code.launchpad.net/%7Eitachi-san/fresh-player-plugin/main/
The full failed git import log:
http://launchpadlibrarian.net/306824474/itachi-san-fresh-player-plugin-main.log

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
2017-02-17
Last reply:
2017-02-17
Naël (nathanael-naeri) said : #1

I've found a bug related to your question: bug 1084403. As far as I can understand, it cannot be fixed by simply ignoring the gpgsig field in the git commit, and it will not be fixed by supporting this field either.

As far as I understand, the recommended way to deal with Git repositories that have GPG-signed commits is to import the code as a Git repository on Launchpad (yes, it's apparently possible now, I wasn't aware of that) instead of importing it as a Bazaar branch, i.e. use the git-to-git feature instead of the bzr-git plugin.

See bug 1084403 comments 46 and 48, bug 1653794 comment 1, question 303648 comment 1, and:

https://help.launchpad.net/Code/Git
https://blog.launchpad.net/general/git-code-hosting-beta
https://blog.launchpad.net/code/git-to-git-imports

Colin Watson (cjwatson) said : #2

Yes, Nathanaël is right: please just use Git-to-Git imports if you possibly can. They're much simpler and more robust. It's unlikely that the gpgsig problems with Git-to-Bazaar imports will be fixed, at least not in the near future.

Giovanni Santini (itachi-san) said : #3

The fact is that I am working on Precise 12.04, which does not support Git build recipes.
I will try to backport the relevant packages...
Else I will have to work it in another way. Sigh.

Colin Watson (cjwatson) said : #4

Why do you say that precise does not support Git recipes? It should work fine.

Giovanni Santini (itachi-san) said : #5

@cjwatson, there's no 'git-build-recipe' package for precise.

At [1] there's a link to a PPA but the backports stop at trusty.

1: https://help.launchpad.net/Packaging/SourceBuilds/GettingStarted#Getting_git-build-recipe

Colin Watson (cjwatson) said : #6

Sure, but does that actually matter? git-build-recipe is just used for building the source package. Launchpad currently always runs git-build-recipe on xenial regardless of the target series; there's then a separate build job that builds binary packages, which runs on precise or whatever the target series is.

Giovanni Santini (itachi-san) said : #7

@cjwatson OK, that's useful to know.
So I will just create a chroot to test out the recipe and that will be fine, I suppose.

Can you help with this problem?

Provide an answer of your own, or ask Giovanni Santini for more information if necessary.

To post a message you must log in.