Commit Graph

431 Commits

Author SHA1 Message Date
Ryan Cragun
b8e8620882 VAULT-33693 actions: fix push event PR labels (#29476)
* VAULT-33693: actions: fix push event PR labels

Fix pull request label metadata when triggered `push` event types.
We now use Github's `associatedPullRequests()` connection on the
`Commit` associated with the SHA to resolve the labels.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-02-25 16:30:27 -07:00
Violet Hynes
b5ded80e26 Pin CI tool versions (#29665)
* Pin CI tool versions

* Protoc-gen-go-grpc should be v1.5.1

* enumer

* More GHAs

* string

* misspell

* gopath

* gopath

* revert makefile stuff

* Export path

* path equals?

* Experimentation

* Go mod tidy
2025-02-25 12:56:36 -05:00
Ryan Cragun
b239a71934 actions: pin to the latest approved workflows (#29321)
The genesis of this PR is updating our cache action due to older actions
being shut down[0]. While not mentioned in the changelog, the migration
guide does call out versions <3.4.0 or <4.2.0 as too old.[1]

Since I was updating cache I went ahead and updated minor versions of
all our actions.

[0]: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
[1]: https://github.com/actions/cache/discussions/1510

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-01-24 20:08:01 +00:00
helenfufu
ede1469302 use elevated github token in plugin-update gha ent step (#29400) 2025-01-23 16:26:55 -08:00
Violet Hynes
47a6855e98 Remove rootless docker build step (#29373) 2025-01-21 12:17:14 -05:00
Violet Hynes
bf6ac1a7d9 Run benchmark only on main (and rename the f ile (#29142) 2024-12-11 10:18:17 -08:00
Ryan Cragun
1282c3c68e backport-assistant: use the latest version of the backport-assistant (#28998)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-11-22 18:42:17 +00:00
Ryan Cragun
3b31b3e939 VAULT-32206: verify audit log and systemd journal secret integrity (#28932)
Verify vault secret integrity in unauthenticated I/O streams (audit log, STDOUT/STDERR via the systemd journal) by scanning the text with Vault Radar. We search for both known and unknown secrets by using an index of KVV2 values and also by radar's built-in heuristics for credentials, secrets, and keys.

The verification has been added to many scenarios where a slight time increase is allowed, as we now have to install Vault Radar and scan the text. In practice this adds less than 10 seconds to the overall duration of a scenario.

In the in-place upgrade scenario we explicitly exclude this verification when upgrading from a version that we know will fail the check. We also make the verification opt-in so as to not require a Vault Radar license to run Enos scenarios, though it will always be enabled in CI.

As part of this we also update our enos workflow to utilize secret values from our self-hosted Vault when executing in the vault-enterprise repo context.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-11-22 11:14:01 -07:00
Violet Hynes
a391f903b9 Add a benchmark GHA to Vault to use the Smoke Benchmark tests (#28740)
* Add GHA

* Attempt 2

* Workflow call

* checkout ref

* needs bench?

* always

* Remove thing

* Move stuff around?

* Check different path

* reorder?

* Fix typo

* Remove version file

* cob

* Continued work, this won't work yet

* I forgot what I was doing

* Copyright

* Stuff

* Fix stuff

* Better setup

* Use base branch sha

* fetch depth?

* Path

* Fully qualified path?

* set up go?

* go get

* Relative again

* Debugging

* stat

* absolute path

* I'm pretty dumb

* Benchmark

* introduce performance regression

* Whoops wrong branch

* introduce performance regression

* More benchmarks

* Push tests

* more stuff

* Lease

* Improve download

* sudo

* debugging

* Shell

* Remove sudo?

* Chmod

* move thing

* pipe

* Cleanup

* More performance regressions

* Remove cat?

* satisfy linter?

* Maybe this?

* One last try

* Redirect?

* One last attempt?

* Try removing sudo?

* Test tags CE

* Better ent check

* CE

* Make theoretically mergeable
2024-11-18 11:44:37 -05:00
VAL
4536681edf Clarify backport instructions further (#28908) 2024-11-13 21:59:47 +00:00
Kuba Wieczorek
619843589b CI: Pin VCM version used in Run Autopilot upgrade tests workflow (#28820) 2024-10-31 16:51:04 +00:00
Ryan Cragun
31b139c8ce pipeline: include the version in the dynamic config key (#28793)
Cache scopes allow other branches to inherit default branch scopes,
which means that release branches can restore a key from main. Instead,
we now include the vault version as part of the cache key to ensure
we don't include versions that are incompatible with our version.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-10-29 16:02:00 +00:00
Ryan Cragun
ce5885279b VAULT-31181: Add pipeline tool to Vault (#28536)
As the Vault pipeline and release processes evolve over time, so too must the tooling that drives them. Historically we've utilized a combination of CI features and shell scripts that are wrapped into make targets to drive our CI. While this 
approach has worked, it requires careful consideration of what features to use (bash in CI almost never matches bash in developer machines, etc.) and often requires a deep understanding of several CLI tools (jq, etc). `make` itself also has limitations in user experience, e.g. passing flags.

As we're all in on Github Actions as our pipeline coordinator, continuing to utilize and build CLI tools to perform our pipeline tasks makes sense. This PR adds a new CLI tool called `pipeline` which we can use to build new isolated tasks that we can string together in Github Actions. We intend to use this utility as the interface for future release automation work, see VAULT-27514.

For the first task in this new `pipeline` tool, I've chosen to build two small sub-commands:

* `pipeline releases list-versions` - Allows us to list Vault versions between a range. The range is configurable either by setting `--upper` and/or `--lower` bounds, or by using the `--nminus` to set the N-X to go back from the current branches version. As CE and ENT do not have version parity we also consider the `--edition`, as well as none-to-many `--skip` flags to exclude specific versions.

* `pipeline generate enos-dynamic-config` - Which creates dynamic enos configuration based on the branch and the current list of release versions. It takes largely the same flags as the `release list-versions` command, however it also expects a `--dir` for the enos directory and a `--file` where the dynamic configuration will be written. This allows us to dynamically update and feed the latest versions into our sampling algorithm to get coverage over all supported prior versions.

We then integrate these new tools into the pipeline itself and cache the dynamic config on a weekly basis. We also cache the pipeline tool itself as it will likely become a repository for pipeline specific tooling. The caching strategy for the `pipeline` tool itself will make most workflows that require it super fast.


Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-10-23 15:31:24 -06:00
Deniz Onur Duzgun
afd023e41c ci: update the security-scanner gha token (#28410)
* ci: update the security-scanner gha token

* fix codeql version

---------

Co-authored-by: mickael e <mickael@hashicorp.com>
2024-10-23 13:53:35 -06:00
Kuba Wieczorek
80729f063f [VAULT-28762] Run Autopilot upgrade tests on main and PRs to main on ENT if the AP code has changed (#28697)
Co-authored-by: Josh Black <raskchanky@gmail.com>
2024-10-14 16:59:00 +01:00
Steven Clark
8fec0056c1 Update buf to 1.45.0 (#28632) 2024-10-08 15:02:15 -06:00
Ryan Cragun
b6145bc3bb protobuf: rebuild protos with protobuf 1.35.1 (main) (#28617)
* protobuf: rebuild protos with protobuf 1.35.1
* protobuf: unpin protoc-gen-go-grpc on main

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-10-07 14:54:51 -06:00
Ryan Cragun
c8e6169d5d VAULT-31402: Add verification for all container images (#28605)
* VAULT-31402: Add verification for all container images

Add verification for all container images that are generated as part of
the build. Before this change we only ever tested a limited subset of
"default" containers based on Alpine Linux that we publish via the
Docker hub and AWS ECR.

Now we support testing all Alpine and UBI based container images. We
also verify the repository and tag information embedded in each by
deploying them and verifying the repo and tag metadata match our
expectations.

This does change the k8s scenario interface quite a bit. We now take in
an archive image and set image/repo/tag information based on the
scenario variants.

To enable this I also needed to add `tar` to the UBI base image. It was
already available in the Alpine image and is used to copy utilities to
the image when deploying and configuring the cluster via Enos.

Since some images contain multiple tags we also add samples for each
image and randomly select which variant to test on a given PR.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-10-07 10:16:22 -06:00
Steven Clark
159e780d74 Have go-test timeout before the GH step timeout to gather information (#28559)
- If we encounter a deadlock/long running test it is better to have go
   test timeout. As we've noticed if we hit the GitHub step timeout, we
   lose all information about what was running at the time of the timeout
   making things harder to diagnose.
 - Having the timeout through go test itself on a long running test it
   outputs what test was running along with a full panic output within
   the logs which is quite useful to diagnose
2024-10-02 10:27:25 -04:00
Kuba Wieczorek
1736addedf Send the UI test results from the CI to DataDog (#28412) 2024-09-17 12:29:04 +01:00
Luis (LT) Carbonell
146ad63256 Add build for FIPS ARM Docker images (#28310)
* Add build for FIPS ARM Docker images

* arm64 build
2024-09-11 15:07:34 -04:00
Ryan Cragun
c9340dc7d5 VAULT-30640: support running test-go in parallel on multiple branches (#28296)
In order for our enterprise nightlies to run the same test-go job but
across a matrix of different base references we need to consider the
checkout ref in our failure and summary uploads in order to prevent
an upload race.

We also configure Git with our token before setting up Go so that
enterprise CI workflows can execute without downloading a module cache.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-09-06 15:14:55 -06:00
John-Michael Faircloth
b682a79551 actions: support ent plugins in plugin update workflow (#28295) 2024-09-05 15:53:08 -05:00
Chelsea Shaw
111d6a83ea adds back chrome version pin (#28176) 2024-08-23 16:21:58 -05:00
Ryan Cragun
f6df23c7cf enos: install go toolchain on lint (#28182)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-23 14:23:47 -06:00
Ryan Cragun
b5d32b7bec enos: add shfmt formatting to enos module scripts (#28142)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-23 13:45:30 -06:00
Ryan Cragun
438fae0952 ui: rebuild fontconfig cache on Github hosted runners (#28177)
It appears that with the latest runner image[0] that we occasionally see
a flaky test with an error related to our fontconfig cache:

```
Error: Browser timeout exceeded: 10s
Error while executing test: Acceptance | wrapped_token query param functionality: it authenticates when used with the with=token query param
Stderr:
 Fontconfig error: No writable cache directories
[0822/180212.113587:WARNING:sandbox_linux.cc(430)] InitializeSandbox() called with multiple threads in process gpu-process.
```

This change rebuilds the fontconfig cache on Github hosted runners.
Hopefully we can remove this at some point when a new runner image is
released.

[0] https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240818.1

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-23 19:23:28 +00:00
Chelsea Shaw
1488f0956d UI: remove pinned chrome version (#28159) 2024-08-22 20:47:57 +00:00
dependabot[bot]
33b567ddb2 Bump browser-actions/setup-chrome from 1.7.1 to 1.7.2 (#28101)
Bumps [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/browser-actions/setup-chrome/releases)
- [Changelog](https://github.com/browser-actions/setup-chrome/blob/master/CHANGELOG.md)
- [Commits](db1b524c26...facf10a55b)

---
updated-dependencies:
- dependency-name: browser-actions/setup-chrome
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
2024-08-19 15:16:14 -07:00
dependabot[bot]
754e97018f Bump actions/setup-node from 4.0.2 to 4.0.3 (#27738)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](60edb5dd54...1e60f620b9)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-16 16:15:59 -07:00
dependabot[bot]
f3e9f854d6 Bump actions/download-artifact from 4.1.7 to 4.1.8 (#27704)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.7 to 4.1.8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](65a9edc588...fa0a91b85d)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-16 14:48:16 -07:00
akshya96
ae6854e9f2 updating remaining occurances of setup-go (#28110) 2024-08-16 13:00:48 -07:00
Ryan Cragun
d5c67768c5 scan: skip running if the PR head is a fork (#28107)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-16 13:49:05 -06:00
akshya96
62e0e62742 updating remaining occurances of upload-artifact (#28108) 2024-08-16 11:46:08 -07:00
dependabot[bot]
219e53134d Bump actions/setup-go from 5.0.1 to 5.0.2 (#27756)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](cdcb360436...0a12ed9d6a)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-15 15:41:52 -07:00
dependabot[bot]
3b2ea90fdb Bump actions/upload-artifact from 4.3.3 to 4.3.6 (#28008)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...834a144ee9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
2024-08-15 15:18:47 -07:00
VAL
a4e8063eff Add LTS label instructions to PR template (#27924)
* Add LTS explanation and clarify other label explanations

* Link to doc containing LTS calendar

* Change order for simpler cognitive load

* A bit simpler based on feedback
2024-08-15 10:40:01 -07:00
Ryan Cragun
843ae09948 scan: fixup ent labels (#28083)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-14 15:20:06 -06:00
Ryan Cragun
aff0eae0f9 VAULT-28638: Cost optimize the Security scan workflow (#28067)
Optimize the cost of the Security `scan` workflow by utilizing a
different runner. Previously this workflow would use the
`custom-linux-xl` in `vault` vs. the `c6a.4xlarge` on-demand runner in
`vault-enterprise. This resulted in the `vault` workflow costing an
order of magnitude more each month.

I tested with the following instances sizes to compare cost to execution
time:

| Runnner | Estimated Time | Cost Factor | Cost Score |
|---------|-----------------|-------------|-------------|
|ubuntu-latest|19m|1|19|
|custom-linux-small|21.5m|2|43|
|custom-linux-medium|11.5m|4|46|
|custom-linux-xl|8.5m|16|136|

Currently the `CI` and `build` require workflows take anywhere from
16-20 minutes on `vault`. Our goal is to not exceed that.

At this time we're going to try out `ubuntu-latest` as it gives us ~85%
savings and by far the best bang for our buck. If it ends up being a
burden we can switch to `custom-linux-medium` for ~66% cost savings but
still a reasonable runtime.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-14 14:29:34 -06:00
Ryan Cragun
74b6cc799a VAULT-29583: Modernize default distributions in enos scenarios (#28012)
* VAULT-29583: Modernize default distributions in enos scenarios

Our scenarios have been running the last gen of distributions in CI.
This updates our default distributions as follows:
  - Amazon: 2023
  - Leap:   15.6
  - RHEL:   8.10, 9.4
  - SLES:   15.6
  - Ubuntu: 20.04, 24.04

With these changes we also unlock a few new variants combinations:
  - `distro:amzn seal:pkcs11`
  - `arch:arm64 distro:leap`

We also normalize our distro key for Amazon Linux to `amzn`, which
matches the uname output on both versions that we've supported.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-08-09 13:43:28 -06:00
Steven Clark
297a9831f1 Pin protoc-gen-go-grpc to 1.4.0 (#27892)
* Pin protoc-gen-go-grpc to 1.4.0

They introduced a replace statement within the go.mod file which
causes failures running go install protoc-gen-go-grpc@latest

Workaround for now is to pin to the previous version

See https://github.com/grpc/grpc-go/issues/7448

* Add missing v to version v1.4.0 instead of 1.4.0 within tools/tools.sh
2024-07-29 14:36:43 +00:00
Kuba Wieczorek
5d172d5861 [VAULT-28666] Use the retry script to check release version for gotestsum in CI (#27878) 2024-07-26 16:41:01 +00:00
Kuba Wieczorek
7a4cf3d273 [VAULT-28666] Use the retry script to check release versions for external tools installed in CI (#27873) 2024-07-26 10:17:32 -04:00
Kuba Wieczorek
920c08966c [VAULT-28666] Enable the --clobber flag on GitHub CLI release downloads in CI to avoid errors when retrying (#27852) 2024-07-24 12:24:30 +01:00
Kuba Wieczorek
74d15e3d50 [VAULT-28666] Remove the errexit option from the retry script and add increasing wait on failure (up to 5 seconds and 5 retries) (#27842)
Co-authored-by: VAL <val@hashicorp.com>
2024-07-23 17:58:37 +00:00
Kuba Wieczorek
b7d9008e5b [VAULT-28666] Retry tool download from GitHub releases on failure in GitHub Actions (GHA) (#27786) 2024-07-16 09:07:30 +01:00
Kuba Wieczorek
d9cd3a094a [VAULT-28666] Retry staticcheck download on failure in GitHub Actions (GHA) (#27781) 2024-07-15 13:19:16 -04:00
Josh Black
56b32081f0 add a retry-command script (#27754)
* add a retry-command script

* add license header to retry script
2024-07-12 13:18:41 -07:00
Ryan Cragun
44c988328f actions: don't use linux runs-on label (#27674)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-07-08 09:47:41 -06:00
Kuba Wieczorek
1b794a5579 [VAULT-28664] Enable the --rerun-fails option in gotestsum for enterprise to reduce the impact of flaky tests on the CI (#27695) 2024-07-04 18:42:51 +01:00