Commit Graph

321 Commits

Author SHA1 Message Date
Nick Cabatoff
532a6db04f Use a newer version of semgrep that supports exclusions (#25073) 2024-01-26 14:00:31 +00:00
miagilepner
49a59bda5e Fix api/ and sdk/ package tests (#25067)
* fix

* left in incorrectly

* don't print generate commands

* handle line breaks

* remove -e
2024-01-25 14:45:44 +01:00
Nick Cabatoff
349a859d32 Ensure that on the Ent side private modules are downloaded without proxy (#25013) 2024-01-23 20:47:45 +00:00
John-Michael Faircloth
803ec375c9 plugin update workflow: change input names (#25011) 2024-01-23 14:37:11 -06:00
Nick Cabatoff
84bc9d9979 Add support for checking out a different Go version than the standard… (#25010) 2024-01-23 20:03:48 +00:00
dependabot[bot]
8a571a3e22 Bump actions/checkout from 3.5.3 to 4.1.1 (#24927)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.3...b4ffde65f46336ab88eb53be808477a3936bae11)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-18 14:31:52 +00:00
dependabot[bot]
0ca49161f9 Bump actions/setup-python from 4.6.1 to 5.0.0 (#24928)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](bd6b4b6205...0a5c615913)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-18 14:30:03 +00:00
dependabot[bot]
a94cadae28 Bump actions/setup-go from 4.0.1 to 5.0.0 (#24895)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.1 to 5.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](fac708d667...0c52d547c9)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-17 16:52:39 +00:00
dependabot[bot]
c637b9e4c6 Bump actions/cache from 3.3.3 to 4.0.0 (#24897)
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.3 to 4.0.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](e12d46a63a...13aacd865c)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-17 11:50:47 -05:00
dependabot[bot]
fa33c87a1b Bump hashicorp/setup-terraform from 2 to 3 (#24873)
Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 2 to 3.
- [Release notes](https://github.com/hashicorp/setup-terraform/releases)
- [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/setup-terraform/compare/v2...v3)

---
updated-dependencies:
- dependency-name: hashicorp/setup-terraform
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-16 12:38:51 -05:00
dependabot[bot]
d9f0587705 Bump actions/cache from 3.3.1 to 3.3.3 (#24875)
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](88522ab9f3...e12d46a63a)

---
updated-dependencies:
- dependency-name: actions/cache
  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: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-16 11:05:49 -05:00
dependabot[bot]
9ae306a5f1 Bump aws-actions/configure-aws-credentials from 2.2.0 to 4.0.1 (#24872)
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 2.2.0 to 4.0.1.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](5fd3084fc3...010d0da01d)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-16 11:04:15 -05:00
dependabot[bot]
ecb50a4cb3 Bump browser-actions/setup-chrome from 1.2.0 to 1.4.0 (#24834)
Bumps [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome) from 1.2.0 to 1.4.0.
- [Release notes](https://github.com/browser-actions/setup-chrome/releases)
- [Changelog](https://github.com/browser-actions/setup-chrome/blob/master/CHANGELOG.md)
- [Commits](c485fa3bab...52f10de547)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-15 15:00:28 -05:00
dependabot[bot]
d6d67de2fb Bump test-summary/action from 2.1 to 2.2 (#24831)
Bumps [test-summary/action](https://github.com/test-summary/action) from 2.1 to 2.2.
- [Release notes](https://github.com/test-summary/action/releases)
- [Commits](62bc5c68de...fee35d7df2)

---
updated-dependencies:
- dependency-name: test-summary/action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Violet Hynes <violet.hynes@hashicorp.com>
2024-01-15 15:00:13 -05:00
dependabot[bot]
eb3cf7bdde Bump actions/github-script from 6.4.1 to 7.0.1 (#24832)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.4.1 to 7.0.1.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](d7906e4ad0...60a0d83039)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 14:02:52 +00:00
dependabot[bot]
8e0851cfdd Bump actions/setup-node from 3.7.0 to 4.0.1 (#24833)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.7.0 to 4.0.1.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](e33196f742...b39b52d121)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-15 14:02:16 +00:00
Violet Hynes
0a427b9fd3 Fix build failures sometimes showing as success when failures happened (#24825) 2024-01-11 20:42:23 +00:00
Violet Hynes
9b457e0058 Run archive test logs always (#24820) 2024-01-11 18:33:55 +00:00
Violet Hynes
7697e8b14c CE Update of vault-action from 2.5 to 2.74 (#24812) 2024-01-11 10:27:37 -05:00
Ryan Cragun
a143d80611 actions: upload go test logs as a tarball (#24762)
The actions/upload-artifact action does not support filenames with
special characters as it needs to maintain restore compatibility with
NTFS filesystems. Instead of uploading raw log files, which can inherit
names with special characters and break the upload, we tar them all
together to preserve their names and upload the resulting tarball.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-01-10 13:37:52 -07:00
Violet Hynes
75846bc58f Fix some GHAs not running on enterprise (#24765) 2024-01-10 15:05:08 +00:00
Ryan Cragun
9a10689ca3 [QT-645] Restructure dev tools (#24559)
We're on a quest to reduce our pipeline execution time to both enhance
our developer productivity but also to reduce the overall cost of the CI
pipeline. The strategy we use here reduces workflow execution time and
network I/O cost by reducing our module cache size and using binary
external tools when possible. We no longer download modules and build
many of the external tools thousands of times a day.

Our previous process of installing internal and external developer tools
was scattered and inconsistent. Some tools were installed via `go
generate -tags tools ./tools/...`,
others via various `make` targets, and some only in Github Actions
workflows. This process led to some undesirable side effects:
  * The modules of some dev and test tools were included with those
    of the Vault project. This leads to us having to manage our own
    Go modules with those of external tools. Prior to Go 1.16 this
    was the recommended way to handle external tools, but now
    `go install tool@version` is the recommended way to handle
    external tools that need to be build from source as it supports
    specific versions but does not modify the go.mod.
  * Due to Github cache constraints we combine our build and test Go
    module caches together, but having our developer tools as deps in
    our module results in a larger cache which is downloaded on every
    build and test workflow runner. Removing the external tools that were
    included in our go.mod reduced the expanded module cache by size
    by ~300MB, thus saving time and network I/O costs when downloading
    the module cache.
  * Not all of our developer tools were included in our modules. Some were
    being installed with `go install` or `go run`, so they didn't take
    advantage of a single module cache. This resulted in us downloading
    Go modules on every CI and Build runner in order to build our
    external tools.
  * Building our developer tools from source in CI is slow. Where possible
    we can prefer to use pre-built binaries in CI workflows. No more
    module download or tool compiles if we can avoid them.

I've refactored how we define internal and external build tools
in our Makefile and added several new targets to handle both building
the developer tools locally for development and verifying that they are
available. This allows for an easy developer bootstrap while also
supporting installation of many of the external developer tools from
pre-build binaries in CI. This reduces our network IO and run time
across nearly all of our actions runners.

While working on this I caught and resolved a few unrelated issue:
* Both our Go and Proto format checks we're being run incorrectly. In
  CI they we're writing changes but not failing if changes were
  detected. The Go was less of a problem as we have git hooks that
  are intended to enforce formatting, however we drifted over time.
* Our Git hooks couldn't handle removing a Go file without failing. I
  moved the diff check into the new Go helper and updated it to handle
  removing files.
* I combined a few separate scripts and into helpers and added a few
  new capabilities.
* I refactored how we install Go modules to make it easier to download
  and tidy all of the projects go.mod's.
* Refactor our internal and external tool installation and verification
  into a tools.sh helper.
* Combined more complex Go verification into `scripts/go-helper.sh` and
  utilize it in the `Makefile` and git commit hooks.
* Add `Makefile` targets for executing our various tools.sh helpers.
* Update our existing `make` targets to use new tool targets.
* Normalize our various scripts and targets output to have a consistent
  output format.
* In CI, install many of our external dependencies as binaries wherever
  possible. When not possible we'll build them from scratch but not mess
  with the shared module cache.
* [QT-641] Remove our external build tools from our project Go modules.
* [QT-641] Remove extraneous `go list`'s from our `set-up-to` composite
  action.
* Fix formatting and regen our protos

Signed-off-by: Ryan Cragun <me@ryan.ec>
2024-01-09 17:50:46 +00:00
Bianca Moreira
9231580bdf Unset VAULT_ADDR before invoking gotestsum (#24727) 2024-01-09 18:17:25 +01:00
Bianca Moreira
e0216cab5b Add HCP subcommand -- integrate with HCP library (#23897)
* Add HCP engine token logic

* Update documentation

* Fix content check

* Add changelog entry

* Update changelog/23897.txt

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

* Update api/client.go

Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>

* Add error when HCP commands failed to be initialize

* Add tests for initHCPcommand function

* Update lib dependency

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Fix docs nav data

* Improve docs sections

* Update hcp lib dependency

* Fix content formatting

* Update lib dependency

* Fix HCPtokenhelper problem

* Fix HCPtokenhelper problem

* Remove HCP env variables

* Remove hcp helper token

* Add error treatment for no valid credential source

* Update website/content/docs/commands/hcp/index.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Update website/content/docs/commands/hcp/disconnect.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Update website/content/docs/commands/hcp/connect.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Update website/content/docs/commands/hcp/disconnect.mdx

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Update website/content/docs/commands/hcp/index.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update website/content/docs/commands/hcp/connect.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Modify hcp tests

---------

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2024-01-09 15:29:30 +01:00
Violet Hynes
09427955b2 Add -type -f to the -find delete call as part of test collect reports (#24711) 2024-01-08 18:17:35 +00:00
Deniz Onur Duzgun
cf07c3d497 Remove unused token (#24577) 2024-01-04 12:40:27 -05:00
Ryan Cragun
efda1c6d4e enos: always test from the same branch as the revision (#24462)
Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-12-11 14:26:10 -07:00
Tom Proctor
030bba4e68 Support rootless plugin containers (#24236)
* Pulls in github.com/go-secure-stdlib/plugincontainer@v0.3.0 which exposes a new `Config.Rootless` option to opt in to extra container configuration options that allow establishing communication with a non-root plugin within a rootless container runtime.
* Adds a new "rootless" option for plugin runtimes, so Vault needs to be explicitly told whether the container runtime on the machine is rootless or not. It defaults to false as rootless installs are not the default.
* Updates `run_config.go` to use the new option when the plugin runtime is rootless.
* Adds new `-rootless` flag to `vault plugin runtime register`, and `rootless` API option to the register API.
* Adds rootless Docker installation to CI to support tests for the new functionality.
* Minor test refactor to minimise the number of test Vault cores that need to be made for the external plugin container tests.
* Documentation for the new rootless configuration and the new (reduced) set of restrictions for plugin containers.
* As well as adding rootless support, we've decided to drop explicit support for podman for now, but there's no barrier other than support burden to adding it back again in future so it will depend on demand.
2023-11-28 14:07:07 +00:00
Nick Cabatoff
edb60b63f7 Use test package parallelism of 2 for docker/binary-based tests. (#24173) 2023-11-16 16:27:43 -05:00
Chris Capurso
9e044ea26e modify linux arm build strategy to use GOARM 6 (#24061) 2023-11-09 11:01:34 -05:00
mickael-hc
a76f71cc60 fix security-scanner: temporarily pin semgrep to 1.45.0 (#23855) 2023-10-27 07:30:04 -04:00
Ryan Cragun
a46def288f [QT-616] Add seal_ha enos scenario (#23812)
Add support for testing Vault Enterprise with HA seal support by adding
a new `seal_ha` scenario that configures more than one seal type for a
Vault cluster. We also extend existing scenarios to support testing
with or without the Seal HA code path enabled.

* Extract starting vault into a separate enos module to allow for better
  handling of complex clusters that need to be started more than once.
* Extract seal key creation into a separate module and provide it to
  target modules. This allows us to create more than one seal key and
  associate it with instances. This also allows us to forego creating
  keys when using shamir seals.
* [QT-615] Add support for configuring more that one seal type to
  `vault_cluster` module.
* [QT-616] Add `seal_ha` scenario
* [QT-625] Add `seal_ha_beta` variant to existing scenarios to test with
  both code paths.
* Unpin action-setup-terraform
* Add `kms:TagResource` to service user IAM profile

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-10-26 15:13:30 -06:00
Nick Cabatoff
c64e0144f6 Use the same approach as we do in our other workflows: apply to PRs, and to pushes to our main and release branches. (#23785) 2023-10-23 14:27:13 +00:00
modrake
eca4b4d801 Relplat 897 copywrite fixes for mutliple licenses (#23722) 2023-10-20 08:40:43 -07:00
Violet Hynes
146653dfef VAULT-20487 update build failure slack output (#23724)
* VAULT-20487 update build failure slack output

* VAULT-20487 add new needs

* VAULT-20487 make it run on my branch

* VAULT-20487 make it run

* VAULT-20487 finalize?
2023-10-19 08:56:35 -04:00
Nick Cabatoff
5ca5dcba6f Fix missing test logs in archive (#23718)
Fix missing log files: we need to use an absolute path, since go test chdirs into the test package dir before running tests.  Move the cleanup-on-success behaviour from NewTestCluster into NewTestLogger so it applies more broadly.
2023-10-18 15:58:03 +00:00
divyaac
2716a48c78 Run ent tests for test-ui and oss changes (#23675)
* Copy changes from ent to oss

* Edited workflow to include the yarn oss command
2023-10-17 10:55:20 -07:00
Nick Cabatoff
832c78ee6e Stop running fips tests on PRs (#23664)
* Stop running fips tests on PRs: we expect fips-specific failures to be rare enough that it's not worth the cost.
* Allow PRs with the label "fips" to run fips tests.
2023-10-16 14:28:28 +00:00
Mark Collao
44043004d1 Update security-scan.yml 2023-10-11 12:26:20 -05:00
Mark Collao
525bf2f894 Update security-scan.yml 2023-10-11 11:07:54 -05:00
Hamid Ghaf
163c03f514 exclude changelog in verifying doc/ui PRs (#23601) 2023-10-11 08:18:23 -07:00
Kuba Wieczorek
83ae451df8 CI: Pre-emptively delete logs dir after cache restore in test-collect-reports (#23600) 2023-10-11 15:40:16 +01:00
Ryan Cragun
7d800b1af2 [QT-623] Pin to terraform 1.5.x (#23508)
Terraform 1.6.x seems to have some incompatiblity with the current
version fo enos and its usage of tfjson. Pin to 1.5.x until it has been
resolved.

```
│ Error: json: cannot unmarshal array into Go struct field rawState.checks of type tfjson.CheckResultStatic
│
```

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-10-04 14:01:39 -06:00
Nick Cabatoff
9c28951e4e Set VAULT_TEST_LOG_DIR, so that users of NewTestLogger will have their logs written there instead of stdout. (#23494) 2023-10-04 10:35:21 -04:00
Ryan Cragun
9afd5e52ae [QT-602] Don't fail if scenarios cannot completely destroy infra (#23473)
Sometimes destroying resources in AWS will fail because of unexpected
dependency violations or other such nonsense. When this happens the
behavior of Vault that we wanted to verify has already been successfully
accomplished, however the required workflow will fail. This change
allows us to succeed if `enos scenario launch` completes but allows
`enos scenario destroy` to fail. We still notify our slack channel on
destroy failures so that we can investigate issues, however it won't
require a PR author to retry.

* Execute `enos scenario launch` instead of `enos scenario run` to allow
  for very occasional issues when tearing down test infrastructure.
* Improve an error message when getting secondary cluster IP addresses.
* Don't race to get secondary cluster IP addresses.
* Add secondary token to replication scenario outputs.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-10-03 13:04:55 -06:00
Kuba Wieczorek
3acfe5ea52 [VAULT-20630] CI: Use 'ref' (not 'base_ref') as a default git reference to check out code in the test-go GHA workflow (#23458) 2023-10-03 14:58:35 +01:00
Kuba Wieczorek
b300d50799 [VAULT-20630] CI: Fix the CI workflow issue where we check out base ref instead of the ref that triggered the workflow run (#23453) 2023-10-03 12:06:44 +01:00
Hamid Ghaf
375c2be624 control checking out head instead of base ref by a GH label (#22817)
* control checking out head instead of base ref by a GH label

* move checkout ref to the setup step

* adding a comment
2023-09-29 00:13:01 +00:00
Ryan Cragun
7725117846 enos: remove old initial version from upgrades (#23323)
* Remove old initial versions from the upgrade scenario as they're
  unreliable.
* Ensure that shellcheck is available on runners for linting job.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2023-09-27 12:24:08 -06:00
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