Skip to content

Commit 8adc1e3

Browse files
authored
CONTRIBUTING.md: add a dependency update policy, and nightly vulncheck (#678)
Add a section the our CONTRIBUTING.md describing when and how dependencies should be updated, and the criteria for adding a new dependency. Also, add a nightly workflow to run vulncheck. Fixes #635
1 parent 6a87ca8 commit 8adc1e3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Nightly
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *' # 2 AM UTC daily
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
vulncheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Run govulncheck
14+
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
15+
with:
16+
go-version-file: go.mod
17+
go-package: ./...

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,30 @@ copyright header following the format below:
105105
// license that can be found in the LICENSE file.
106106
```
107107

108+
### Adding and updating dependencies
109+
110+
In general, the SDK tries to use as few dependencies as possible. Each new
111+
dependency is a potential source for bugs, churn, and conflicts for our users.
112+
Therefore, we require a [proposal](#proposals) for any new module dependency,
113+
including upgrading an existing module to a new major version. New dependencies
114+
should be evaluated for their stability and security, and should be
115+
well-established in the Go ecosystem.
116+
117+
In general, dependencies should be for internal use by the SDK implementation,
118+
or for testing. Do not include types from dependencies in the SDK API.
119+
120+
On the other hand, updating existing dependencies can be done at any time
121+
without a proposal, as long as their major version does not change. Prefer to
122+
update dependencies immediately following a release of the SDK, to allow as
123+
much time as possible to find issues with the new version.
124+
125+
After any change to dependencies, run govulncheck to check them for
126+
vulnerabilities.
127+
128+
```
129+
go run golang.org/x/vuln/cmd/govulncheck@latest
130+
```
131+
108132
### Updating the README
109133

110134
The top-level `README.md` file is generated from `internal/readme/README.src.md`

0 commit comments

Comments
 (0)