certbot/tools
Adrien Ferrand 84178e2773
Do not reuse existing builds on Launchpad when executing snapcraft remote-build (#8719)
We observed recently several unexpected behavior during the execution of snap jobs in Azure. In particular it seems that `snapcraft remote-build` is tending to reattach to the latest builds on Launchpad triggered by the nightly builds on master, independently from the actual branch, status of the code, or targeted architectures.

Primarily if the builds on Launchpad are stalled for some reason, it blocks effectively any other Azure snap jobs until someone manually cancel the builds on Launchpad. Secondarily it means that the outcome of the builds may be inconsistent, because they can be the result of a build for the master source even if you are on a PR that modifieds these sources (including `snapcraft.yaml`).

After digging in `snapcraft` source code, I realized that the signature computed to understand if a build should be resumed, is not based one some hashes against the snapcraft working directory content, but is simply a hash of the working directory absolute path *itself*. It means that every builds triggered from the working directory `/my/path/certbot` for instance, are recognized as the same unique build on Launchpad side, and may be resumed if they already exist, and so independently from the source code, `snapcraft.yaml` or targeted archs.

For the record, relevant parts in `snapcraft` source code:
82024d3748/snapcraft/project/_project.py (L44)
82024d3748/snapcraft/project/_project.py (L86-L89)
82024d3748/snapcraft/cli/remote.py (L128-L132)

This PR makes effectively the resume build mechanism effectively a noop by moving the source code first in a temporary directory with random name before running `snapcraft remote-build`. This way the signature is never the same and builds are always recognized as brand new builds.

* Invalidate snapcraft remote-build cache by using a temporary workspace.

* Capture one more state in the build
2021-03-22 10:39:09 -07:00
..
docker Make certbot constraint file independent from certbot-auto + update cryptography (#8649) 2021-02-23 15:29:52 -08:00
snap Do not reuse existing builds on Launchpad when executing snapcraft remote-build (#8719) 2021-03-22 10:39:09 -07:00
_changelog_top.txt Remove list of modified packages from changelog. (#7146) 2019-06-11 14:02:54 -07:00
_release.sh Always sign certbot-auto with a yubikey (#8600) 2021-01-12 13:45:26 -08:00
certbot_constraints.txt Make certbot constraint file independent from certbot-auto + update cryptography (#8649) 2021-02-23 15:29:52 -08:00
deactivate.py Minor bugfixes (#7891) 2020-04-13 10:41:39 -07:00
dev_constraints.txt Fix linux-py39-cover test (#8720) 2021-03-19 14:27:29 -07:00
eff-pubkey.pem Add pubkey to tree 2016-03-01 11:21:51 -08:00
extract_changelog.py Insert new line before "More details about these changes can be found on our GitHub repo." (#8645) 2021-02-25 16:30:48 -08:00
finish_release.py Add finish_release flags and CLI parsing (#8522) 2020-12-10 15:13:48 -08:00
half-sign.c Use SHA256 openssl signatures 2016-01-11 14:22:51 -08:00
install_and_test.py Removed Python legacy __future__ imports (#8697) 2021-03-05 16:53:20 -08:00
merge_requirements.py Removed Python legacy __future__ imports (#8697) 2021-03-05 16:53:20 -08:00
oldest_constraints.txt Remove requests[security] dependency (#8626) 2021-02-05 15:33:45 -08:00
pip_install.py Make certbot constraint file independent from certbot-auto + update cryptography (#8649) 2021-02-23 15:29:52 -08:00
pip_install_editable.py Removed Python legacy __future__ imports (#8697) 2021-03-05 16:53:20 -08:00
pipstrap.py Deprecate acme.typing_magic module, stop using it in certbot (#8643) 2021-03-09 16:12:32 -08:00
pipstrap_constraints.txt Fix linux-py39-cover test (#8720) 2021-03-19 14:27:29 -07:00
readlink.py Removed Python legacy __future__ imports (#8697) 2021-03-05 16:53:20 -08:00
rebuild_certbot_constraints.py Make certbot constraint file independent from certbot-auto + update cryptography (#8649) 2021-02-23 15:29:52 -08:00
release.sh Release script improvements (#6337) 2018-09-05 14:10:05 -07:00
retry.sh Automatically retry test farm tests (#8325) 2020-09-30 17:05:52 -07:00
simple_http_server.py Some improvements (#8132) 2020-07-06 16:04:59 -07:00
sphinx-quickstart.sh Convert http links to https (#8287) 2020-09-23 19:36:55 +02:00
strip_hashes.py Address review comments 2019-03-04 15:52:38 +02:00
venv.py merge dev and dev3 (#8639) 2021-02-04 21:31:47 +11:00