Skip to content

Commit 25ff6f5

Browse files
authored
Merge pull request #1541 from kernelkit/web-vendoring
Use kernelkit/goyang instead of patched builtin
2 parents e28532d + a365238 commit 25ff6f5

84 files changed

Lines changed: 103 additions & 21177 deletions

Some content is hidden

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

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /src/webui
5+
schedule:
6+
interval: weekly
7+
# goyang is pinned to our kernelkit fork via a replace directive and
8+
# stepped by hand when we add patches; leave it for Dependabot to ignore.
9+
ignore:
10+
- dependency-name: github.com/openconfig/goyang
11+
12+
- package-ecosystem: gomod
13+
directory: /src/netbrowse
14+
schedule:
15+
interval: weekly

.github/workflows/govulncheck.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Go Vulnerability Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/webui/**'
9+
- 'src/netbrowse/**'
10+
- '.github/workflows/govulncheck.yml'
11+
pull_request:
12+
paths:
13+
- 'src/webui/**'
14+
- 'src/netbrowse/**'
15+
- '.github/workflows/govulncheck.yml'
16+
schedule:
17+
- cron: '5 0 * * 6' # Saturday at 00:05 UTC, same as Coverity
18+
workflow_dispatch:
19+
20+
jobs:
21+
govulncheck:
22+
if: ${{ github.repository_owner == 'kernelkit' }}
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
module:
28+
- src/webui
29+
- src/netbrowse
30+
steps:
31+
- uses: actions/checkout@v6
32+
33+
- uses: actions/setup-go@v6
34+
with:
35+
go-version: stable
36+
37+
- name: Install govulncheck
38+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
39+
40+
- name: Scan ${{ matrix.module }}
41+
working-directory: ${{ matrix.module }}
42+
run: |
43+
# Full report, for the run summary. govulncheck exits non-zero
44+
# whenever it finds anything, so don't let it fail the step here.
45+
{
46+
echo "## govulncheck: ${{ matrix.module }}"
47+
echo '```'
48+
govulncheck ./... || true
49+
echo '```'
50+
} | tee -a "$GITHUB_STEP_SUMMARY"
51+
52+
# Gate on vulnerabilities reachable from our code through a
53+
# dependency. govulncheck's call-graph analysis is transitive,
54+
# so indirect use counts too (we call a dep that calls the bad
55+
# symbol). trace[0] is the vulnerable symbol; we key on the
56+
# module it lives in. A chain that bottoms out in stdlib is
57+
# fixed by bumping the Buildroot host Go, not this module's
58+
# go.mod, so it's reported above but doesn't fail the build.
59+
# Keep the json scan and jq unguarded so a tool failure fails the
60+
# gate closed; only grep's no-match exit (all-clear) is tolerated.
61+
govulncheck -format json ./... > scan.json || true
62+
called=$(jq -r 'select(.finding.trace[0].function != null) |
63+
.finding.trace[0].module' scan.json | sort -u)
64+
vulns=$(printf '%s' "$called" | grep -vx stdlib || true)
65+
if [ -n "$vulns" ]; then
66+
echo "::error::Called vulnerabilities in dependencies: $(echo "$vulns" | paste -sd, -)"
67+
exit 1
68+
fi

src/webui/go.mod

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ go 1.22.0
44

55
toolchain go1.22.2
66

7-
require (
8-
github.com/google/go-cmp v0.7.0 // indirect
9-
github.com/openconfig/goyang v1.6.3 // indirect
10-
github.com/pborman/getopt v1.1.0 // indirect
11-
)
7+
require github.com/openconfig/goyang v1.6.3
128

13-
// Local fork of goyang with YANG 1.1 fixes:
14-
// - Uses.Augment: *Augment → []*Augment (multiple augments per uses)
15-
// - Value: add Reference field (when { reference "..."; })
16-
// - Input/Output: add Must field (must statements in rpc input/output)
17-
replace github.com/openconfig/goyang => ./internal/goyang
9+
require github.com/google/go-cmp v0.7.0 // indirect
10+
11+
// kernelkit/goyang fork carrying our YANG 1.1 fixes: reference on Value,
12+
// multiple uses-augments, and must in rpc input/output.
13+
replace github.com/openconfig/goyang => github.com/kernelkit/goyang v1.6.4-0.20260617163501-afcacf84230c

src/webui/go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
22
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
3-
github.com/openconfig/goyang v1.6.3 h1:9nWXBwd6b4+nZr8ni7O4zUXVhrVMXCLFz8os5YWFuo4=
4-
github.com/openconfig/goyang v1.6.3/go.mod h1:5WolITjek1NF8yrNERyVZ7jqjOClJTpO8p/+OwmETM4=
5-
github.com/pborman/getopt v1.1.0 h1:eJ3aFZroQqq0bWmraivjQNt6Dmm5M0h2JcDW38/Azb0=
6-
github.com/pborman/getopt v1.1.0/go.mod h1:FxXoW1Re00sQG/+KIkuSqRL/LwQgSkv7uyac+STFsbk=
3+
github.com/kernelkit/goyang v1.6.4-0.20260617163501-afcacf84230c h1:CFApC5asdQoMmQZ1YdP2fDX38K37vObCH8EEKeMFHE8=
4+
github.com/kernelkit/goyang v1.6.4-0.20260617163501-afcacf84230c/go.mod h1:5WolITjek1NF8yrNERyVZ7jqjOClJTpO8p/+OwmETM4=
5+
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
6+
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
7+
github.com/openconfig/gnmi v0.14.1 h1:qKMuFvhIRR2/xxCOsStPQ25aKpbMDdWr3kI+nP9bhMs=
8+
github.com/openconfig/gnmi v0.14.1/go.mod h1:whr6zVq9PCU8mV1D0K9v7Ajd3+swoN6Yam9n8OH3eT0=

src/webui/internal/goyang/.github/dependabot.yml

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

src/webui/internal/goyang/.github/linters/.golangci.yml

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

src/webui/internal/goyang/.github/linters/.yaml-lint.yml

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

src/webui/internal/goyang/.github/workflows/go.yml

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

src/webui/internal/goyang/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/webui/internal/goyang/AUTHORS

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

0 commit comments

Comments
 (0)