Skip to content

Commit 7c15c35

Browse files
authored
harden dependency update handling (#571)
Add npm configuration that enforces a minimum release age, blocks git package refs, and requires the expected Node/npm engine versions. CI, release packaging, and Docker builds now use Node 24.14.1 with `npm ci` so installs follow the committed lockfile and project npm policy. Extend Dependabot coverage and cooldowns for Docker, Docker Compose, and GitHub Actions so regular dependency update PRs are delayed and reviewed through the usual workflow. Pin Docker and compose image refs to explicit patch tags and digests, including Postgres 18 for local development, so image changes happen through visible dependency updates instead of silent tag drift.
1 parent b4052c2 commit 7c15c35

10 files changed

Lines changed: 62 additions & 21 deletions

File tree

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ updates:
2020
directory: "/"
2121
schedule:
2222
interval: "monthly"
23+
cooldown:
24+
default-days: 7
2325
open-pull-requests-limit: 10
2426
labels:
2527
- "dependencies"
@@ -36,6 +38,21 @@ updates:
3638
update-types:
3739
["version-update:semver-major", "version-update:semver-minor"]
3840

41+
- package-ecosystem: "docker-compose"
42+
directory: "/"
43+
schedule:
44+
interval: "monthly"
45+
cooldown:
46+
default-days: 7
47+
open-pull-requests-limit: 10
48+
labels:
49+
- "dependencies"
50+
- "docker"
51+
commit-message:
52+
prefix: "docker"
53+
allow:
54+
- dependency-type: "direct"
55+
3956
- package-ecosystem: "gomod"
4057
directories:
4158
- "**/*"
@@ -84,3 +101,15 @@ updates:
84101
tanstack:
85102
patterns:
86103
- "@tanstack/*"
104+
105+
- package-ecosystem: "github-actions"
106+
directory: "/"
107+
schedule:
108+
interval: "monthly"
109+
cooldown:
110+
default-days: 7
111+
labels:
112+
- "dependencies"
113+
- "github-actions"
114+
commit-message:
115+
prefix: "github-actions"

.github/workflows/ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
strategy:
134134
matrix:
135135
node-version:
136-
- "22.18.0"
136+
- "24.14.1"
137137
fail-fast: false
138138
timeout-minutes: 5
139139

@@ -155,7 +155,7 @@ jobs:
155155
node-version: ${{ matrix.node-version }}
156156

157157
- name: Install dependencies
158-
run: npm install
158+
run: npm ci
159159
shell: sh
160160

161161
- name: Test 🧪
@@ -170,7 +170,7 @@ jobs:
170170
strategy:
171171
matrix:
172172
node-version:
173-
- "22.18.0"
173+
- "24.14.1"
174174
fail-fast: false
175175
timeout-minutes: 5
176176

@@ -189,7 +189,7 @@ jobs:
189189
node-version: ${{ matrix.node-version }}
190190

191191
- name: Install dependencies
192-
run: npm install
192+
run: npm ci
193193
shell: sh
194194

195195
- name: Cache ESLint
@@ -231,10 +231,10 @@ jobs:
231231
with:
232232
cache: "npm"
233233
cache-dependency-path: package-lock.json
234-
node-version: "22.18.0"
234+
node-version: "24.14.1"
235235

236236
- name: Install dependencies
237-
run: npm install
237+
run: npm ci
238238
shell: sh
239239

240240
- name: Build UI bundle

.github/workflows/package-and-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ jobs:
5959
with:
6060
cache: "npm"
6161
cache-dependency-path: package-lock.json
62-
node-version: "22.18.0"
62+
node-version: "24.14.1"
6363

6464
- name: Install dependencies
65-
run: npm install
65+
run: npm ci
6666
shell: sh
6767

6868
- name: Build JS 🏗️

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
allow-git=none
2+
engine-strict=true
3+
min-release-age=3

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ public/**
1010
src/routeTree.gen.ts
1111

1212
# Other files to ignore
13-
package-lock.json
13+
package-lock.json
14+
.npmrc

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM node:22-alpine AS build-ui
3+
FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5 AS build-ui
44
WORKDIR /app
5-
COPY package.json package-lock.json ./
6-
RUN npm install
5+
COPY .npmrc package.json package-lock.json ./
6+
RUN npm ci
77
ENV NODE_ENV=production
88
COPY vite.config.ts tsconfig.json tsconfig.node.json tsr.config.json ./
99
COPY public ./public
@@ -12,7 +12,7 @@ COPY src ./src
1212
RUN npx vite build
1313

1414
# Build the Go binary, including embedded UI files:
15-
FROM golang:1.25.9-alpine AS build-go
15+
FROM golang:1.25.10-alpine@sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45 AS build-go
1616
WORKDIR /go/src/riverui
1717

1818
COPY go.mod go.sum ./
@@ -29,7 +29,7 @@ COPY --from=build-ui /app/dist ./dist
2929

3030
RUN go build -trimpath -ldflags="-w -s -buildid=" -o /bin/riverui ./cmd/riverui
3131

32-
FROM alpine:3.23.4
32+
FROM alpine:3.23.4@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11
3333
ENV PATH_PREFIX="/"
3434
COPY --from=build-go /bin/riverui /bin/riverui
3535
CMD ["/bin/sh", "-c", "/bin/riverui -prefix=$PATH_PREFIX"]

Dockerfile.pro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM node:22-alpine AS build-ui
3+
FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5 AS build-ui
44
WORKDIR /app
5-
COPY package.json package-lock.json ./
6-
RUN npm install
5+
COPY .npmrc package.json package-lock.json ./
6+
RUN npm ci
77
ENV NODE_ENV=production
88
COPY vite.config.ts tsconfig.json tsconfig.node.json tsr.config.json ./
99
COPY public ./public
@@ -12,7 +12,7 @@ COPY src ./src
1212
RUN npx vite build
1313

1414
# Build the Go binary, including embedded UI files:
15-
FROM golang:1.25.9-alpine AS build-go
15+
FROM golang:1.25.10-alpine@sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45 AS build-go
1616
WORKDIR /go/src/riverui
1717

1818
# Download main module dependencies first
@@ -42,7 +42,7 @@ COPY --from=build-ui /app/dist ./dist
4242
WORKDIR /go/src/riverui/riverproui
4343
RUN go build -trimpath -ldflags="-w -s -buildid=" -o /bin/riverproui ./cmd/riverproui
4444

45-
FROM alpine:3.23.4
45+
FROM alpine:3.23.4@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11
4646
ENV PATH_PREFIX="/"
4747
COPY --from=build-go /bin/riverproui /bin/riverproui
4848
CMD ["/bin/sh", "-c", "/bin/riverproui -prefix=$PATH_PREFIX"]

docker-compose.dev.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: riverui-dev
22

33
services:
44
postgres:
5-
image: "postgres:16-alpine"
5+
image: "postgres:18.3-alpine@sha256:54451ecb8ab38c24c3ec123f2fd501303a3a1856a5c66e98cecf2460d5e1e9d7"
66
environment:
77
- POSTGRES_USER=postgres
88
- POSTGRES_PASSWORD=postgres
@@ -16,7 +16,7 @@ services:
1616
ports:
1717
- "5432:5432"
1818
migrate:
19-
image: "golang:1.25-alpine"
19+
image: "golang:1.25.10-alpine@sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45"
2020
depends_on:
2121
postgres:
2222
condition: "service_healthy"

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
6+
"engines": {
7+
"node": ">=24.14.1",
8+
"npm": ">=11.10.0"
9+
},
610
"dependencies": {
711
"@dagrejs/dagre": "^3.0.0",
812
"@headlessui/react": "^2.2.10",

0 commit comments

Comments
 (0)