422 Commits

Author SHA1 Message Date
Ryan Cragun
e55d653cab
actions: fix actionlint error and linting logic (#23305)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-26 16:38:49 -06:00
Ryan Cragun
391cc1157a
[QT-602] Run proxy and agent test scenarios (#23176)
Update our `proxy` and `agent` scenarios to support new variants and
perform baseline verification and their scenario specific verification.
We integrate these updated scenarios into the pipeline by adding them
to artifact samples.

We've also improved the reliability of the `autopilot` and `replication`
scenarios by refactoring our IP address gathering. Previously, we'd ask
vault for the primary IP address and use some Terraform logic to determine
followers. The leader IP address gathering script was also implicitly
responsible for ensuring that a found leader was within a given group of
hosts, and thus waiting for a given cluster to have a leader, and also for
doing some arithmetic and outputting `replication` specific output data.
We've broken these responsibilities into individual modules, improved their
error messages, and fixed various races and bugs, including:
* Fix a race between creating the file audit device and installing and starting
  vault in the `replication` scenario.
* Fix how we determine our leader and follower IP addresses. We now query
  vault instead of a prior implementation that inferred the followers and sometimes
  did not allow all nodes to be an expected leader.
* Fix a bug where we'd always always fail on the first wrong condition
  in the `vault_verify_performance_replication` module.

We also performed some maintenance tasks on Enos scenarios  byupdating our
references from `oss` to `ce` to handle the naming and license changes. We
also enabled `shellcheck` linting for enos module scripts.

* Rename `oss` to `ce` for license and naming changes.
* Convert template enos scripts to scripts that take environment
  variables.
* Add `shellcheck` linting for enos module scripts.
* Add additional `backend` and `seal` support to `proxy` and `agent`
  scenarios.
* Update scenarios to include all baseline verification.
* Add `proxy` and `agent` scenarios to artifact samples.
* Remove IP address verification from the `vault_get_cluster_ips`
  modules and implement a new `vault_wait_for_leader` module.
* Determine follower IP addresses by querying vault in the
  `vault_get_cluster_ips` module.
* Move replication specific behavior out of the `vault_get_cluster_ips`
  module and into it's own `replication_data` module.
* Extend initial version support for the `upgrade` and `autopilot`
  scenarios.

We also discovered an issue with undo_logs that has been described in
the VAULT-20259. As such, we've disabled the undo_logs check until
it has been fixed.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-26 15:37:28 -06:00
Mark Collao
1434a235b1
add secret scanning exemptions (#23230) 2023-09-22 12:03:10 -05:00
Mark Collao
6bbdda762d
chore: update security-scan.yml exclusions 2023-09-20 17:06:53 -05:00
Ryan Cragun
9a7de066a9
test: handle the edition in the release testing workflow (#22979)
This adds edition handling to the test-run-enos-scenario-matrix
workflow. Previously we'd pass the version and edition from the caller,
but that isn't an option in the release testing workflow, which only
passes the metadata version without the edition.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-11 21:04:48 +00:00
Ryan Cragun
8dd3fa74df
release: remove concurrency groups from release testing (#22970)
The CRT orchestrator triggers the release testing workflows for all
release versions using the same main ref. Therefore, if we have
concurrency controls in place we could cancel them if more than one
release branch is executing workflows.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-11 19:33:49 +00:00
Tom Proctor
cfaad7f700
Conditionally install gVisor in CI (#22891) 2023-09-11 10:02:21 +01:00
Ryan Cragun
2e30ad5a93
test: don't use actions-set-product-version in release testing (#22948)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-08 16:27:20 -06:00
Nick Cabatoff
d03c08b466
Don't rerun-fails on 1.15 for now (#22927) 2023-09-08 15:05:58 -04:00
Ryan Cragun
5f1d2c56a2
[QT-506] Use enos scenario samples for testing (#22641)
Replace our prior implementation of Enos test groups with the new Enos
sampling feature. With this feature we're able to describe which
scenarios and variant combinations are valid for a given artifact and
allow enos to create a valid sample field (a matrix of all compatible
scenarios) and take an observation (select some to run) for us. This
ensures that every valid scenario and variant combination will
now be a candidate for testing in the pipeline. See QT-504[0] for further
details on the Enos sampling capabilities.

Our prior implementation only tested the amd64 and arm64 zip artifacts,
as well as the Docker container. We now include the following new artifacts
in the test matrix:
* CE Amd64 Debian package
* CE Amd64 RPM package
* CE Arm64 Debian package
* CE Arm64 RPM package

Each artifact includes a sample definition for both pre-merge/post-merge
(build) and release testing.

Changes:
* Remove the hand crafted `enos-run-matrices` ci matrix targets and replace
  them with per-artifact samples.
* Use enos sampling to generate different sample groups on all pull
  requests.
* Update the enos scenario matrices to handle HSM and FIPS packages.
* Simplify enos scenarios by using shared globals instead of
  cargo-culted locals.

Note: This will require coordination with vault-enterprise to ensure a
smooth migration to the new system. Integrating new scenarios or
modifying existing scenarios/variants should be much smoother after this
initial migration.

[0] https://github.com/hashicorp/enos/pull/102

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-08 12:46:32 -06:00
Christopher Swenson
f20b6eb710
Disable gVisor in tests (for now) (#22881)
We can't use `sudo` on our self-hosted runners at the moment to do
the install and Docker reload.

So, we'll disable this for now, which should automatically cause
the gVisor-related tests to be skipped.
2023-09-08 01:15:49 +00:00
Tom Proctor
d6da79aa5f
Make runsc the default plugin container runtime (#22850)
* Also makes plugin directory optional when registering container plugins
* And threads plugin runtime settings through to plugin execution config
* Add runsc to github runner for plugin container tests
2023-09-07 23:01:27 +00:00
Sarah Thompson
a9a4b0b9ff
Onboard Vault to CRT version bump automation (#18311)
* adding new version bump refactoring

* address comments

* remove changes used for testing

* add the version bump event!

* fix local enos scenarios

* remove unnecessary local get_local_metadata steps from scenarios
* add version base, pre, and meta to the get_local_metadata module
* use the get_local_metadata module in the local builder for version
  metadata
* update the version verifier to always require a build date

Signed-off-by: Ryan Cragun <me@ryan.ec>

* Update to embed the base version from the VERSION file directly into version.go.
This ensures that any go tests can use the same (valid) version as CI and so can local builds and local enos runs.
We still want to be able to set a default metadata value in version_base.go as this is not something that we set in the VERSION file - we pass this in as an ldflag in CI (matters more for ENT but we want to keep these files in sync across repos).

* update comment

* fixing bad merge

* removing actions-go-build as it won't work with the latest go caching changes

* fix logic for getting version in enos-lint.yml

* fix version number

* removing unneeded module

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Claire <claire@hashicorp.com>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2023-09-06 17:08:48 +01:00
Tom Proctor
d5b223424d
Revert "Pin security scan's semgrep version to 1.37.0 (#22731)" (#22745)
This reverts commit 980857808644b091f87ecef0527f1a08f903fced.

Previous issue fixed in returntocorp/semgrep#8604, released in 1.38.1
2023-09-01 20:32:48 +00:00
Tom Proctor
9808578086
Pin security scan's semgrep version to 1.37.0 (#22731)
hashicorp/security-scanner#504 tracks the breakage that requires us to pin pre-1.38.0 for now
2023-09-01 15:39:35 +01:00
Violet Hynes
3e0baa9864
New-line and emojify test output (#22663)
* Attempt to new-line/emojify test output

* Update emoji

* Make it always run, for testing

* Put the emojis first

* Add a space

* OSS -> CE

* Update enterprise tests also

* Test failure

* Test failures but better

* Print it even if not main :)

* Fix the comparison

* Finalize changes
2023-08-31 15:29:59 -04:00
brian shore
c31817abd0
Add GitHub workflow concurrency controls (#22610) 2023-08-30 14:39:50 -07:00
John-Michael Faircloth
8bae1c18da
gha: fix plugin update check labeling (#22647) 2023-08-30 13:22:31 -07:00
Nick Cabatoff
2d2c9c2f0c
Sync CE with Ent: improve slack notifications for test failures (#22656) 2023-08-30 13:57:31 -04:00
Theron Voran
66db439027
ci/plugin-update: use rest of repo name as service (#22585)
Includes everything after the 3rd position as the PLUGIN_SERVICE, so
that plugins like "vault-plugin-database-redis-elasticache" end up
with the full name in the changelog entry.
2023-08-28 11:28:25 -07:00
Nick Cabatoff
0f5a39cc91
Fix some ci inconsistencies, and logic for security scan and go test comment (#22563)
* Remove diff-oss-ci

* Eliminate another inconsistency

* Fix logic: we want to only apply the fork check on the CE repo.  On ent we want to always run the job.

---------

Co-authored-by: hc-github-team-secure-vault-core <github-team-secure-vault-core@hashicorp.com>
2023-08-25 11:44:17 -04:00
Mike Palmiotto
d06b57e6f8
Prune invalid timing files (#22549)
To prevent CI failures due to invalid timing files, make sure we prune
them before use and again before persisting.
2023-08-24 16:24:43 +00:00
Ryan Cragun
71fea81310
ci: fix test timing reports (#22537)
* Fix saving test timing reports when tests fail
* Use a different cache key for different test modes

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-08-24 16:03:53 +00:00
Nick Cabatoff
a0217ad017
See if this fixes the disk full errors in CI (#22532)
Co-authored-by: hc-github-team-secure-vault-core <github-team-secure-vault-core@hashicorp.com>
2023-08-23 20:16:13 +00:00
Hamid Ghaf
b5e9963703
adding testonly CI test job (#22439)
* adding testonly CI test job

* small instance for testonly tests

* feedback

* shopt

* disable glob expansion

* revert back to a large instance

* fix a mistake
2023-08-18 19:49:33 +00:00
Violet Hynes
41ca6d427a
Skip milestone check for community PRs (#22402) 2023-08-17 13:03:05 -04:00
Sarah Thompson
34bfdea34f
update linux package license to BUSL-1.1 (#22319) 2023-08-16 11:10:55 -04:00
Violet Hynes
71a31d4055
Skip security-scan and test comment notifications on community PRs (#22351) 2023-08-16 09:19:53 -04:00
Tanmay Pereira Naik
2269369229
docs: Update outdated vaultproject.io/docs/ links (#22162)
Signed-off-by: Tanmay Pereira Naik <59953366+tanmay-pnaik@users.noreply.github.com>
Co-authored-by: Brian Shumate <brianshumate@users.noreply.github.com>
2023-08-15 12:59:34 -04:00
hashicorp-copywrite[bot]
0b12cdcfd1
[COMPLIANCE] License changes (#22290)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License.

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUS-1.1

* Fix test that expected exact offset on hcl file

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Sarah Thompson <sthompson@hashicorp.com>
Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
2023-08-10 18:14:03 -07:00
Kuba Wieczorek
76d8ab6f43
CI: fix conditional statements for notification and test report collection jobs (#22157) 2023-08-02 13:40:24 +01:00
Johan Brandhorst-Satzkorn
8253e59752
Migrate protobuf generation to Buf (#22099)
* Migrate protobuf generation to Buf

Buf simplifies the generation story and allows us to lean
into other features in the Buf ecosystem, such as dependency
management, linting, breaking change detection, formatting
and remote plugins.

* Format all protobuf files with buf

Also add a CI job to ensure formatting remains consistent

* Add CI job to warn on proto generate diffs

Some files were not regenerated with the latest version
of the protobuf binary. This CI job will ensure we are always
detect if the protobuf files need regenerating.

* Add CI job for linting protobuf files
2023-07-31 18:44:56 +00:00
John-Michael Faircloth
a31c680b9c
gh action: fix plugin check workflow (#22084)
* gh action: fix plugin check workflow

* use if condition
2023-07-27 15:50:50 +00:00
John-Michael Faircloth
0c1e0b239a
gh action: add plugin update job (#22071)
* gh action: add plugin update job

* remove check from name

* git push changelog

* make actionlint happy
2023-07-27 09:59:37 -04:00
John-Michael Faircloth
0268d9d11b
gh action: update plugin update check (#22068) 2023-07-26 19:15:38 +00:00
Nick Cabatoff
7398afcc9a
Instead of looking for a comment that contains our signature string, require that it startswith that string. (#22047) 2023-07-25 09:57:07 -04:00
Ryan Cragun
8615b31598
ci: restore old timing before saving new cache (#22011)
* restore old timing results before saving new cache
* don't do an unecessary checkout in set-up-go

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-07-21 10:27:33 -06:00
Hamid Ghaf
437a7ab934
move draft PR condition outside of verify-changes (#22002)
* move draft PR condition outside of verify-changes

* remove some stuff
2023-07-21 08:58:34 -07:00
Ryan Cragun
1a46088afb
[QT-590] Optimize the CI testing workflow (#21959)
We further optimize the CI workflow for better costs and speed.
We tested the Go CI workflows across several instance classes
and update our compute choices. We achieve an average execution
speed improvement of 2-2.5 minutes per test workflow while
reducing the infrastructure cost by about 20%. We also also save
another ~2 minutes by installing `gotestsum` from the Github release
instead of downloading the Go modules and compiling it every time.

In addition to the speed improvements, we also further reduced our cache
usage by updating the `security-scan` workflow to not cache Go modules.
We also use the `cache/save` and `cache/restore` actions for timing
caches. This results is saving half as many cache results for timing
data.

*UI test results*
results for 2x runs:
* c6a.2xlarge (12m54s, 11m55s)
* c6a.4xlarge (10m47s, 11m6s)
* c6a.8xlarge (11m32s, 10m51s)
* m5.2xlarge (15m23s, 14m16s)
* m5.4xlarge (14m48s, 12m54s)
* m5.8xlarge (12m27s, 12m24s)
* m6a.2xlarge (11m55s, 12m20s)
* m6a.4xlarge (10m54s, 10m43s)
* m6a.8xlarge (10m33s, 10m51s)

Current runner:
m5.2xlarge (15m23s, 14m16s, avg 14m50s) @ 0.448/hr = $0.11

Faster candidates
* c6a.2xlarge (12m54s, 11m55s, avg 12m24s) @ 0.3816/hr = $0.078
* m6a.2xlarge (11m55s, 12m20s, avg 12m8s) @ 0.4032/hr = $0.081
* c6a.4xlarge (10m47s, 11m6s, avg 10m56s) @ 0.7632/hr = $0.139
* m6a.4xlarge (10m54s, 10m43s, avg 10m48s) @ 0.8064/hr = $0.140

Best bang for the buck for test-ui:
  m6a.2xlarge, > 25% cost savings from current and we save ~2.5 minutes.

*Go test results*
During testing the external replication tests, when not broken up, will
always take the longest. Our original analysis focuses on this job.
Most other tests groups will finish ~3m faster so we'll use subtract
that time when estimating the cost for the whole job.

external replication job results:
* c6a.2xlarge (20m49s, 19m20s, avg 20m5s)
* c6a.4xlarge (19m1s, 19m38s, avg 19m20s)
* c6a.8xlarge (19m51s, 18m54s, avg 19m23s)
* m5.2xlarge (22m12s, 20m29s, avg 21m20s)
* m5.4xlarge (20m7s, 19m3s, avg 20m35s)
* m5.8xlarge (20m24s, 19m42s, avg 20m3s)
* m6a.2xlarge (21m10s, 19m37s, avg 20m23s)
* m6a.4xlarge (18m58s, 19m51s, avg 19m24s)
* m6a.8xlarge (19m27s, 18m47s, avg 19m7s)

There is little separation in time when we increase class size. In the
best case a class size increase yields about a ~5% performance increase
and doubles the cost. For test-go our best bang for the buck is
certainly going to be in the 2xlarge class.

Current runner:
m5.2xlarge (22m12s, 20m29s, avg 21m20s) @ 0.448/hr (16@avg-3m + 1@avg) = $2.35

Candidates in the same class
* c6a.2xlarge (20m49s, 19m20s, avg 20m5s) @ 0.3816/hr (16@avg-3m + 1@avg) = $1.86
* m6a.2xlarge (21m10s, 19m37s, avg 20m23s) @ 0.4032/hr (16@avg-3m + 1@avg) = $2.00

Best bang for the buck for test-go:
  c6a.2xlarge: 20% cost savings and save about ~2.25 minutes.

We ran the tests with similar instances and saw similar execution times as
with test-go. Therefore we can use the same recommended instance sizes.

After breaking up test-go's external replication tests, the longest group
was shorter on average. I choose to look at group 3 as it was usually the
longest grouping:

* c6a.2xlarge: (14m51s, 14m48s)
* c6a.4xlarge: (14m14s, 14m15)
* c6a.8xlarge: (14m0s, 13m54s)
* m5.2xlarge: (15m36s, 15m35s)
* m5.4xlarge: (14m46s, 14m49s)
* m5.8xlarge: (14m25s, 14m25s)
* m6a.2xlarge: 14m51s, 14m53s)
* m6a.4xlarge: 14m16s, 14m16s)
* m6a.8xlarge: (14m2s, 13m57s)

Again, we see ~5% performance gains between the 2x and 8x instance classes
at quadruple the cost. The c6a and m6a families are almost identical, with
the c6a class being cheaper.

*Notes*
* UI and Go Test timing results: https://github.com/hashicorp/vault-enterprise/actions/runs/5556957460/jobs/10150759959
* Go Test with data race detection timing results: https://github.com/hashicorp/vault-enterprise/actions/runs/5558013192
* Go Test with replication broken up: https://github.com/hashicorp/vault-enterprise/actions/runs/5558490899

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-07-20 14:10:08 -06:00
Ryan Cragun
6b21994d76
[QT-588] test: fix drift between enos directories (#21695)
* Sync missing scenarios and modules
* Clean up variables and examples vars
* Add a `lint` make target for enos
* Update enos `fmt` workflow to run the `lint` target.
* Always use ipv4 addresses in target security groups.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-07-20 14:09:44 -06:00
miagilepner
245430215c
Only add binary tests if they exist (#21973)
* only add binary tests if they exist

* shellcheck
2023-07-20 12:36:17 +00:00
miagilepner
3b00dde1ba
Limit number of tests in CI comment (#21936)
* limit test comments

* remove unecessary tee

* fix go test condition

* fix

* fail test

* remove ailways entirely

* fix columns

* make a bunch of tests fail

* separate line

* include Failures:

* remove test fails

* fix whitespace
2023-07-20 11:21:49 +02:00
mickael-hc
fcaf87fd16
Update action pinning (#21913)
* pin test-summary/action
* update and pin add-to-project
2023-07-19 13:53:28 -04:00
akshya96
4b15fb96b8
Add re-run fails for release branch PR use case (#21876)
* adding release PR test case

* remove unchanged items

* fixing changes

* testing flag

* fixing wildcards

* fixing if

* fix action lint failures

* fix action lint comparison

* add shellcheck disable

* removing space

* testing change

* adding change for PR usecase

* trigger workflow

* fix filter

* add "
2023-07-18 10:40:48 -07:00
miagilepner
dc104898f7
VAULT-17660: create CI github comment (#21853)
* fix multiline

* shellcheck, and success message for builds

* add full path

* cat the summary

* fix and faster

* fix if condition

* base64 in a separate step

* echo

* check against empty string

* add echo

* only use matrix ids

* only id

* echo matrix

* remove wrapping array

* tojson

* try echo again

* use jq to get packages

* don't quote

* only run binary tests once

* only run binary tests once

* test what's wrong with the binary

* separate file

* use matrix file

* failed test

* update comment on success

* correct variable name

* bae64 fix

* output to file

* use multiline

* fix

* fix formatting

* fix newline

* fix whitespace

* correct body, remove comma

* small fixes

* shellcheck

* another shellcheck fix

* fix deprecation checker

* only run comments for prs

* Update .github/workflows/test-go.yml

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* Update .github/workflows/test-go.yml

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* fixes

---------

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
2023-07-18 17:31:29 +02:00
Kuba Wieczorek
661e839906
Go test failure summaries fixes and improvements (#21888) 2023-07-17 15:59:08 +01:00
Hamid Ghaf
f3e9d159d3
report build failures in a PR comment (#21722)
* report build failures in a PR comment

* address action linter

* linter

* add an id

* change permission

* report failure from build yaml

* linter fix

* report workflow url

* reorder jobs

* complete boolean eval

* single quote

* experiment getting failed jobs

* linter

* pass failed jobs one by one

* failed jobs are reported cancelled

* use * instead of @

* some polishing

* find comment ID, create or update it

* some clean up

* missing }
2023-07-17 07:45:32 -07:00
Kuba Wieczorek
80f0015723
Make the test summary steps in the CI fail silently (#21867) 2023-07-14 18:26:38 +01:00
akshya96
384cdd791c
Change github.base_ref to github.ref_name for Vault-17777 (#21840)
* adding ref_name instead of base-ref

* adding quotes

* fixing sheelcheck

* sing =

* disable shellcheck for rerunfails

* some shellcheck changes

* fix comment
2023-07-13 17:14:33 -07:00
akshya96
20675ccef0
Add --rerun-fails flag for release branches (#21721)
* add re-run flag for release branches

* testing

* testing with the test ref

* fix test branch name

* adding packages flag

* fix package names

* joining package names

* fixing EOF error

* fixing packages syntax

* fix syntax

* fixing syntax

* syntax fix

* fix syntax

* moving flag

* test command

* testing success case

* original changes

* Update .github/workflows/test-go.yml

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* Update .github/workflows/test-go.yml

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

---------

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
2023-07-13 12:49:17 -07:00