Commit graph

286 commits

Author SHA1 Message Date
Adrien Ferrand
b799cffa84 Consistent use of single/double quotes 2020-07-21 23:07:57 +02:00
Adrien Ferrand
5ba77dda4d Start log 2020-07-21 23:03:10 +02:00
Adrien Ferrand
904f7dafdf Use f-string and format expressions 2020-07-21 22:57:26 +02:00
Adrien Ferrand
6652e43798 Check snapcraft execution interruption with exit codes 2020-07-21 22:11:46 +02:00
Adrien Ferrand
2d0c776747 Some nice refactorings 2020-07-21 21:56:58 +02:00
Adrien Ferrand
08e1ef6d13 Use Pool as a context manager 2020-07-21 21:43:55 +02:00
Adrien Ferrand
432a32cecb Use Manager() as a context manager 2020-07-21 21:40:58 +02:00
Adrien Ferrand
6b7dd05126 Merge branch 'master' into snap-remotebuild 2020-07-21 01:02:41 +02:00
Brad Warren
ebf1349b15
Update to IPython with Python 3.8 support. (#8152) 2020-07-17 13:01:04 -07:00
Adrien Ferrand
a8506f623a Lint 2020-07-17 21:41:13 +02:00
Adrien Ferrand
89d5eb6492 Update snapcraft.yaml 2020-07-17 21:40:52 +02:00
Adrien Ferrand
81472e8db2 Exit properly 2020-07-17 21:37:35 +02:00
Adrien Ferrand
913e9ae49e Allow retries if the remote build does not start 2020-07-17 20:41:05 +02:00
Adrien Ferrand
0fd6bc48c5 Dynamic display, take the maximum timeout for snap build job 2020-07-17 20:35:20 +02:00
Adrien Ferrand
e7d72bf855 Use explicit status 2020-07-17 16:28:35 +02:00
Adrien Ferrand
86c986194b Updates 2020-07-17 14:58:31 +02:00
Adrien Ferrand
fbf3afe3e3 Print 2020-07-17 14:34:22 +02:00
Adrien Ferrand
a9cc75cb1a Simplify 2020-07-17 14:28:31 +02:00
Adrien Ferrand
1c353b6084 Protect 2020-07-17 14:21:59 +02:00
Adrien Ferrand
1d36f53bd3 Nice UI 2020-07-17 14:14:35 +02:00
Adrien Ferrand
877632326d Add executable permissions 2020-07-17 13:02:48 +02:00
Adrien Ferrand
269d81fd93 Check existence 2020-07-10 14:32:59 +02:00
Adrien Ferrand
a514470066 Fix call 2020-07-10 13:57:29 +02:00
Adrien Ferrand
4b15773607 Exit code 2020-07-10 13:51:21 +02:00
Adrien Ferrand
6b7147d007 Generate constraints 2020-07-10 13:48:57 +02:00
Adrien Ferrand
3ec8c8e28a Handle the fact that snap builds may be taken from cache 2020-07-10 12:47:29 +02:00
Adrien Ferrand
7a6f935928 Reorganize the pipeline 2020-07-10 12:10:17 +02:00
Adrien Ferrand
2ad65b03c6 Fix script 2020-07-10 12:03:27 +02:00
Adrien Ferrand
8c4cb569ca Corrections 2020-07-10 10:30:19 +02:00
Adrien Ferrand
d3a052b9c1 Convert to a python logic 2020-07-10 10:28:29 +02:00
Adrien Ferrand
b20cce03aa Add dev dependencies to build cffi and cryptography 2020-07-10 01:04:06 +02:00
Adrien Ferrand
1957bcf5f9 Launch all builds in parallel 2020-07-10 00:53:06 +02:00
Adrien Ferrand
410c0cd1b4 Fixes 2020-07-09 22:53:47 +02:00
Adrien Ferrand
ca4df60ce9 Setup pipeline to use remote builds 2020-07-09 22:48:35 +02:00
Adrien Ferrand
ed7915c1dd Define scripts 2020-07-09 22:29:05 +02:00
Adrien Ferrand
d434b92945
Build the DNS plugins snaps (#8129)
Fixes #8041

This PR makes Azure Pipeline build the DNS plugins snaps for the 3 architectures during the CI.

It leverages the existing logic for building the Certbot snap in order to deploy a QEMU environment with Docker, and leverages the local PyPI index to speed up the build when installing `cffi` and `cryptography`.

All DNS plugins snaps are constructed in one unique docker container, in order to save the time required to install the system dependencies upon first start of `snapcraft`, and so speed up significantly the build.

Finally, all `amd64` DNS plugins snaps are built within 6 minutes. For `arm64` and `armhf`, it is around 40 mins: this is quite fast in fact, considering that 14 DNS plugins snaps are built.

However, this is still an extremely heavy task to make the full 3 architectures builds, even for Azure Pipelines and its 10 parallel jobs capability. That is why I make the `arm64` and `armhf` builds be skipped for the `full-test-suite`, and let them run only for `nightly` and `release`. This means however that these builds will not be done for the release branches. If this is a problem, I can put a more elaborate suspend condition to triggers the builds in this case.

All snaps are stored in the pipeline artifacts storage, making them available for publication during a `release` pipeline.

The PR is set as Draft for now, because I use temporarily `pr_test-suite` to validate the packaging jobs when commits are pushed. Once the PR is ready, I will revert it back to the normal configuration (run the standard tests).

* Configure a script to build DNS snaps

* Focus on packaging

* Trigger all architectures

* Add extra index

* Prepare conditional suspend

* Set final suspend logic

* Set final suspend value

* Loop for publication

* Use python3

* Clean before build

* Add a test

* Add test job in Azure

* Preserve env

* Apply normal config for pipelines

* Skip QEMU jobs only for test branches

* Makes snap run tests depends also on the Certbot snap build

* Update .azure-pipelines/templates/jobs/packaging-jobs.yml

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

* Update .azure-pipelines/templates/stages/deploy-stage.yml

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

* More accurate way to get the plugin snap name

* Integrate DNS snap tests into certbot-ci

* Fixes

* Update certbot-ci/snap_integration_tests/conftest.py

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

* Update certbot-ci/snap_integration_tests/conftest.py

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

* Clean an _init_.py file

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2020-07-09 11:33:25 -07:00
Adrien Ferrand
183ccc64b1
Some improvements (#8132)
Short PR to improve some things during snap builds:
* cleanup snapcraft assets before a build, in order to avoid some weird errors when two builds are executed consecutively without cleanup
* use python3 explicitly in `tools/simple_http_server.py` because on several recent distributions, `python` binary is not exposed anymore, only `python2` or `python3`.
2020-07-06 16:04:59 -07:00
Adrien Ferrand
8a3a8c7097
Migrate the CI pipeline from Travis to Azure Pipeline (#8098)
Fixes #8071 and fixes https://github.com/certbot/certbot/issues/8110.

This PR migrates every job from Travis in Azure Pipeline.

This PR essentially converts the Travis jobs into Azure Pipeline with a complete iso-fonctionality (or I made a mistake). The jobs are added in the relevant existing pipelines (`main`, `nightly`, `advanced-test`, `release`). A global refactoring thanks to the templating system is done to reduce greatly the verbosity of the pipeline descriptions.

A specific feature (not present in Travis) is added: the stage `On_Failure`. Using directly the Mattermost API, it allows to notify pipeline failure in a Mattermost channel with a link to the failed pipelines without the need to authenticate to Microsoft.

See https://github.com/certbot/certbot/pull/8098#issuecomment-649873641 for the post merge actions to do at the end of this work.
2020-07-02 15:01:21 -07:00
ohemorange
bce14ae65f
Make DNS plugin snaps use core20 (#8106)
Fixes #8103.

* Update the DNS plugin generator script to core20 syntax

* Generate new snapcraft.yamls for the DNS plugins

* Update certbot.wrapper to search for python3.8 paths
2020-06-23 09:31:08 -07:00
Adrien Ferrand
25d1977d4f
Add script and generated snapcraft.yaml files (#8096)
This PR adds a proper snapcraft.yaml file for each DNS plugin, and provides a shell script to generate them.
2020-06-22 17:07:08 -07:00
Brad Warren
1b2328f18b
Add comment about pyca's use of tools script (#8044) 2020-06-08 12:14:02 -07:00
ohemorange
2acc1dcc89
Fix TLS-ALPN tests with newer versions of OpenSSL (#8026)
Fixes #7988. As described there, the steps involved are:

1. Update our tests so they fail due to this problem.
2. Update the keys used in the tests so they pass with the new changes.

For 1, see a [failing travis run](https://travis-ci.com/github/certbot/certbot/jobs/340710511) with the included change. And for the full output to confirm that this is what is failing, see a [run on debian 10](https://github.com/certbot/certbot/files/4692350/debian_run_log.txt).

This PR adds `rsa4096_key.pem` and `rsa4096_cert.pem`, updates the `TLS-ALPN` test to use those keys in place of the 1024-bit versions, and fixes the README in that `testdata` folder with correct instructions to generate these files.

* export PIP_NO_BINARY in pip install subshell in test_sdists.sh

* set environment variable on the line that installs most packages

* Generate 4096-bit rsa key and cert, and fix README instructions to do so.

* Update TLS_ALPN test to use 4096-bit key instead of 1024-bit key.

* Update changelog

* Older versions of Python have an error when both VIRTUAL_NO_DOWNLOAD and PIP_NO_BINARY are set, so only apply the latter at the install phase.

* Add enum34 constraint manually, since rebuild_dependencies.py seems to be broken.

* only delete key if it exists

* Check OpenSSL version before trying to set PIP_NO_BINARY

* Add comment explaining why we only set PIP_NO_BINARY at the install step
2020-06-01 15:18:38 -07:00
Brad Warren
5b749ff8f7
Use Python 3 in the release script. (#7918)
Fixes #7902.
2020-04-20 14:44:53 -07:00
Karan Suthar
8e4dc0a48c
Minor bugfixes (#7891)
* Fix dangerous default argument

* Remove unused imports

* Remove unnecessary comprehension

* Use literal syntax to create data structure

* Use literal syntax instead of function calls to create data structure

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2020-04-13 10:41:39 -07:00
m0namon
1285297b23
[Apache v2] Load apacheconfig tree and gate related tests (#7710)
* Load apacheconfig dependency, gate behind flag

* Bump apacheconfig dependency to latest version and install dev version of apache for coverage tests

* Move augeasnode_test tests to more generic parsernode_test

* Revert "Move augeasnode_test tests to more generic parsernode_test"

This reverts commit 6bb986ef78.

* Mock AugeasNode into DualNode's place, and run augeasnode tests exclusively on AugeasNode

* Don't calculate coverage for skeleton functions

* clean up helper function in augeasnode_test
2020-03-23 17:05:22 -07:00
Brad Warren
69aec55ead
Remove --no-site-packages outside of certbot-auto. (#7832) 2020-03-09 13:05:35 -07:00
Brad Warren
fa67b7ba0f
Remove codecov (#7811)
After getting a +1 from everyone on the team, this PR removes the use of `codecov` from the Certbot repo because we keep having problems with it.

Two noteworthy things about this PR are:

1. I left the text at 4ea98d830b/.azure-pipelines/INSTALL.md (add-a-secret-variable-to-a-pipeline-like-codecov_token) because I think it's useful to document how to set up a secret variable in general.
2. I'm not sure what the text "Option -e makes sure we fail fast and don't submit to codecov." in `tox.cover.py` refers to but it seems incorrect since `-e` isn't accepted or used by the script so I just deleted the line.

As part of this, I said I'd open an issue to track setting up coveralls (which seems to be the only real alternative to codecov) which is at https://github.com/certbot/certbot/issues/7810.

With my change, failure output looks something like:
```
$ tox -e py27-cover
...
Name                                                         Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------------------
certbot/certbot/__init__.py                                      1      0   100%
certbot/certbot/_internal/__init__.py                            0      0   100%
certbot/certbot/_internal/account.py                           191      4    98%   62-63, 206, 337
...
certbot/tests/storage_test.py                                  530      0   100%
certbot/tests/util_test.py                                     374     29    92%   211-213, 480-484, 489-499, 504-511, 545-547, 552-554
------------------------------------------------------------------------------------------
TOTAL                                                        14451    647    96%
Command '['/path/to/certbot/dir/.tox/py27-cover/bin/python', '-m', 'coverage', 'report', '--fail-under', '100', '--include', 'certbot/*', '--show-missing']' returned non-zero exit status 2
Test coverage on certbot did not meet threshold of 100%.
ERROR: InvocationError for command /Users/bmw/Development/certbot/certbot/.tox/py27-cover/bin/python tox.cover.py (exited with code 1)
_________________________________________________________________________________________________________________________________________________________ summary _________________________________________________________________________________________________________________________________________________________
ERROR:   py27-cover: commands failed
```
I printed the exception just so we're not throwing away information.

I think it's also possible we fail for a reason other than the threshold not meeting the percentage, but I've personally never seen this, `coverage report` output is not being captured so hopefully that would inform devs if something else is going on, and saying something like "Test coverage probably did not..." seems like overkill to me personally.

* remove codecov

* remove unused variable group

* remove codecov.yml

* Improve tox.cover.py failure output.
2020-02-27 14:44:39 -08:00
Brad Warren
fd64c8c33b
Remove letshelp-certbot (#7761)
* remove references to letshelp

* remove letshelp files

* Remove line continuation

Co-authored-by: ohemorange <ebportnoy@gmail.com>
2020-02-14 17:19:19 -08:00
Brad Warren
605ef40656 Remove duplicate pyparsing pin 2020-02-11 14:20:29 -08:00
Brad Warren
1859fb059d
Don't display todo comments in docs (#7753)
Currently if you go to https://certbot.eff.org/docs/api/certbot.crypto_util.html, there is a todo comment displayed at the top of the page. These todos were written for developers, not users, so I do not think they should be shown from our documentation.

This PR makes the quick and easy fix of configuring Sphinx not to show these todo items. I created #7752 to track removing all of these todos from our docstrings and disabling the Sphinx todo extension.

* Set todo_include_todos=False in sphinx-quickstart

* Remove todos from existing docs.
2020-02-06 15:39:47 -08:00