Skip to content

Commit 7c03e7f

Browse files
authored
Merge branch 'master' into issues/864-subnet-division-overlap
2 parents 00d4275 + ffbefa5 commit 7c03e7f

File tree

12 files changed

+142
-39
lines changed

12 files changed

+142
-39
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI Failure Bot
2+
3+
on:
4+
workflow_run:
5+
workflows: ["OpenWISP Controller CI Build"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
pull-requests: write
11+
actions: read
12+
contents: read
13+
14+
concurrency:
15+
group: ci-failure-${{ github.repository }}-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_branch }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
find-pr:
20+
runs-on: ubuntu-latest
21+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
22+
outputs:
23+
pr_number: ${{ steps.pr.outputs.number }}
24+
steps:
25+
- name: Find PR Number
26+
id: pr
27+
env:
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
REPO: ${{ github.repository }}
30+
PR_NUMBER_PAYLOAD: ${{ github.event.workflow_run.pull_requests[0].number }}
31+
EVENT_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
32+
run: |
33+
PR_NUMBER="$PR_NUMBER_PAYLOAD"
34+
if [ -n "$PR_NUMBER" ]; then
35+
echo "Found PR #$PR_NUMBER from workflow payload."
36+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
37+
exit 0
38+
fi
39+
HEAD_SHA="$EVENT_HEAD_SHA"
40+
echo "Payload empty. Searching for PR via Commits API..."
41+
PR_NUMBER=$(gh api repos/$REPO/commits/$HEAD_SHA/pulls -q '.[0].number' 2>/dev/null || true)
42+
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
43+
echo "Found PR #$PR_NUMBER using Commits API."
44+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
45+
exit 0
46+
fi
47+
echo "API lookup failed/empty. Scanning open PRs for matching head SHA..."
48+
PR_NUMBER=$(gh pr list --repo "$REPO" --state open --limit 100 --json number,headRefOid --jq ".[] | select(.headRefOid == \"$HEAD_SHA\") | .number" | head -n 1)
49+
if [ -n "$PR_NUMBER" ]; then
50+
echo "Found PR #$PR_NUMBER by scanning open PRs."
51+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
52+
exit 0
53+
fi
54+
echo "::warning::No open PR found. This workflow run might not be attached to an open PR."
55+
exit 0
56+
57+
call-ci-failure-bot:
58+
needs: find-pr
59+
if: ${{ needs.find-pr.outputs.pr_number != '' }}
60+
uses: openwisp/openwisp-utils/.github/workflows/reusable-bot-ci-failure.yml@master
61+
with:
62+
pr_number: ${{ needs.find-pr.outputs.pr_number }}
63+
head_sha: ${{ github.event.workflow_run.head_sha }}
64+
head_repo: ${{ github.event.workflow_run.head_repository.full_name }}
65+
base_repo: ${{ github.repository }}
66+
run_id: ${{ github.event.workflow_run.id }}
67+
pr_author: ${{ github.event.workflow_run.actor.login }}
68+
actor: ${{ github.actor }}
69+
secrets:
70+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
71+
APP_ID: ${{ secrets.OPENWISP_BOT_APP_ID }}
72+
PRIVATE_KEY: ${{ secrets.OPENWISP_BOT_PRIVATE_KEY }}

CHANGES.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ Version 1.3.0 [unreleased]
66

77
Work in progress.
88

9+
Version 1.2.2 [2026-03-06]
10+
--------------------------
11+
12+
Changes
13+
~~~~~~~
14+
15+
Other changes
16+
+++++++++++++
17+
18+
- Improved help text of configuration variable fields
19+
- Minor fixes in the test suite
20+
21+
Version 1.2.1 [2026-03-04]
22+
--------------------------
23+
24+
Bugfixes
25+
~~~~~~~~
26+
27+
- Use context variables in Vpn.auto_client for OpenVPN backend
28+
- Fixed 500 FieldError in DeviceLocationView `#1110
29+
<https://github.com/openwisp/openwisp-controller/issues/1110>`_
30+
- Fixed MultiValueDictKeyError on empty device form submission `#1057
31+
<https://github.com/openwisp/openwisp-controller/issues/1057>`_
32+
933
Version 1.2.0 [2025-10-24]
1034
--------------------------
1135

openwisp_controller/config/base/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ class AbstractConfig(ChecksumCacheMixin, BaseConfig):
8585
blank=True,
8686
default=dict,
8787
help_text=_(
88-
"Additional "
89-
'<a href="http://netjsonconfig.openwisp.org/'
90-
'en/stable/general/basics.html#context" target="_blank">'
91-
"context (configuration variables)</a> in JSON format"
88+
"allows overriding "
89+
'<a href="https://openwisp.io/docs/stable/controller/user/variables.html'
90+
'" target="_blank">'
91+
"configuration variables</a>"
9292
),
9393
load_kwargs={"object_pairs_hook": collections.OrderedDict},
9494
dump_kwargs={"indent": 4},

openwisp_controller/config/base/device_group.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ class AbstractDeviceGroup(OrgMixin, TimeStampedEditableModel):
4242
load_kwargs={"object_pairs_hook": collections.OrderedDict},
4343
dump_kwargs={"indent": 4},
4444
help_text=_(
45-
"Group meta data, use this field to store data which is related"
46-
" to this group and can be retrieved via the REST API."
45+
"Store custom metadata related to this group. This field is intended "
46+
"for arbitrary data that does not affect device configuration and can "
47+
"be retrieved via the REST API for integrations or external tools."
4748
),
4849
verbose_name=_("Metadata"),
4950
)
@@ -53,8 +54,7 @@ class AbstractDeviceGroup(OrgMixin, TimeStampedEditableModel):
5354
load_kwargs={"object_pairs_hook": collections.OrderedDict},
5455
dump_kwargs={"indent": 4},
5556
help_text=_(
56-
"This field can be used to add meta data for the group"
57-
' or to add "Configuration Variables" to the devices.'
57+
"Define configuration variables available to all devices in this group"
5858
),
5959
verbose_name=_("Configuration Variables"),
6060
)

openwisp_controller/config/base/multitenancy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class AbstractOrganizationConfigSettings(UUIDModel):
5050
load_kwargs={"object_pairs_hook": collections.OrderedDict},
5151
dump_kwargs={"indent": 4},
5252
help_text=_(
53-
'This field can be used to add "Configuration Variables"' " to the devices."
53+
"Define reusable configuration variables available "
54+
"to all devices in this organization"
5455
),
5556
verbose_name=_("Configuration Variables"),
5657
)

openwisp_controller/config/base/template.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ class AbstractTemplate(ShareableOrgMixinUniqueName, BaseConfig):
9797
default=dict,
9898
blank=True,
9999
help_text=_(
100-
"A dictionary containing the default "
101-
"values for the variables used by this "
102-
"template; these default variables will "
103-
"be used during schema validation."
100+
"Define default values for the variables used in this template. "
101+
"These values are used during validation and when a variable is "
102+
"not provided by the device, group, or organization."
104103
),
105104
load_kwargs={"object_pairs_hook": OrderedDict},
106105
dump_kwargs={"indent": 4},

openwisp_controller/config/migrations/0023_update_context.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ class Migration(migrations.Migration):
1818
default=dict,
1919
dump_kwargs={"ensure_ascii": False, "indent": 4},
2020
help_text=(
21-
'Additional <a href="http://netjsonconfig.openwisp.org'
22-
'/en/stable/general/basics.html#context" target="_blank">'
23-
"context (configuration variables)</a> in JSON format"
21+
"allows overriding "
22+
'<a href="https://openwisp.io/docs/stable/controller/user/variables.html' # noqa: E501
23+
'" target="_blank">'
24+
"configuration variables</a>"
2425
),
2526
load_kwargs={"object_pairs_hook": collections.OrderedDict},
2627
),

openwisp_controller/config/migrations/0028_template_default_values.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class Migration(migrations.Migration):
1818
default=dict,
1919
dump_kwargs={"ensure_ascii": False, "indent": 4},
2020
help_text=(
21-
"A dictionary containing the default values for "
22-
"the variables used by this template; these default "
23-
"variables will be used during schema validation."
21+
"Define default values for the variables used in this template. "
22+
"These values are used during validation and when a variable is "
23+
"not provided by the device, group, or organization."
2424
),
2525
load_kwargs={"object_pairs_hook": collections.OrderedDict},
2626
verbose_name="Default Values",

openwisp_controller/config/migrations/0036_device_group.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ class Migration(migrations.Migration):
6262
dump_kwargs={"ensure_ascii": False, "indent": 4},
6363
load_kwargs={"object_pairs_hook": collections.OrderedDict},
6464
help_text=(
65-
"Group meta data, use this field to store data which is"
66-
" related to this group and can be retrieved via the"
67-
" REST API."
65+
"Store custom metadata related to this group. "
66+
"This field is intended for arbitrary data that "
67+
"does not affect device configuration and can "
68+
"be retrieved via the REST API for integrations "
69+
"or external tools."
6870
),
6971
verbose_name="Metadata",
7072
),

openwisp_controller/config/migrations/0049_devicegroup_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class Migration(migrations.Migration):
2020
default=dict,
2121
dump_kwargs={"ensure_ascii": False, "indent": 4},
2222
help_text=(
23-
"This field can be used to add meta data for the group"
24-
' or to add "Configuration Variables" to the devices.'
23+
"Define configuration variables available "
24+
"to all devices in this group"
2525
),
2626
load_kwargs={"object_pairs_hook": collections.OrderedDict},
2727
verbose_name="Configuration Variables",

0 commit comments

Comments
 (0)