255 Commits

Author SHA1 Message Date
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
Rebecca Willett
2a05a48016
Support Enos failure notifications for other workflow triggers (#21768)
Include in the Slack message only the properties that are common to all the applicable workflow triggers.
2023-07-13 14:57:44 +00:00
miagilepner
233bd52051
exclude vault/integ from normal go tests (#21805) 2023-07-13 12:54:55 +00:00
John-Michael Faircloth
c121728a69
plugin automation: use gh cli and add labels (#21657)
* plugin automation: use gh cli and add labels

* remove unneeded fields

* reorder steps

* remove comment

* fix typo

* add some validation
2023-07-12 16:28:56 -04:00
Ryan Cragun
a98c0d9cbe
actions: always cache all required Go modules (#21792)
* Make sure that we always download all of the required modules.
* Fix actions/set-up-go path for UI test
* Fix broken go.mod in hcp_link

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-07-12 20:21:09 +00:00
Kuba Wieczorek
216f497c33
Don't fail tests if GitHub API doesn't return the expected response in CI (#21791) 2023-07-12 19:34:48 +01:00
Ryan Cragun
c43345c452
[QT-589] Use the go module cache between CI and build (#21764)
In order to reliably store Go test times in the Github Actions cache we
need to reduce our cache thrashing by not using more than 10gb over all
of our caches. This change reduces our cache usage significantly by
sharing Go module cache between our Go CI workflows and our build
workflows. We lose our per-builder cache which will result in a bit of
performance hit, but we'll enable better automatic rebalancing of our CI
workflows. Overall we should see a per branch reduction in cache sizes
from ~17gb to ~850mb.

Some preliminary investigation into this new strategy:

Prior build workflow strategy on a cache miss:
  Download modules: ~20s
  Build Vault: ~40s
  Upload cache: ~30s
  Total: ~1m30s

Prior build workflow strategy on a cache hit:
  Download and decompress modules and build cache: ~12s
  Build Vault: ~15s
  Total: ~28s

New build workflow strategy on a cache miss:
  Download modules: ~20
  Build Vault: ~40s
  Upload cache: ~6s
  Total: ~1m6s

New build workflow strategy on a cache hit:
  Download and decompress modules: ~3s
  Build Vault: ~40s
  Total: ~43s

Expected time if we used no Go caching:
  Download modules: ~20
  Build Vault: ~40s
  Total: ~1m

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-07-12 17:55:16 +00:00
Kuba Wieczorek
5c5c2abc63
VAULT-12958 Add link to logs to the test failure summary in CI (#21736) 2023-07-12 18:29:31 +01:00
miagilepner
bfa93fdeda
VAULT-14696: Pin 3rd party actions (#21782)
* use shas instead of versions and fix milestones

* remove trailing space
2023-07-12 17:58:45 +02:00
Mike Palmiotto
702c521489
Auto-balancing test runners (#21745)
Integrate the `test-go` workflow with `gotestsum tool ci-matrix`. The
tool uses the output of `go list ./...` along with timing files emitted
by `gotestsum` to generate a test matrix of 16 runners with evenly
distributed runtimes.

We intentionally ignore binary, docker-based test files for the initial
matrix creation and then inject a 17th runner, dedicated to building
Vault and running the entire binary test suite together. This avoids
duplication of build overhead when binary tests are rebalanced across
multiple runners in the generated matrix.

In order to maintain test results from previous runs, we cache the test
results after every run of `gotestsum`. Each cache entry occupies ~36MB
after compression on enterprise, at the time of this commit.

We'll have to keep an eye on this to make sure timing data is not
evicted from the cache, but in theory it should be toward the top of the
LRU entries.
2023-07-12 11:19:50 -04:00
Hamid Ghaf
c5fbc19d36
run go tests if verify-changes is skipped (#21776)
* run go tests if verify-changes is skipped

* experiment for a draft pr

* revert to old behaviour

* add always
2023-07-12 07:17:26 -07:00
Hamid Ghaf
3443ff1cc1
use verify changes for docs to skip tests (#21620)
* use verify changes for docs to skip tests

* add verify-changes to the needed jobs

* skip go tests for doc/ui only changes

* fix a job ref

* change names, remove script

* remove ui conditions

* separate flags

* feedback
2023-07-11 09:06:48 -07:00
miagilepner
a29ba45a3a
VAULT-15958: Fix pr/no-milestone (#21713)
* fix milestone

* only pr milestone check and fix actionlint

* fix actionlint

* add comments saying that the event types work
2023-07-11 13:35:10 +00:00
Kuba Wieczorek
ece2995ee1
Ensure test failure summaries job doesn't get skipped (#21709) 2023-07-10 17:47:48 +00:00
miagilepner
5919645a70
Switch test-completed to always() (#21654) 2023-07-10 12:34:02 +02:00
Rebecca Willett
a053c616ba
Add some additional information to the Slack notification for Enos failures (#21624) 2023-07-07 19:40:42 +00:00
Violet Hynes
d18242dae4
Run on all branches (#21683) 2023-07-07 19:40:05 +00:00
Violet Hynes
87d37fecb7
Run only on OSS (#21669) 2023-07-07 17:01:31 +00:00