Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
183 lines (152 loc) · 7.57 KB
/
Copy pathMakefile
File metadata and controls
183 lines (152 loc) · 7.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
GOLANGCI_LINT_MODULE := github.com/golangci/golangci-lint/v2/cmd/golangci-lint
GOVULNCHECK_MODULE := golang.org/x/vuln/cmd/govulncheck
GO_LICENSES_MODULE := github.com/google/go-licenses/v2
QUALITY_TOOLS_DIRECTORY := tools/quality
QUALITY_TOOL := go tool -modfile="$(QUALITY_TOOLS_DIRECTORY)/go.mod"
GOLANGCI_LINT := $(QUALITY_TOOL) golangci-lint
GOVULNCHECK := $(QUALITY_TOOL) govulncheck
GO_LICENSES := $(QUALITY_TOOL) go-licenses
QUALITY_GOVULNCHECK := go -C $(QUALITY_TOOLS_DIRECTORY) tool govulncheck
QUALITY_GO_LICENSES := go -C $(QUALITY_TOOLS_DIRECTORY) tool go-licenses
ACTIONLINT := go -C tools/actionlint tool actionlint
TOOL_PACKAGES := \
$(GOLANGCI_LINT_MODULE) \
$(GOVULNCHECK_MODULE) \
$(GO_LICENSES_MODULE)
RUNTIME_ALLOWED_LICENSES := Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC,MIT,PostgreSQL
DEVELOPMENT_ALLOWED_LICENSES := $(RUNTIME_ALLOWED_LICENSES),MPL-2.0
# These packages are reachable only from repository development tools. Their
# reviewed exceptions and non-distribution constraint are documented in the
# dependency policy; application and test dependencies receive no exceptions.
TOOL_LICENSE_EXCEPTIONS := \
--ignore github.com/OpenPeeDeeP/depguard/v2 \
--ignore github.com/alecthomas/chroma/v2 \
--ignore github.com/ashanbrown/forbidigo/v2 \
--ignore github.com/ashanbrown/makezero/v2 \
--ignore github.com/denis-tingaikin/go-header \
--ignore github.com/firefart/nonamedreturns \
--ignore github.com/golangci/gofmt \
--ignore github.com/golangci/golangci-lint/v2 \
--ignore github.com/ldez/structtags \
--ignore github.com/leonklingele/grouper \
--ignore github.com/xen0n/gosmopolitan
.PHONY: help bootstrap doctor build binaries generate-contracts fmt fmt-check docs-check architecture-check ci-policy-check check test verify api-validate ui-validate race fuzz-smoke db-validate dbos-evaluate vuln license supply-chain validate
.PHONY: predictive-validate
help:
@echo Argus engineering-foundation command surface
@echo make bootstrap Resolve all pinned repository dependencies
@echo make doctor Report the effective local development toolchain
@echo make build Compile all Go commands without writing repository artifacts
@echo make binaries Build runnable Go commands under bin
@echo make generate-contracts Regenerate JSON Schema from Effect Schema
@echo make fmt Format Go and TypeScript sources
@echo make fmt-check Verify formatting without changes
@echo make docs-check Verify repository-local documentation policy and links
@echo make architecture-check Verify the complete production dependency matrix
@echo make ci-policy-check Verify CI job names, runners, and verification targets
@echo make check Run format, lint, static-analysis, and module checks
@echo make test Run ordinary tests without cached results
@echo make verify Run the fast network-independent development feedback loop
@echo make predictive-validate Run focused predictive evidence tests
@echo make api-validate Run the disposable Playwright API reference campaign
@echo make ui-validate Run the real Chromium browser execution campaign
@echo make race Run all tests with the race detector
@echo make fuzz-smoke Run bounded native fuzzing of untrusted Go inputs
@echo make db-validate Run PostgreSQL integration tests against a disposable local server
@echo make dbos-evaluate Run self-provisioned DBOS safety, compatibility, and cost evaluation
@echo make vuln Scan reachable dependencies for known vulnerabilities
@echo make license Enforce runtime and development-tool license policy
@echo make supply-chain Run vulnerability and license checks
@echo make validate Run all non-mutating acceptance checks
# Focused entry point. The same packages already run in verify's full test gate;
# do not execute them a second time in CI merely through this alias.
predictive-validate:
go test -vet=off -count=1 ./internal/predictive/...
bootstrap:
go mod download
go -C $(QUALITY_TOOLS_DIRECTORY) mod download
go -C tools/actionlint mod download
pnpm install --frozen-lockfile
pnpm --dir examples/functional-api/test-repository install --frozen-lockfile
pnpm --dir examples/functional-api/billing-test-repository install --frozen-lockfile
pnpm --dir examples/functional-api/repair-test-repository install --frozen-lockfile
doctor:
@git --version
@go version
@go env -json GOVERSION GOOS GOARCH GOTOOLCHAIN CGO_ENABLED
@node --version
@pnpm --version
@$(MAKE) --version
build:
go build ./cmd/...
binaries:
go build -o bin/ ./cmd/...
generate-contracts:
pnpm contracts:generate
fmt:
$(GOLANGCI_LINT) fmt
pnpm format
fmt-check:
$(GOLANGCI_LINT) fmt --diff
pnpm format:check
docs-check:
go run ./tools/repo-check
architecture-check:
go test -vet=off -count=1 ./internal/architecture
# Offline detection of accidental CI workflow drift. Merge decisions are made
# by the reviewer under the current manual pre-merge workflow.
ci-policy-check:
go test -vet=off -count=1 ./tools/ci-policy-check
check: fmt-check docs-check architecture-check
pnpm contracts:check
pnpm typecheck
$(GOLANGCI_LINT) config verify
$(GOLANGCI_LINT) run --timeout=10m ./...
$(GOLANGCI_LINT) run --timeout=10m --build-tags=dbose2e ./cmd/control-plane
$(ACTIONLINT)
go mod tidy -diff
go mod verify
go -C $(QUALITY_TOOLS_DIRECTORY) mod tidy -diff
go -C $(QUALITY_TOOLS_DIRECTORY) mod verify
go -C tools/actionlint mod tidy -diff
go -C tools/actionlint mod verify
test:
go test -vet=off -count=1 ./...
pnpm test
verify: build check test api-validate
api-validate:
pnpm api-validate
ui-validate:
go test -vet=off -tags=browserintegration -count=1 -timeout=10m ./internal/execution/browser ./internal/adaptation/browserlocator ./internal/adaptation/browservalidation
race:
go test -vet=off -race -count=1 ./...
# Ordinary go test already executes each fuzz target's seed corpus. This
# separate, bounded campaign is a T3 developer sensor, not a CI merge gate.
fuzz-smoke:
go test -run '^$$' -fuzz '^FuzzTestCatalogCursor$$' -fuzztime=2s ./internal/catalog/testquery
go test -run '^$$' -fuzz '^FuzzImpactEdgeCursor$$' -fuzztime=2s ./internal/catalog/impact
go test -run '^$$' -fuzz '^FuzzWebhookDecode$$' -fuzztime=2s ./internal/change/adapters/github
go test -run '^$$' -fuzz '^FuzzOpenAPIDocumentParsing$$' -fuzztime=2s ./internal/change/adapters/openapi
go test -run '^$$' -fuzz '^FuzzProcessResultDecoding$$' -fuzztime=2s ./internal/contracts
go test -run '^$$' -fuzz '^FuzzSourcePath$$' -fuzztime=2s ./internal/adaptation
db-validate:
go test -vet=off -tags=integration -race -count=1 -timeout=5m ./internal/postgres
# No database URL or credentials: tests own containers, migrations, mock
# GitHub, child workers, and teardown. Raw reports stay under .local/.
dbos-evaluate:
go test -tags=dbose2e -race -count=1 -timeout=15m ./cmd/control-plane
# Include the isolated DBOS end-to-end test dependency graph in supply-chain
# scans without requiring a container runtime to execute that test.
vuln license: export GOFLAGS := -tags=dbose2e
vuln:
$(GOVULNCHECK) ./...
$(QUALITY_GOVULNCHECK) $(TOOL_PACKAGES)
go -C tools/actionlint tool govulncheck github.com/rhysd/actionlint/cmd/actionlint
pnpm audit --prod --audit-level high
license:
$(GO_LICENSES) check --include_tests ./... --allowed_licenses $(RUNTIME_ALLOWED_LICENSES)
$(QUALITY_GO_LICENSES) check $(TOOL_PACKAGES) --allowed_licenses $(DEVELOPMENT_ALLOWED_LICENSES) $(TOOL_LICENSE_EXCEPTIONS)
go -C tools/actionlint tool go-licenses check github.com/rhysd/actionlint/cmd/actionlint --allowed_licenses $(RUNTIME_ALLOWED_LICENSES)
pnpm licenses:check
supply-chain: vuln license
validate: verify race supply-chain ci-policy-check