Skip to content

Commit f38ed97

Browse files
MrCordeiroCopilot
andauthored
Add .editorconfig and SECURITY.md and nightly test (#527)
* Add .editorconfig and SECURITY.md * Test against nightly build Co-authored-by: Copilot <copilot@github.com> * Relax BeautifulSoup dependency version Co-authored-by: Copilot <copilot@github.com> --------- Co-authored-by: Copilot <copilot@github.com>
1 parent 1f53fc8 commit f38ed97

6 files changed

Lines changed: 100 additions & 2 deletions

File tree

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
11+
[Makefile]
12+
indent_style = tab
13+
14+
[*.py]
15+
max_line_length = 88
16+
17+
[*.{html,rst,md}]
18+
indent_size = 4
19+
20+
[*.{js,ts,tsx,json,yml,yaml,css,scss}]
21+
indent_size = 2
22+
23+
[*.md]
24+
trim_trailing_whitespace = false
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Called by GitHub Actions when the nightly build fails.
3+
This reports an error to the #nightly-build-failures Slack channel.
4+
"""
5+
import os
6+
import requests
7+
8+
if "SLACK_WEBHOOK_URL" in os.environ:
9+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables
10+
repository = os.environ["GITHUB_REPOSITORY"]
11+
run_id = os.environ["GITHUB_RUN_ID"]
12+
url = f"https://github.com/{repository}/actions/runs/{run_id}"
13+
14+
print("Reporting to #nightly-build-failures slack channel")
15+
response = requests.post(
16+
os.environ["SLACK_WEBHOOK_URL"],
17+
json={
18+
"text": f"A Nightly build failed. See {url}",
19+
},
20+
timeout=10,
21+
)
22+
23+
print(f"Slack responded with: {response}")
24+
25+
else:
26+
print(
27+
"Unable to report to #nightly-build-failures slack channel because SLACK_WEBHOOK_URL is not set"
28+
)

.github/workflows/nightly.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Nightly Wagtail Test
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * *'
6+
# At 01:00, daily
7+
workflow_dispatch:
8+
9+
jobs:
10+
nightly-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.14'
17+
- name: Install Tox
18+
run: |
19+
python -m pip install --upgrade pip setuptools wheel tox
20+
- name: Run 'future' tests
21+
id: test
22+
continue-on-error: true
23+
run: |
24+
tox -e future
25+
- name: 'On failure, report to #nightly-build-failures in Wagtail Slack'
26+
if: steps.test.outcome == 'failure'
27+
run: |
28+
python .github/scripts/report_nightly_build_failure.py
29+
env:
30+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Security
2+
3+
We take the security of Wagtail, and related packages we maintain, seriously. If you have found a security issue with any of our projects please email us at security@wagtail.org so we can work together to find and patch the issue. We appreciate responsible disclosure with any security related issues, so please contact us first before creating a GitHub issue.
4+
5+
If you want to send an encrypted email (optional), the public key ID for security@wagtail.org is 0xbed227b4daf93ff9, and this public key is available from most commonly-used keyservers.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
]
1616

1717
testing_extras = [
18-
'beautifulsoup4>=4.8,<4.10',
18+
'beautifulsoup4>=4.8,<5.0',
1919
'coverage>=4.5',
2020
'django-webtest>=1.9,<1.10',
2121
]

tox.ini

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ python =
2424

2525

2626
[testenv]
27-
description = Unit tests
27+
description = Unit tests against published packages
2828
install_command = pip install -e ".[testing]" -U {opts} {packages}
2929
commands = coverage run --source=wagtailmenus runtests.py
3030

@@ -38,3 +38,14 @@ deps =
3838
wt70: wagtail>=7.0,<7.1
3939
wt72: wagtail>=7.2,<7.3
4040
wt73: wagtail>=7.3,<7.4
41+
42+
[testenv:future]
43+
description = Unit tests against the latest development versions of dependencies
44+
install_command = pip install -e ".[testing]" -U {opts} {packages}
45+
commands = coverage run --source=wagtailmenus runtests.py
46+
basepython = python3.14
47+
48+
deps =
49+
coverage
50+
beautifulsoup4>=4.13.3
51+
git+https://github.com/wagtail/wagtail.git@main#egg=wagtail

0 commit comments

Comments
 (0)