You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`validate`| Ensure code generation has not been forgotten; and ensure generated and boilerplate code has not been modified. |
34
33
|`lint`| Perform static analysis. |
35
34
|`test`| "Local" unit and functional testing. |
@@ -49,26 +48,18 @@ $ make RELEASE_CLONE=/home/me/github/openshift/release prow-config
49
48
```
50
49
51
50
This will generate a delta configuring prow to:
52
-
53
51
- Build your `build/Dockerfile`.
54
52
- Run the above targets in presubmit tests.
55
53
- Run the `coverage` target in a postsubmit. This is the step that
56
54
updates your coverage report in codecov.io.
57
55
58
56
#### Local Testing
59
-
60
57
You can run these `make` targets locally during development to test your
61
58
code changes. However, differences in platforms and environments may
62
59
lead to unpredictable results. Therefore boilerplate provides a utility
63
60
to run targets in a container environment that is designed to be as
64
61
similar as possible to CI:
65
62
66
-
```shell
67
-
$ make container-{target}
68
-
```
69
-
70
-
or
71
-
72
63
```shell
73
64
$ ./boilerplate/_lib/container-make {target}
74
65
```
@@ -81,15 +72,27 @@ By default it is configured to be run from the app-sre jenkins pipelines.
81
72
Consult [this doc](app-sre.md) for information on local execution/testing.
82
73
83
74
## Code coverage
84
-
85
75
- A `codecov.sh` script, referenced by the `coverage``make` target, to
86
-
run code coverage analysis per [this SOP](https://github.com/openshift/ops-sop/blob/93d100347746ce04ad552591136818f82043c648/services/codecov.md).
76
+
run code coverage analysis per [this SOP](https://github.com/openshift/ops-sop/blob/93d100347746ce04ad552591136818f82043c648/services/codecov.md).
87
77
88
78
- A `.codecov.yml` configuration file for
89
79
[codecov.io](https://docs.codecov.io/docs/codecov-yaml). Note that
90
80
this is copied into the repository root, because that's
- A `make` target to [request the secret mapping in openshift/release](https://github.com/openshift/ops-sop/blob/be43125239deb1f2bbc1ef54f010410e97ff6146/services/codecov.md#openshiftrelease-pr-1---secret-mapping):
84
+
85
+
```shell
86
+
$ make codecov-secret-mapping
87
+
```
88
+
89
+
If you already have the openshift/release repository cloned locally, you
90
+
may specify its path via `$RELEASE_CLONE`:
91
+
92
+
```shell
93
+
$ make RELEASE_CLONE=/home/me/github/openshift/release codecov-secret-mapping
94
+
```
95
+
93
96
## Linting and other static analysis with `golangci-lint`
94
97
95
98
- A `go-check``make` target, which
@@ -104,35 +107,13 @@ The convention embeds default checks to ensure generated code generation is curr
104
107
To trigger the check, you can use `make generate-check` provided your Makefile properly includes the boilerplate-generated include `boilerplate/generated-includes.mk`.
105
108
106
109
Checks consist of:
107
-
108
-
- Checking all files are committed to ensure a safe point to revert to in case of error
109
-
- Running the `make generate` command (see below) to regenerate the needed code
110
-
- Checking if this results in any new uncommitted files in the git project or if all is clean.
110
+
* Checking all files are committed to ensure a safe point to revert to in case of error
111
+
* Running the `make generate` command (see below) to regenerate the needed code
112
+
* Checking if this results in any new uncommitted files in the git project or if all is clean.
111
113
112
114
`make generate` does the following:
113
-
114
-
- generate crds and deepcopy via controller-gen. This is a no-op if your
115
+
*`operator-sdk generate crds` and `k8s`. This is a no-op if your
115
116
operator has no APIs.
116
-
-`openapi-gen`. This is a no-op if your operator has no APIs.
117
-
-`go generate`. This is a no-op if you have no `//go:generate`
117
+
*`openapi-gen`. This is a no-op if your operator has no APIs.
118
+
*`go generate`. This is a no-op if you have no `//go:generate`
118
119
directives in your code.
119
-
120
-
## FIPS (Federal Information Processing Standards)
121
-
122
-
To enable FIPS in your build there is a `make ensure-fips` target.
123
-
124
-
Add `FIPS_ENABLED=true` to your repos Makefile. Please ensure that this variable is added **before** including boilerplate Makefiles.
125
-
126
-
e.g.
127
-
128
-
```.mk
129
-
FIPS_ENABLED=true
130
-
131
-
include boilerplate/generated-includes.mk
132
-
```
133
-
134
-
`ensure-fips` will add a [fips.go](./fips.go) file in the same directory as the `main.go` file. (Please commit this file as normal)
135
-
136
-
`fips.go` will import the necessary packages to restrict all TLS configuration to FIPS-approved settings.
137
-
138
-
With `FIPS_ENABLED=true`, `ensure-fips` is always run before `make go-build`
Copy file name to clipboardExpand all lines: boilerplate/openshift/golang-osd-operator/app-sre.md
-11
Original file line number
Diff line number
Diff line change
@@ -21,17 +21,6 @@ If not, you will need to set the `IMAGE_REGISTRY` environment variable (see [bel
21
21
The SaaS bundle repository for `$OPERATOR_NAME` should be located at `https://gitlab.cee.redhat.com/service/saas-{operator}-bundle`, e.g. https://gitlab.cee.redhat.com/service/saas-deadmanssnitch-operator-bundle.
22
22
Fork it to your personal namespace.
23
23
24
-
If you have already forked it to your personal namespace and/or used your fork for testing app-sre scripts at some time in the past, it is recommended that you bring your fork in sync with how upstream appears, or else the catalog you test with may not work correctly when deployed.
25
-
26
-
An example of how to do this for the `staging` branch is below (`production` steps are the same):
27
-
28
-
```
29
-
git checkout staging
30
-
git pull upstream staging
31
-
git reset --hard upstream/staging
32
-
git push origin staging --force
33
-
```
34
-
35
24
## Set environment variables
36
25
```bash
37
26
# The process creates artifacts in your git clone. Some of the make targets
0 commit comments