Skip to content

Commit d23d31e

Browse files
authored
Merge branch 'librenms:master' into master
2 parents a070f9a + 4ab8730 commit d23d31e

5,521 files changed

Lines changed: 3754715 additions & 742021 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ DO NOT DELETE THE UNDERLYING TEXT
44

55
#### Please note
66

7-
> Please read this information carefully. You can run `./lnms dev:check` to check your code before submitting.
7+
> Please read this information carefully. Pull requests may be closed without explanation
8+
> due to influx of low quality LLM generated pull requests.
9+
> You can run `./lnms dev:check` to check your code before submitting.
810
911
- [ ] Have you followed our [code guidelines?](https://docs.librenms.org/Developing/Code-Guidelines/)
1012
- [ ] If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.

.github/ci-reporter.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/lock.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/no-response.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/stale.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/announcements.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ jobs:
1212

1313
steps:
1414
- name: Send Notification to Discord
15-
if: contains(github.event.issue.labels.*.name, 'Breaking-Change')
15+
if: contains(github.event.pull_request.labels.*.name, 'Breaking-Change')
1616
env:
17-
DISCORD_WEBHOOK_URL: "${{ secrets.DISCORD_WEBHOOK_URL_ANNOUNCEMENT }}"
17+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL_ANNOUNCEMENT }}
18+
PR_TITLE: ${{ github.event.pull_request.title }}
19+
PR_MESSAGE: ${{ github.event.pull_request.body }}
20+
PR_URL: ${{ github.event.pull_request.html_url }}
1821
run: |
19-
PR_TITLE="${{ github.event.pull_request.title }}"
20-
PR_MESSAGE="${{ github.event.pull_request.body }}"
21-
PR_URL="${{ github.event.pull_request.html_url }}"
22-
22+
PAYLOAD=$(jq -n \
23+
--arg title "$PR_TITLE" \
24+
--arg url "$PR_URL" \
25+
--arg body "$PR_MESSAGE" \
26+
'{content: ":rotating_light: A breaking change pull request has been merged! :rotating_light:\n\n**Title**: \($title)\n[View PR](\($url))\n\n\($body)"}')
27+
2328
curl -X POST -H "Content-Type: application/json" \
24-
-d "{
25-
\"content\": \":rotating_light: A breaking change pull request has been merged! :rotating_light: \n\n**Title**: $PR_TITLE\n[View PR]($PR_URL)\n\n$PR_MESSAGE\"
26-
}" \
27-
$DISCORD_WEBHOOK_URL
29+
-d "$PAYLOAD" \
30+
"$DISCORD_WEBHOOK_URL"

.github/workflows/doc.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ on:
2121
permissions:
2222
contents: read # to fetch code (actions/checkout)
2323

24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
26+
cancel-in-progress: true
27+
2428
jobs:
2529
publish:
2630
runs-on: ubuntu-latest
2731
steps:
2832
-
2933
name: Checkout
30-
uses: actions/checkout@v4
34+
uses: actions/checkout@v6
3135
with:
3236
fetch-depth: 0
3337
sparse-checkout-cone-mode: false
@@ -47,7 +51,7 @@ jobs:
4751
echo "Problems found:" && (grep -F 'no such' output.log && exit 1 || echo "None, Good job :)")
4852
-
4953
name: Check GitHub Pages status
50-
uses: crazy-max/ghaction-github-status@v4
54+
uses: crazy-max/ghaction-github-status@v5
5155
with:
5256
pages_threshold: major_outage
5357
-

.github/workflows/label-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
action:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: dessant/label-actions@v4
21+
- uses: dessant/label-actions@v5

.github/workflows/lint.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
permissions:
88
contents: read # to fetch code (actions/checkout)
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
super-linter:
1216
permissions:
@@ -18,7 +22,7 @@ jobs:
1822

1923
steps:
2024
- name: Checkout Code
21-
uses: actions/checkout@v5
25+
uses: actions/checkout@v6
2226
with:
2327
fetch-depth: 0
2428
sparse-checkout-cone-mode: false
@@ -47,8 +51,9 @@ jobs:
4751
fail-fast: false
4852
steps:
4953
- name: Checkout Code
50-
uses: actions/checkout@v5
54+
uses: actions/checkout@v6
5155
with:
56+
fetch-depth: 2
5257
sparse-checkout-cone-mode: false
5358
sparse-checkout: |
5459
/*
@@ -62,7 +67,7 @@ jobs:
6267
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6368

6469
- name: Cache composer
65-
uses: actions/cache@v4
70+
uses: actions/cache@v5
6671
with:
6772
path: ${{ steps.composer-cache.outputs.dir }}
6873
key: ${{ runner.os }}-composer-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/composer.lock') }}
@@ -74,6 +79,21 @@ jobs:
7479
- name: Composer dump
7580
run: composer dump --strict-psr --strict-ambiguous --no-interaction --no-scripts
7681

82+
- name: Find new PHP files
83+
if: github.event_name == 'pull_request'
84+
id: new-php-files
85+
run: |
86+
# HEAD is the PR merge commit, HEAD~1 is its first parent (base branch tip)
87+
NEW_PHP_FILES=$(git diff -z --diff-filter=A --name-only HEAD~1 HEAD -- 'app/**.php' 'bootstrap/**.php' 'config/**.php' 'database/**.php' 'LibreNMS/**.php' 'resources/**.php' 'routes/**.php' 'tests/**.php' | xargs -0)
88+
echo "Discovered new PHP files: $NEW_PHP_FILES"
89+
echo "files=$NEW_PHP_FILES" >> "$GITHUB_OUTPUT"
90+
91+
- name: Run PHPStan (New files, level 6)
92+
if: github.event_name == 'pull_request' && steps.new-php-files.outputs.files != ''
93+
env:
94+
NEW_PHP_FILES: ${{ steps.new-php-files.outputs.files }}
95+
run: ./vendor/bin/phpstan analyze --no-interaction --memory-limit=4G --level=6 -- $NEW_PHP_FILES
96+
7797
- name: Run PHPStan
7898
run: ./vendor/bin/phpstan analyze --no-interaction --memory-limit=4G
7999

@@ -88,7 +108,7 @@ jobs:
88108
runs-on: ubuntu-latest
89109
steps:
90110
- name: Checkout Code
91-
uses: actions/checkout@v5
111+
uses: actions/checkout@v6
92112
with:
93113
sparse-checkout-cone-mode: false
94114
sparse-checkout: |
@@ -103,7 +123,7 @@ jobs:
103123
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
104124

105125
- name: Cache composer
106-
uses: actions/cache@v4
126+
uses: actions/cache@v5
107127
with:
108128
path: ${{ steps.composer-cache.outputs.dir }}
109129
key: ${{ runner.os }}-composer-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/composer.lock') }}

.github/workflows/test.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
permissions:
1212
contents: read # to fetch code (actions/checkout)
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
test:
1620
name: ${{ matrix.name }} ${{ matrix.arguments }}
@@ -19,7 +23,6 @@ jobs:
1923
fail-fast: false
2024
matrix:
2125
php-version:
22-
- 8.2
2326
- 8.4
2427
arguments:
2528
- --os a
@@ -31,10 +34,6 @@ jobs:
3134
- --os t
3235
- --os u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9
3336
include:
34-
-
35-
name: PHP 8.2
36-
php-version: 8.2
37-
database: mysql:8.0
3837
-
3938
name: PHP 8.4
4039
php-version: 8.4
@@ -44,6 +43,11 @@ jobs:
4443
php-version: 8.4
4544
database: mariadb:11.7
4645
arguments: --full --exclude-phpunit-group=browser,mibs,external-dependencies,os
46+
-
47+
name: Other
48+
php-version: 8.2
49+
database: mysql:8.0
50+
arguments: --full --exclude-phpunit-group=browser,mibs,external-dependencies,os
4751

4852
services:
4953
database:
@@ -58,13 +62,13 @@ jobs:
5862
steps:
5963
-
6064
name: Checkout
61-
uses: actions/checkout@v5
65+
uses: actions/checkout@v6
6266
-
6367
name: Set up PHP
6468
uses: shivammathur/setup-php@v2
6569
with:
6670
php-version: ${{ matrix.php-version }}
67-
tools: composer,php-cs-fixer
71+
tools: composer
6872
coverage: none
6973
-
7074
name: Get composer cache directory
@@ -73,15 +77,15 @@ jobs:
7377
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
7478
-
7579
name: Cache composer
76-
uses: actions/cache@v4
80+
uses: actions/cache@v5
7781
with:
7882
path: ${{ steps.composer-cache.outputs.dir }}
7983
key: ${{ runner.os }}-composer-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/composer.lock') }}
8084
restore-keys: |
8185
${{ runner.os }}-composer-${{ secrets.CACHE_VERSION }}-
8286
-
8387
name: Cache pip
84-
uses: actions/cache@v4
88+
uses: actions/cache@v5
8589
with:
8690
path: ~/.cache/pip
8791
key: ${{ runner.os }}-pip-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/requirements.txt') }}
@@ -103,6 +107,7 @@ jobs:
103107
APP_KEY=base64:vHI+YHgkyCDad31iPEErGSNEOWO21wNzV+zyENKQv04=
104108
APP_URL=http://127.0.0.1:8000
105109
APP_ENV=testing
110+
APP_DEBUG=true
106111
DB_DRIVER=mysql
107112
DB_HOST=127.0.0.1
108113
DB_PORT=${{ job.services.database.ports[3306] }}
@@ -159,6 +164,8 @@ jobs:
159164
name: Start SNMPSIM
160165
run: |
161166
.python_venvs/snmpsim/bin/snmpsim-command-responder-lite --data-dir=tests/snmpsim --agent-udpv4-endpoint=127.1.6.2:1162 --log-level=error --logging-method=file:/tmp/snmpsimd.log &
167+
# Wait for the UDP port to open / snmpsim to start
168+
timeout 10 bash -c 'until nc -z -u 127.1.6.2 1162; do sleep 0.1; done' || true
162169
163170
-
164171
name: lnms dev:check ci
@@ -179,4 +186,11 @@ jobs:
179186
-
180187
name: Dump context
181188
if: always()
182-
uses: crazy-max/ghaction-dump-context@v1
189+
uses: crazy-max/ghaction-dump-context@v3
190+
-
191+
name: Upload LibreNMS Logs
192+
if: failure()
193+
uses: actions/upload-artifact@v7
194+
with:
195+
name: librenms-logs-${{ matrix.name }}-${{ strategy.job-index }}
196+
path: logs/librenms.log

0 commit comments

Comments
 (0)