Skip to content

Commit 0153d0c

Browse files
feat: enhance CI workflow with Go version matrix and update example documentation
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
1 parent 4bb4818 commit 0153d0c

File tree

7 files changed

+50
-28
lines changed

7 files changed

+50
-28
lines changed

.github/workflows/regression-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
jobs:
2020
integration-tests:
2121
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
go-version: ['1.23.12', '1.24.11', '1.25.5']
25+
fail-fast: false
2226

2327
steps:
2428
- name: Checkout code
@@ -27,7 +31,7 @@ jobs:
2731
- name: Set up Go
2832
uses: actions/setup-go@v6
2933
with:
30-
go-version: '1.24'
34+
go-version: ${{ matrix.go-version }}
3135
check-latest: true
3236

3337
- name: Build fabrica

examples/03-fru-service/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ SPDX-License-Identifier: MIT
1010
**Difficulty:** Advanced
1111
**Prerequisites:** Go 1.23+, fabrica CLI installed, SQLite3
1212

13+
> **About This Example:** This directory contains reference code that demonstrates Fabrica's Ent storage features. The `pkg/` directory includes example implementations marked with `//go:build ignore` to prevent them from being compiled as part of the Fabrica repository. When following this guide, you'll generate your own project with Fabrica, and these files serve as documentation and reference.
14+
1315
## What You'll Build
1416

1517
A Field Replaceable Unit (FRU) inventory service with:

examples/03-fru-service/pkg/resources/fru/fru.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//go:build ignore
2+
3+
// The line above is necessary to prevent this file from being included in the main build of fabrica. You may need to remove it to succeed with the example.
4+
//
15
// Copyright © 2025 OpenCHAMI a Series of LF Projects, LLC
26
//
37
// SPDX-License-Identifier: MIT

examples/04-rack-reconciliation/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ SPDX-License-Identifier: MIT
1010
**Difficulty:** Advanced
1111
**Prerequisites:** Go 1.23+, fabrica CLI installed, understanding of reconciliation patterns
1212

13+
> **About This Example:** This directory contains reference code that demonstrates Fabrica's reconciliation features. The `pkg/` directory includes example implementations marked with `//go:build ignore` to prevent them from being compiled as part of the Fabrica repository. When following this guide, you'll generate your own project and can optionally copy the example implementations (removing the build constraint as shown in the instructions).
14+
1315
## What You'll Build
1416

1517
A data center rack inventory system that demonstrates **event-driven reconciliation**:
@@ -257,10 +259,17 @@ func (r *RackReconciler) reconcileRack(ctx context.Context, res *rack.Rack) erro
257259
**You can copy the example implementation:**
258260
```bash
259261
# Copy the complete rack reconciler implementation
262+
# Note: Remove the first line (//go:build ignore) from the copied file
260263
cp ../examples/04-rack-reconciliation/pkg/reconcilers/rack_reconciler.go \
261264
pkg/reconcilers/rack_reconciler.go
265+
266+
# Remove the build constraint (only needed in example repo)
267+
sed -i.bak '1{/^\/\/go:build ignore$/d;}' pkg/reconcilers/rack_reconciler.go
268+
rm pkg/reconcilers/rack_reconciler.go.bak 2>/dev/null || true
262269
```
263270

271+
> **Note:** The example file includes `//go:build ignore` at the top to prevent it from being built as part of the Fabrica repository. This line should be removed when copying to your project (the `sed` command above handles this automatically).
272+
264273
This example file shows a complete production-ready implementation with:
265274
- Template-based resource provisioning
266275
- Hierarchical resource creation (Rack → Chassis → Blades → Nodes/BMCs)

examples/04-rack-reconciliation/pkg/reconcilers/rack_reconciler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
// Copyright © 2025 OpenCHAMI a Series of LF Projects, LLC
24
//
35
// SPDX-License-Identifier: MIT

go.mod

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44

55
module github.com/openchami/fabrica
66

7-
go 1.23.4
7+
go 1.24.0
8+
9+
toolchain go1.24.11
810

911
require (
1012
github.com/cloudevents/sdk-go/v2 v2.16.2
1113
github.com/evanphx/json-patch/v5 v5.9.11
12-
github.com/go-playground/validator/v10 v10.22.0
13-
github.com/spf13/cobra v1.10.1
14-
golang.org/x/text v0.23.0
14+
github.com/go-playground/validator/v10 v10.28.0
15+
github.com/spf13/cobra v1.10.2
16+
golang.org/x/text v0.32.0
1517
gopkg.in/yaml.v3 v3.0.1
1618
)
1719

1820
require (
19-
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
21+
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
2022
github.com/go-playground/locales v0.14.1 // indirect
2123
github.com/go-playground/universal-translator v0.18.1 // indirect
2224
github.com/google/uuid v1.6.0 // indirect
@@ -27,12 +29,11 @@ require (
2729
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2830
github.com/modern-go/reflect2 v1.0.2 // indirect
2931
github.com/rogpeppe/go-internal v1.12.0 // indirect
30-
github.com/spf13/pflag v1.0.9 // indirect
32+
github.com/spf13/pflag v1.0.10 // indirect
3133
github.com/stretchr/testify v1.11.1 // indirect
3234
go.uber.org/multierr v1.11.0 // indirect
33-
go.uber.org/zap v1.27.0 // indirect
34-
golang.org/x/crypto v0.36.0 // indirect
35-
golang.org/x/net v0.38.0 // indirect
36-
golang.org/x/sys v0.31.0 // indirect
35+
go.uber.org/zap v1.27.1 // indirect
36+
golang.org/x/crypto v0.46.0 // indirect
37+
golang.org/x/sys v0.39.0 // indirect
3738
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
3839
)

go.sum

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
77
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
88
github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU=
99
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
10-
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
11-
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
10+
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
11+
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
1212
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
1313
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
1414
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
1515
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
1616
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
1717
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
18-
github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4Bx7ia+JlgcnOao=
19-
github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
18+
github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
19+
github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
2020
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2121
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
2222
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -47,10 +47,11 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
4747
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
4848
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
4949
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
50-
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
51-
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
52-
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
50+
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
51+
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
5352
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
53+
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
54+
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
5455
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
5556
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
5657
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
@@ -61,16 +62,15 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
6162
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
6263
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
6364
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
64-
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
65-
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
66-
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
67-
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
68-
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
69-
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
70-
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
71-
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
72-
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
73-
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
65+
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
66+
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
67+
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
68+
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
69+
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
70+
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
71+
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
72+
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
73+
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
7474
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
7575
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
7676
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

0 commit comments

Comments
 (0)