mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:52:02 +02:00
Merge remote-tracking branch 'origin/master' into remove-legacy-new-authz-support
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
trigger: none
|
# We run the test suite on commits to master so codecov gets coverage data
|
||||||
|
# about the master branch and can use it to track coverage changes.
|
||||||
|
trigger:
|
||||||
|
- master
|
||||||
pr:
|
pr:
|
||||||
- master
|
- master
|
||||||
- '*.x'
|
- '*.x'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/jobs/standard-tests-jobs.yml
|
- template: templates/jobs/standard-tests-jobs.yml
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ jobs:
|
|||||||
macos-py37-cover:
|
macos-py37-cover:
|
||||||
IMAGE_NAME: macOS-12
|
IMAGE_NAME: macOS-12
|
||||||
PYTHON_VERSION: 3.7
|
PYTHON_VERSION: 3.7
|
||||||
TOXENV: py37-cover
|
TOXENV: cover
|
||||||
macos-cover:
|
macos-cover:
|
||||||
IMAGE_NAME: macOS-12
|
IMAGE_NAME: macOS-12
|
||||||
TOXENV: py3-cover
|
TOXENV: cover
|
||||||
|
UPLOAD_COVERAGE: 1
|
||||||
windows-py37:
|
windows-py37:
|
||||||
IMAGE_NAME: windows-2019
|
IMAGE_NAME: windows-2019
|
||||||
PYTHON_VERSION: 3.7
|
PYTHON_VERSION: 3.7
|
||||||
@@ -18,11 +19,13 @@ jobs:
|
|||||||
windows-py39-cover:
|
windows-py39-cover:
|
||||||
IMAGE_NAME: windows-2019
|
IMAGE_NAME: windows-2019
|
||||||
PYTHON_VERSION: 3.9
|
PYTHON_VERSION: 3.9
|
||||||
TOXENV: py39-cover-win
|
TOXENV: cover-win
|
||||||
|
UPLOAD_COVERAGE: 1
|
||||||
windows-integration-certbot:
|
windows-integration-certbot:
|
||||||
IMAGE_NAME: windows-2019
|
IMAGE_NAME: windows-2019
|
||||||
PYTHON_VERSION: 3.9
|
PYTHON_VERSION: 3.9
|
||||||
TOXENV: integration-certbot
|
TOXENV: integration-certbot
|
||||||
|
UPLOAD_COVERAGE: 1
|
||||||
linux-oldest-tests-1:
|
linux-oldest-tests-1:
|
||||||
IMAGE_NAME: ubuntu-22.04
|
IMAGE_NAME: ubuntu-22.04
|
||||||
PYTHON_VERSION: 3.7
|
PYTHON_VERSION: 3.7
|
||||||
@@ -37,7 +40,8 @@ jobs:
|
|||||||
TOXENV: py37
|
TOXENV: py37
|
||||||
linux-cover:
|
linux-cover:
|
||||||
IMAGE_NAME: ubuntu-22.04
|
IMAGE_NAME: ubuntu-22.04
|
||||||
TOXENV: py3-cover
|
TOXENV: cover
|
||||||
|
UPLOAD_COVERAGE: 1
|
||||||
linux-lint:
|
linux-lint:
|
||||||
IMAGE_NAME: ubuntu-22.04
|
IMAGE_NAME: ubuntu-22.04
|
||||||
TOXENV: lint-posix
|
TOXENV: lint-posix
|
||||||
@@ -49,6 +53,7 @@ jobs:
|
|||||||
PYTHON_VERSION: 3.8
|
PYTHON_VERSION: 3.8
|
||||||
TOXENV: integration
|
TOXENV: integration
|
||||||
ACME_SERVER: pebble
|
ACME_SERVER: pebble
|
||||||
|
UPLOAD_COVERAGE: 1
|
||||||
apache-compat:
|
apache-compat:
|
||||||
IMAGE_NAME: ubuntu-22.04
|
IMAGE_NAME: ubuntu-22.04
|
||||||
TOXENV: apache_compat
|
TOXENV: apache_compat
|
||||||
|
|||||||
@@ -55,3 +55,28 @@ steps:
|
|||||||
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
|
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
|
||||||
AWS_EC2_PEM_FILE: $(testFarmPem.secureFilePath)
|
AWS_EC2_PEM_FILE: $(testFarmPem.secureFilePath)
|
||||||
displayName: Run tox
|
displayName: Run tox
|
||||||
|
# For now, let's omit `set -e` and avoid the script exiting with a nonzero
|
||||||
|
# status code to prevent problems here from causing build failures. If
|
||||||
|
# this turns out to work well, we can change this.
|
||||||
|
- bash: |
|
||||||
|
python3 tools/pip_install.py -I coverage
|
||||||
|
case "$AGENT_OS" in
|
||||||
|
Darwin)
|
||||||
|
CODECOV_URL="https://uploader.codecov.io/latest/macos/codecov"
|
||||||
|
;;
|
||||||
|
Linux)
|
||||||
|
CODECOV_URL="https://uploader.codecov.io/latest/linux/codecov"
|
||||||
|
;;
|
||||||
|
Windows_NT)
|
||||||
|
CODECOV_URL="https://uploader.codecov.io/latest/windows/codecov.exe"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unexpected OS"
|
||||||
|
exit 0
|
||||||
|
esac
|
||||||
|
curl --retry 3 -o codecov "$CODECOV_URL"
|
||||||
|
chmod +x codecov
|
||||||
|
coverage xml
|
||||||
|
./codecov || echo "Uploading coverage data failed"
|
||||||
|
condition: ne(variables['UPLOAD_COVERAGE'], '')
|
||||||
|
displayName: Upload coverage data
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# This disables all reporting from codecov. Let's just set it up to collect
|
||||||
|
# data for now and then we can play with the settings here.
|
||||||
|
comment: false
|
||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
project: off
|
||||||
|
patch: off
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
# Configuration for https://github.com/marketplace/stale
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
|
||||||
daysUntilStale: 365
|
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
|
||||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
|
||||||
# When changing this value, be sure to also update markComment below.
|
|
||||||
daysUntilClose: 30
|
|
||||||
|
|
||||||
# Ignore issues with an assignee (defaults to false)
|
|
||||||
exemptAssignees: true
|
|
||||||
|
|
||||||
# Label to use when marking as stale
|
|
||||||
staleLabel: needs-update
|
|
||||||
|
|
||||||
# Comment to post when marking as stale. Set to `false` to disable
|
|
||||||
markComment: >
|
|
||||||
We've made a lot of changes to Certbot since this issue was opened. If you
|
|
||||||
still have this issue with an up-to-date version of Certbot, can you please
|
|
||||||
add a comment letting us know? This helps us to better see what issues are
|
|
||||||
still affecting our users. If there is no activity in the next 30 days, this
|
|
||||||
issue will be automatically closed.
|
|
||||||
|
|
||||||
# Comment to post when closing a stale Issue or Pull Request.
|
|
||||||
closeComment: >
|
|
||||||
This issue has been closed due to lack of activity, but if you think it
|
|
||||||
should be reopened, please open a new issue with a link to this one and we'll
|
|
||||||
take a look.
|
|
||||||
|
|
||||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
|
||||||
limitPerRun: 1
|
|
||||||
|
|
||||||
# Don't mark pull requests as stale.
|
|
||||||
only: issues
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: Update Stale Issues
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Run at midnight every night
|
||||||
|
- cron: '24 1 * * *'
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v6
|
||||||
|
with:
|
||||||
|
# REMOVEME: dry run to see if this works
|
||||||
|
debug-only: true
|
||||||
|
|
||||||
|
# Idle number of days before marking issues stale
|
||||||
|
days-before-issue-stale: 365
|
||||||
|
|
||||||
|
# Idle number of days before closing stale issues
|
||||||
|
days-before-issue-close: 30
|
||||||
|
|
||||||
|
# Ignore issues with an assignee
|
||||||
|
exempt-all-issue-assignees: true
|
||||||
|
|
||||||
|
# Label to use when marking as stale
|
||||||
|
stale-issue-label: needs-update
|
||||||
|
|
||||||
|
stale-issue-message: >
|
||||||
|
We've made a lot of changes to Certbot since this issue was opened. If you
|
||||||
|
still have this issue with an up-to-date version of Certbot, can you please
|
||||||
|
add a comment letting us know? This helps us to better see what issues are
|
||||||
|
still affecting our users. If there is no activity in the next 30 days, this
|
||||||
|
issue will be automatically closed.
|
||||||
|
|
||||||
|
close-issue-message: >
|
||||||
|
This issue has been closed due to lack of activity, but if you think it
|
||||||
|
should be reopened, please open a new issue with a link to this one and we'll
|
||||||
|
take a look.
|
||||||
|
|
||||||
|
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||||
|
operations-per-run: 1
|
||||||
@@ -123,6 +123,9 @@ class Error(jose.JSONObjectWithFields, errors.Error):
|
|||||||
|
|
||||||
https://datatracker.ietf.org/doc/html/rfc7807
|
https://datatracker.ietf.org/doc/html/rfc7807
|
||||||
|
|
||||||
|
Note: Although Error inherits from JSONObjectWithFields, which is immutable,
|
||||||
|
we add mutability for Error to comply with the Python exception API.
|
||||||
|
|
||||||
:ivar str typ:
|
:ivar str typ:
|
||||||
:ivar str title:
|
:ivar str title:
|
||||||
:ivar str detail:
|
:ivar str detail:
|
||||||
@@ -185,6 +188,10 @@ class Error(jose.JSONObjectWithFields, errors.Error):
|
|||||||
return code
|
return code
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# Hack to allow mutability on Errors (see GH #9539)
|
||||||
|
def __setattr__(self, name: str, value: Any) -> None:
|
||||||
|
return object.__setattr__(self, name, value)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
result = b' :: '.join(
|
result = b' :: '.join(
|
||||||
part.encode('ascii', 'backslashreplace') for part in
|
part.encode('ascii', 'backslashreplace') for part in
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"""Tests for acme.messages."""
|
"""Tests for acme.messages."""
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
import unittest
|
import unittest
|
||||||
|
import contextlib
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
@@ -91,6 +92,19 @@ class ErrorTest(unittest.TestCase):
|
|||||||
u"Problem for {1.identifier.value}: {1.typ} :: {1.description} :: {1.detail} :: {1.title}").format(
|
u"Problem for {1.identifier.value}: {1.typ} :: {1.description} :: {1.detail} :: {1.title}").format(
|
||||||
self.error_with_subproblems, self.subproblem))
|
self.error_with_subproblems, self.subproblem))
|
||||||
|
|
||||||
|
# this test is based on a minimal reproduction of a contextmanager/immutable
|
||||||
|
# exception related error: https://github.com/python/cpython/issues/99856
|
||||||
|
def test_setting_traceback(self):
|
||||||
|
self.assertIsNone(self.error_custom.__traceback__)
|
||||||
|
|
||||||
|
try:
|
||||||
|
1/0
|
||||||
|
except ZeroDivisionError as e:
|
||||||
|
self.error_custom.__traceback__ = e.__traceback__
|
||||||
|
|
||||||
|
self.assertIsNotNone(self.error_custom.__traceback__)
|
||||||
|
|
||||||
|
|
||||||
class ConstantTest(unittest.TestCase):
|
class ConstantTest(unittest.TestCase):
|
||||||
"""Tests for acme.messages._Constant."""
|
"""Tests for acme.messages._Constant."""
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* Fixed a crash when registering an account with BuyPass' ACME server.
|
* Fixed a crash when registering an account with BuyPass' ACME server.
|
||||||
|
* Fixed a bug where Certbot would crash with `AttributeError: can't set attribute` on ACME server errors in Python 3.11. See [GH #9539](https://github.com/certbot/certbot/issues/9539).
|
||||||
|
|
||||||
More details about these changes can be found on our GitHub repo.
|
More details about these changes can be found on our GitHub repo.
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ For debugging, we recommend putting
|
|||||||
|
|
||||||
Once you are done with your code changes, and the tests in ``foo_test.py``
|
Once you are done with your code changes, and the tests in ``foo_test.py``
|
||||||
pass, run all of the unit tests for Certbot and check for coverage with ``tox
|
pass, run all of the unit tests for Certbot and check for coverage with ``tox
|
||||||
-e py3-cover``. You should then check for code style with ``tox -e lint`` (all
|
-e cover``. You should then check for code style with ``tox -e lint`` (all
|
||||||
files) or ``pylint --rcfile=.pylintrc path/to/file.py`` (single file at a
|
files) or ``pylint --rcfile=.pylintrc path/to/file.py`` (single file at a
|
||||||
time).
|
time).
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@ def set_up_command(config_dir: str, logs_dir: str, work_dir: str, nginx_dir: str
|
|||||||
return (
|
return (
|
||||||
'certbot --cert-path {0} --key-path {1} --config-dir {2} '
|
'certbot --cert-path {0} --key-path {1} --config-dir {2} '
|
||||||
'--logs-dir {3} --work-dir {4} --nginx-server-root {5} --debug '
|
'--logs-dir {3} --work-dir {4} --nginx-server-root {5} --debug '
|
||||||
'--force-renewal --nginx -vv '.format(
|
'--force-renewal --nginx -vv --no-random-sleep-on-renew '.format(
|
||||||
test_util.vector_path('cert.pem'),
|
test_util.vector_path('cert.pem'),
|
||||||
test_util.vector_path('rsa512_key.pem'),
|
test_util.vector_path('rsa512_key.pem'),
|
||||||
config_dir, logs_dir, work_dir, nginx_dir).split())
|
config_dir, logs_dir, work_dir, nginx_dir).split())
|
||||||
|
|||||||
Reference in New Issue
Block a user