yegor256 / rultor

DevOps team assistant that helps you merge, deploy, and release GitHub-hosted apps and libraries
https://www.rultor.com
Other
560 stars 156 forks source link

Rultor Reloads GPG Keys on every Build when Decrypting, Failing to Communicate with the Keyserver Fails Builds Needlessly #1015

Open original-brownbear opened 8 years ago

original-brownbear commented 8 years ago

This is coming from https://github.com/yegor256/rultor/issues/1003:

Currently we have this code in Rultor:

    /**
     * Decrypt instructions.
     * @return Instructions
     * @throws IOException If fails
     */
    public Iterable<String> commands() throws IOException {
        final Collection<XML> assets =
            this.profile.read().nodes("/p/entry[@key='decrypt']/entry");
        final Collection<String> commands = new LinkedList<String>();
        if (!assets.isEmpty()) {
            commands.add("gpgconf --reload gpg-agent");
            commands.add(
                Joiner.on(' ').join(
                    "gpg --keyserver hkp://pool.sks-keyservers.net",
                    this.proxy,
                    "--verbose --recv-keys 9AF0FA4C"
                )
            );
            commands.add("gpg --version");
        }

Part of the issues reported in https://github.com/yegor256/rultor/issues/1003 are a result of the call to the key-server sporadically failing like so:

gpg --keyserver hkp://pool.sks-keyservers.net --verbose --recv-keys 9AF0FA4C
gpg: requesting key 9AF0FA4C from hkp server pool.sks-keyservers.net
gpgkeys: HTTP fetch error 52: Empty reply from server
gpg: no valid OpenPGP data found.

Failing to contact the keyserver needs to be handled in a more reasonable and stable manner. Rultor needs to reload the key from a different server in case the given one fails, this should never be something that breaks a build given the wide availability of key servers.

original-brownbear commented 8 years ago

@alex-palevsky this is a bug.

alex-palevsky commented 8 years ago

@alex-palevsky this is a bug.

@original-brownbear tag bug added to this issue

alex-palevsky commented 8 years ago

@original-brownbear I set milestone here to 2.0, let me know if it is wrong

alex-palevsky commented 8 years ago

@original-brownbear thanks a lot for reporting, 30 mins added to your acc, pmt ID AP-7UH92031H0578253S

original-brownbear commented 8 years ago

@alex-palevsky this depends on #1055

alex-palevsky commented 8 years ago

@alex-palevsky this depends on #1055

@original-brownbear OK, let's wait for #1055

alex-palevsky commented 8 years ago

@original-brownbear I think we can continue, impediment #1055 is closed

original-brownbear commented 8 years ago

@alex-palevsky this is postponed.

alex-palevsky commented 8 years ago

@alex-palevsky this is postponed.

@original-brownbear sure, thanks, I added "postponed" label to it

alex-palevsky commented 8 years ago

@alex-palevsky this is postponed.

@original-brownbear right, I will find someone else, no problem