Commit graph

99 commits

Author SHA1 Message Date
Vault Automation
00281521f0
actions: pin actions to the latest versions
* actions: pin to latest actions

- actions/checkout@9c091bb21b => v7.0.0
  Adds a guardrail to prevent accidentally checking out fork pull
  request code in privileged GitHub Actions contexts
  (pull_request_target and PR-triggered workflow_run), with an
  explicit opt-in escape hatch for advanced workflows.

- pnpm/action-setup@0ebf47130e => v6.0.9
  Update pnpm to v11.7.0

- Add .github/actions/build-ui to ui changed files group

- Add .github/actions/build-ui to ui/frontend CODEOWNERS

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-06-23 10:21:26 -06:00
Jordan Reimer
f1b6da7638
updates setup-pnpm action to install node first (#15553) 2026-06-16 13:54:59 -06:00
Ryan Cragun
515ad91e2c
actions: increase runner sizes for build and test jobs (#15552)
Since moving to the standard runner labels we've seen a significant
decrease in job wait time but the smaller runners that we can get for
various jobs are too unreliable and we're seeing many disconnects.

Instead, increase the baseline runner size for build and test
workflows to large. This will likely require waiting longer but that
is almost certainly better than a runner disconnect and retry.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2026-06-16 13:54:59 -06:00
Vault Automation
75f15c17a6
Build UI Node Fix
* updates build-ui action to run setup-node before pnpm/action-setup

* fixes issue with empty pnpm store path

* executes pnpm from directory since it isn't on the path

* updates to hardcoded pnpm store path

* one more attempt at getting pnpm store path

* reverts to hardcoded path

* fixes bad revert

* updates pnpm store cache key and adds cache hit guard

* removes restore-key

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2026-06-16 19:01:08 +00:00
Vault Automation
74940f107c
actions: update pins to latest versions
- actions/add-to-project@5afcf98fcd => v2.0.0
  - Dependency bumps
  - Node 24 updates
- actions/cache@27d5ce7f10 => v5.0.5
  - ts-http-runtime update
- actions/checkout@df4cb1c069 => v6.0.3
  - Fixes for sha256 repositories
- actions/setup-go@4a3601121d => v6.4.0
  - Dependency bumps
  - Support custom distributions
- actions/setup-node@48b55a011b => v6.4.0
  - Dependency bumps
- actions/upload-artifact@043fb46d1a => v7.0.1
  - ts-http-runtime update
- aws-actions/configure-aws-credentials@e7f100cf4c => v6.2.0
  - Various bug fixes and improvements
- browser-actions/setup-chrome@2e1d749697 => v2.1.2
  - Drop 32 bit support
- docker/build-push-action@f9f3042f7e => v7.2.0
  - Dependency bumps
- docker/setup-buildx-action@d7f5e7f509 => v4.1.0
  - Dependency bumps
- hashicorp/actions-generate-metadata@a43468dfb1 # v1.1.4
 - Node 24 updates
- hashicorp/actions-set-product-version@d9be602dfa => v2.0.2
 - Node 24 updates
- hashicorp/action-setup-enos@3817610f3f => v1.53
  - Dependency bumps
  - New enos release
- hashicorp/setup-terraform@dfe3c3f878 => v4.0.1
  - Node 24 updates
- hashicorp/vault-action@892a26828f => v4.0.0
  - Node 24 updates
- hashicorp-forge/actions-pao-tool/*@0409050df899ec0612745ca17e47c0fba18b7c10 => v1.1.0
  - Node 24 updates
- peter-evans/create-pull-request@5f6978faf0 => v8.1.1
  - Dependency bumps
- pnpm/action-setup@0e279bb959 => v6.0.8
  - Added support for pnpm 11 and various fixes around its support
- slackapi/slack-github-action@45a88b9581 => v3.0.3
  - Bug fixes
  - Improved telemetry
- sqlc-dev/setup-sqlc@bac53b7fb2 => v5.0.0
  - Dependency bumps
- test-summary/action@37b508cfee => v2.6
  - Fixing tags

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-06-12 20:20:36 -04:00
Vault Automation
6e6396a65b
CE and enterprise editions have different versions. Always include the edition in the cache key
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-06-08 13:39:52 -06:00
Vault Automation
da9b387579
use ubuntu-22.04 everywhere to access more hot runner pools
* use ubuntu-22.04 everywhere to access more hot runner pools

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-05-28 10:26:55 -06:00
Vault Automation
3b246d7a71
Backport actions: expressions in composite action defaults don't work 🫢 into ce/main
* actions: expressions in composite action defaults don't work 🫢 (#15023)

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-05-28 08:53:36 -07:00
Vault Automation
7b474da570
[VAULT-44431] enos: merge changes for enterprise zap scenario into ce/main
Backport community files that changed as part the enterprise only zap scenarios. This mostly includes fixes to scenario execution,  retries, and blackbox SDK tests that were broken.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-05-18 10:07:46 -06:00
Vault Automation
d3f132c121
[VAULT-44808] override the workflow token when downloading nfpm
We've been seeing Github throw 500s a lot today when downloading nfpm.
My assumption is that this is due to throttling while Github works to
resolve their platform reliability. Instead of relying on the default
workflow token which has a lower priority than users, use the service
user token when calling the action that downloads nfpm to package Vault.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-05-07 21:59:31 +00:00
Vault Automation
a6c45509b9
actions: use standard runner labels for all workflows (#14476) (#14522)
Use standard runner labels for all workflows. This will allow us to pull
from the hot pools for most jobs and on-demand when more are needed.
This does elimate our cost optimization but latest on-demand runners
have taken so long to provision as to be unbearable.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-05-06 10:53:49 -07:00
Vault Automation
67a4593a4b
ci: use os=ubuntu label for linux/amd64 on-demand runners
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-04-08 23:42:58 +00:00
Vault Automation
cae8a2c58f
Backport ci: add more backup self-hosted runner types into ce/main
* ci: add more backup self-hosted runner types (#13763)

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-04-08 15:04:16 -07:00
Vault Automation
ef4609e2a4
pipeline(metadata): fix ce_in_enterprise detection (#13408) (#13414)
Support detecting short or long base refs

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-25 21:30:54 -06:00
Vault Automation
773f056792
Backport [VAULT-43364] pipeline: add template generation support into ce/main
* [VAULT-43364] pipeline: add template generation support

Add a new `template` to the `pipeline generate` command tree. It allows
rendering Go text templates with pipeline requests available via context
functions. The new system is now product agnostic and can be used to
generate any template we wish. This will supersede the enos specific
configuration command.

We also add support for multiple cadences when fetching the list of
release versions. Previously it was assumed that we followed a minor
version bump cadence when fetching versions with an n-minus style lower
bound. Now we can specify the major or minor cadence. To support a
migration from one cadence to another you can also specify an prior
cadence and the version at which the transition happened. This allows
the n-3 reverse traversal to drop into the prior cadence if/when
necessary.

**Template Rendering System**
- New `pipeline generate template` command renders Go templates with
  pipeline data access
- Supports stdin/stdout or file-based input/output
- Templates access version data via function calls rather than
  pre-populated context

**Version Cadence Support**
- Added `VersionCadence` type with `minor` and `major` release cadence
  tracking
- Supports cadence transitions (e.g., minor→major) with
  `TransitionVersion` and `PriorCadence` fields
- Calculates version ranges respecting different release cadences

**Template Functions**
- `VersionsNMinus` / `VersionsBounded` - List versions with explicit
  cadence parameter
- `VersionsNMinusTransition` / `VersionsBoundedTransition` - Handle
  cadence transitions
- `ParseVersion`, `CompareVersions`, `FilterVersions` - Version
  utilities
- All functions require cadence to be explicitly specified

**CLI Integration**
- `--version` and `--edition` flags expose current version/edition to
  templates
- Templates reference these via `.Version` and `.Edition` context fields

**Enos Migration**
- Converted `enos-dynamic-config.hcl` to template-based generation
- Uses `VersionsNMinusTransition` to handle Vault's minor→major cadence
  shift at 1.21.5

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-25 14:41:11 -04:00
Vault Automation
f666016862
actions: update actions to the latest versions (#13056) (#13143)
- actions/cache => v5.0.4
  Dep updates

- actions/download-artifact => v8.0.1
  Support for CJK characters

- dorny/paths-filter => v4.0.1
  Node 24, support for merge queues

- hashicorp/action-setup-enos => v1.52
  Security release for downstream vuln

- pnpm/action-setup => v5.0.0
  Node 24, support for native caching

- slackapi/slack-github-action => v3.0.1
  Node 24, lots of internal dep updates, ability to run Slack commands

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-19 15:51:50 +00:00
Vault Automation
aedb2da1ff
use is_ent_branch (#12672) (#12685)
Co-authored-by: Matthew Irish <39469+meirish@users.noreply.github.com>
2026-03-11 08:23:31 -05:00
Vault Automation
ab5b314c95
actions: pin actions to the latest versions (#12772) (#12793)
- docker/setup-buildx-action v3.12.0 => v4.0.0
  Node 24 upgrade, switch to ESM, some deprecated inputs have been
  removed.
- docker/build-push-action v6.19.2 => v7.0.0
  Node 24 upgrade, switch to ESM, some deprecated envs have been
  removed.
- actions/setup-node v6.2.0 => v6.3.0
  Bug fixes, internal dep updates, support for parsing `devEngines`.
- action-setup-enos v1.50 => v1.51
  Use enos 0.0.36

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-09 12:36:53 -06:00
Vault Automation
ce5dd467f2
set is_ent_branch=false when on the CE branch (#12698) (#12717)
Co-authored-by: Matthew Irish <39469+meirish@users.noreply.github.com>
2026-03-05 12:45:38 -06:00
Vault Automation
3d420fec98
actions: bump actions to latest version (#12630)
Bump our action version pins to the latest versions.

- actions/checkout v6.0.1 => v6.0.2
  Tag handling improvements

- actions/download-artifact v7.0.0 => v8.0.0
  Supports automatic detection of unzipping based on Content-Type
  Enforces digest checking
  Uses ES modules

- actions/setup-go v6.2.0 => v6.3.0
  Uses go.mod for default module caching (which we don't use)
  Fixes to download URL

- actions/upload-artifact v6.0.0 => v7.0.0
  Supports disabling automatic archiving
  Uses ES modules

- aws-actions/configure-aws-credentials v5.1.1 => v6.0.0
  Uses Node 24

- browser-actions/setup-chrome v2.1.0 => v2.1.1
  Bug fix for Node runtime version

- docker/build-push-action v6.18.0 => v6.19.2
  Internal dep updates and auth support for different Github servers.

- hashicorp/setup-terraform v3.1.2 => v4.0.0
  Uses Node 24

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-03-02 17:48:49 -05:00
Vault Automation
a3859d67e3
Backport rework UI CI workflow to partition JS tests into ce/main (#12515)
* rework UI CI workflow to partition JS tests (#11967)

* add setup-pnpm action

* remove reading vault keys from vault server output

* update ci workflow to build app and go binary first, then run tests in partitions

* fix errant tests

* address PR feedback

* Apply suggestions from code review

Co-authored-by: Ryan Cragun <me@ryan.ec>

* more feedback changes

* restore test-helper.js

* restore auth test helpers

* check in ui/tests/helpers/vault-keys.js

* use v7 of download-artifact action

* make test-ui reusable workflow

* add status job

---------

Co-authored-by: Ryan Cragun <me@ryan.ec>

* update new UI tests to run CE tests on the CE branch (#12537)

---------

Co-authored-by: Matthew Irish <39469+meirish@users.noreply.github.com>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-02-27 12:19:47 -06:00
Vault Automation
61b6ae14e5
[VAULT-40147] pipeline: add pipeline.hcl with changed_files (#12302) (#12408)
The `pipeline` utility started as collection of small CLI utilities that we found useful for the Vault CI/CD pipeline. Rather than engineering complex bash scripts in YAML blocks, instead, we could build small, reusable, testable actions and integrate the into a single binary. No more copying and pasting loads of bash from YAML, instead we can copy a single command and run the same thing locally that we can in CI.

As we've continued to invest in the utilities capability, it's become clear that other CI pipelines would benefit from the same functionality that we've been building. This change represents the first significant work to make the utility truly generic in a HashiCorp repo that utilizes CRT sense. Once all the Vault specifics have been extracted we hope to move the utility out of the repo and make it available everywhere.

The primary change here is to move our changed file grouping configuration out of the `changed` package entirely. Instead of checkers that are written as Go code, we have created a new configuration file for the `pipeline` utility called `pipeline.hcl` While there are certainly other things that will eventually be configurable here, the only thing we've added support for is `changed_files`, which allows configuring how to match a given changed files path to a group name.

The DSL is fairly simple:

```hcl
changed_files {
  // One or more groups can be defined
  group "group_name_label" {
    // Zero or more ignore blocks can be defined
    ignore {
      base_dir         = []
      base_name        = []
      base_name_prefix = []
      contains         = []
      extension        = []
      file             = []
    }

    // One or more match blocks can be defined
    match {
      base_dir         = []
      base_name        = []
      base_name_prefix = []
      contains         = []
      extension        = []
      file             = []
    }
  }
}
```

For example,
```hcl
// Create a changed_files block where we can define our changed files groups
changed_files {

  // Group blocks take one label which is the name of the group
  group "app" {

    // Groups can ignore based on some criteria.
    ignore {

      // In this instance, we'll ignore any file that begins with
      // tools/pipeline. All paths will be relative to the git repository
      // root directory. The joinpath() function is here to support paths
      // that are agnostic to the operating systems path separator. While
      // it's unlikely that you'll need them, several cty stdlib functions
      // are available.
      base_dir = [joinpath("tools", "pipeline")]
    }

    // Groups must define at least one match block.
    match {
      // This will match any file with the .go extension (except for
      // those that will be excluded with our ignore directive aboe
      extension = [".go"]
    }

    // Groups can contain more than one match block. If any of the match
    // blocks meet their criteria the group will be associated with the
    // changed file
    match {
      base_name = ["go.mod", "go.sum"]
    }

    // If groups have more than one attribute set, each attribute group
    // must match in order for the match.
    match {
      // Here we only match files that contain "raft_autopilot" in the
      // path with the .go extension
      extension = [".go"]
      contains  = ["raft_autopilot"]
    }
  }

  group "autopilot" {
    // Ignore blocks have the same attributes as match blocks
    match {
      // The base directory.
      base_dir = [
        "changelog",
        joinpath("tools", "codechecker"),
      ]
      // The base of the file
      base_name = ["README.md"]
      // A prefix string match on a files name.
      base_name_prefix = ["buf."]
      // Any string match in the files full path
      contains = [
        "-ce",
        "_ce",
        "-oss",
        "_oss",
      ]
      // The file's extension
      extension = [
        ".hcl",
        ".md",
        ".sh",
        ".yaml",
        ".yml",
      ]
      // An exact file match
      file = [
        # These exist on CE branches to please Github Actions.
        joinpath(".github", "workflows", "build-artifacts-ent.yml"),
        joinpath(".github", "workflows", "backport-automation-ent.yml"),
      ]
    }
  }
}
```

The default location of the config is `.release/pipeline.hcl`. All of our prior checks have been migrated to the DSL file present in this change.

  - We had several commands that used the changed files groups that were built into the library. This change requires us to instead load the configuration from the file and use the user defined groupings.

  - Several commands now take some part of that configuration in the request type. When possible we use the version parsed by the root command and verify in the request body rather than attempt to load the configuration.

  - We also refactor the loading and parsing of `.release/versions.hcl` in the same manner. Now we automatically parse the file in the default locations relative to the git repo root.

  - Our root command now has two new flags `--pipeline-config` and `--versions-config` which allow specifying a default location for each file. Commands which previously accepted flags or args to configure the versions file have been updated to use the global root flags instead. We've also removed the previous implementation that would recursively search backwards from the working directory to find the `versions.hcl` file. Instead we only support loading the file from the default location relative to the Git repo root.

  - All instances of changed `pipeline` command invocations have been update to support the new auto-loading of configuration.

  - A new configuration sub-command with validation exists to quickly validate a configuration file. `pipeline config validate`

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-02-23 10:51:31 -08:00
Vault Automation
f3695579ac
IBM license and config reloads (#12058) (#12251)
* adding ibm tests for ent files

* adding debug commands

* adding code changes

* adding reload tests

* remove settings.json

* remove ryboe q

* changing isHashicorpLicense to isIBMLicense and moving DiagnoseCheckLicenseGeneration to core_util_common.go

* fix test

* reverting non-license related tests

* reverting non-license related tests

* removing hashicorp license test

* modify reload server_ent_test.go

* change ibm-license paths

* adding census reload server test

* moving LicensingEntitlementSelectionConfig to core_util_common.go

* add EntReloadLicenseAndConfig to stubs

* fix operator diagnose bug

* move bug fix into ce and ent files

* add more ibm test cases

* Update command/command_testonly/server_testonly_ent_test.go



* address comments

* make fmt

---------

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com>
2026-02-06 15:19:44 -08:00
Vault Automation
b3f173756d
actions: pin to latest actions (#12144) (#12146)
Update to the latest actions. The primary motivation here is to get the
latest action-setup-enos.

  - actions/cache => v5.0.3: security patches
  - actions/checkout => v6.0.2: small fixes to git user-agent and tag
    fetching
  - hashicorp/action-setup-enos => v1.50: security patches

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-02-03 22:39:49 +00:00
Vault Automation
c2034cb08a
actions: pin to latest actions (#12060) (#12069)
- actions/checkout -> v6.0.2: some minor changes around setting the
  ACTIONS_ORCHESTRATION_ID and some fixes to `fetch-tags`.
- actions/setup-python -> v6.2.0: Node 24 compat

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-01-29 10:07:15 -08:00
Vault Automation
e745f92bc5
actions: pin to latest actions (#11818) (#11909)
- actions/cache -> v5.0.2: A bugfix around not retrying cache entries on
  429s.
- actions/setup-go -> v6.2.0: NodeJS bump and internal actions/cache
  bump. We don't use the caching in setup-go so this ought to have no
  impact for us.
- actions/setup-node -> v6.2.0: internal bump of actions/cache.
- pnpm/action-setup -> v4.2.0: Adds support for .npmrc file.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2026-01-22 20:38:08 +00:00
Vault Automation
e7965c8bdf
[VAULT-41294] docker: build OCI container images (#11545) (#11549)
This change does a few things that might not be obvious:

- We stop requesting the previous runner image. This will result in us
  using Docker 29 instead of 28. With this comes changes in our
  container build system, most notably that container images are now
  exported as OCI images. Every container runtime that we support also
  supports OCI images so this ought to have no meaningful impact to
  downstream users. One noticeable change is that the image layers are
  now compressed so the final image size on disk will be considerably
  smaller than before.

- Upgrade `hashicorp/action-setup-enos` to the latest version. This is not
  strictly required for this change but as we just released a new version of
  the CLI it makes sense to update it here. We should also note that recently
  we released a new version of `terraform-provider-enos` which contains
  necessary for this change as our docker and kind resources needed to be
  updated handle OCI and Docker exported images. Previously they relied on
  files that existed only in Docker images.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-12-29 10:58:02 -08:00
Vault Automation
d25f12d943
pipeline: pin actions to latest versions (#11453) (#11458)
None of these appear to have any changes in behavior we ought to be
concerned with.

- actions/cache: https://github.com/actions/cache/releases/tag/v5.0.1
  Upgrade to Node 24

- actions/upload-artifact: https://github.com/actions/upload-artifact/releases/tag/v6.0.0
  Upgrade to Node 24

- actions/checkout: https://github.com/actions/checkout/releases/tag/v6.0.1
  Bug fix for persisted-credentials changes in 6

- actions/setup-node: https://github.com/actions/setup-node/releases/tag/v6.1.0
  Updates internal actions and removes always-auth config

- actions/download-artifact: https://github.com/actions/download-artifact/releases/tag/v7.0.0
  Upgrade to Node 24

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-12-18 13:19:23 -07:00
Vault Automation
50c9fd55e5
Workaround backport for docker 29 ce main (#11177)
Co-authored-by: LT Carbonell <lt.carbonell@hashicorp.com>
2025-12-12 19:13:57 +00:00
Vault Automation
782f19d644
actions: add fallback ondemand runners types (#11142) (#11149)
One feature of ondemand self-hosted runners is that we don't contend
with other repositories for self-hosted runners. The penalty for using
ondemand is that there are no hot runner pools, so provisioning time
is usually around 30 second but in worst can hit the two minutes mark.
These numbers rely on immediately capacity in the default region
(us-west-2). Every once in a while we see runner provisioning times for
ondemand CI runners go into the tens of minutes, presumably due to
capacity issues. Instead of waiting around for a runner that will
fulfill our single instance type, we'll add a few fallback types we can
attempt if we hit a capacity snag on our preferred machine.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-12-04 16:37:07 +00:00
Vault Automation
8172cf232f
actions: pin to latest actions (#11057) (#11069)
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-12-03 18:15:05 +00:00
Vault Automation
89347f9705
install sqlc before building vcm (#10232) (#10531)
* install sqlc before building vcm

* make a meaningless change to trigger CI

* turn off the go.work file

* remove test comment

Co-authored-by: Josh Black <raskchanky@gmail.com>
2025-11-03 23:04:35 +00:00
Vault Automation
e6c710aef4
actions: pin to latest actions (#10407) (#10417)
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-27 17:46:04 -06:00
Vault Automation
0c6c13dd38
license: update headers to IBM Corp. (#10229) (#10233)
* license: update headers to IBM Corp.
* `make proto`
* update offset because source file changed

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-10-21 15:20:20 -06:00
Vault Automation
7e2f411859
actions(install-tools): include os and arch in cache key (#9691) (#9698)
* actions(install-tools): include os and arch in cache key

When caching and/or restoring our tools we should include the os and
arch in the key to ensure that we don't accidentally download the wrong
tools on different runners.

We also update the nightlies to specifically cache arm64 before running
the tests.

* actionlint: add arm self-hosted runner keys

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-26 18:12:56 +00:00
Vault Automation
853cbe1ac9
[VAULT-39671] tools: use github cache for all tools (#9622) (#9634)
* [VAULT-39671] tools: use github cache for external tools

We currently have some ~13 tools that we need available both locally for
development and in CI for building, linting, and formatting, and testing Vault.
Each branch that we maintain often uses the same set of tools but often pinned
to different versions.

For development, we have a `make tools` target that will execute the
`tools/tool.sh` installation script for the various tools at the correct pin.
This works well enough but is cumbersome if you’re working across many branches
that have divergent versions.

For CI the problem is speed and repetition. For each build job (~10) and Go test
job (16-52) we have to install most of the same tools for each job. As we have
extremely limited Github Actions cache we can’t afford to cache the entire vault
go build cache, so if we were to build them from source each time we incur a
penalty of downloading all of the modules and building each tool from source.
This yields about an extra 2 minutes per job to install all of the tools. We’ve
worked around this problem by writing composite actions that download pre-built
binaries of the same tools instead of building them from source. That usually
takes a few seconds. The downside of that approach is rate limiting, which
Github has become much more aggressive in enforcing.

That leads us to where we are before this work:
  - For builds in the compatibility docker container: the tools are built from
    source and cached as separate builder image layer. (usually fast as we get
    cache hits, slow on cache misses)
  - For builds that compile directly on the runner: the tools are installed on
    each job runner by composite github actions (fast, uses API requests, prone
    to throttling)
  - For tests, they use the same composite actions to install the tools on each
    job. (fast, uses API requests, prone to throttling)

This also leads to inconsistencies since there are two sources of truth: the
composite actions have their own version pin outside of those in `tools.sh`.
This has led to drift.

We previously tried to save some API requests and move all builds into
the container. That almost works but docker's build conatiner had a hard
time with some esoteric builds. We could special case it but it's a bandaid at
best.

A prior version of this work (VAULT-39654) investigated using `go tool`, but
there were some showstopper issues with that workflow that make it a non-starter
for us. Instead, we’ll attempt to use more actions cache to resolve the
throttling. This will allow us to have a single source of truth for tools, their
pins, and afford us the same speed on cache hits as we had previously without
downloading the tools from github releases thousands of times per day.

We add a new composite github action for installing our tools.
  - On cache misses it builds the tools and installs them into a cacheable path.
  - On cache hits it restore the cacheable path.
  - It adds the tools to the GITHUB_PATH to ensure runner based jobs can find
    them.
  - For Docker builds it mounts the tools at `/opt/tools/bin` which is
    part of the PATH in the container.
  - It uses a cache key of the SHA of the tools directory along with the
    working directory SHA which is required to deal with actions/cache
    issues.

This results in:
  - A single source of truth for tools and their pins
  - A single cache for tools that can be re-used between all CI and build jobs
  - No more Github API calls for tooling. *_Rate limiting will be a thing of
    the past._*

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-25 14:26:02 -07:00
Vault Automation
08db156cdb
actions(cache): update to v4.3.0 (#9626) (#9629)
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-25 17:11:56 +00:00
Vault Automation
09b48c60b1
Revert "move all builds into docker container (#9264)" (#9426) (#9440)
This reverts commit a55e884517a7c1f25e097a52e1555d4f81137068.

Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-18 18:04:41 +00:00
Vault Automation
67b3e53325
move all builds into docker container (#9264) (#9384)
* move all builds into docker container

* pipe inputs.cgo-enabled into the right place

Co-authored-by: Josh Black <raskchanky@gmail.com>
2025-09-16 22:26:06 +00:00
Vault Automation
bbb95b62e0
actions: update pins (#9272) (#9273)
Update our pins to the latest version. Essentially all of these are
related actions needing to run on Node 24. Both our self-hosted and the
Github hosted runners that we use are all on a new enough version of
actions/runner that it shouldn't be a problem.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-11 18:14:00 +00:00
Vault Automation
a73eca5759
Backport license: add support for publishing artifacts to IBM PAO into ce/main (#9208)
* license: add support for publishing artifacts to IBM PAO (#8366)

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: brian shore <bshore@hashicorp.com>
Co-authored-by: Ethel Evans <ethel.evans@hashicorp.com>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-11 11:25:15 -06:00
Vault Automation
1636e247b2
retry the build-push-action once if it fails (#9011) (#9119)
* retry the build-push-action once if it fails

* just copy/paste instead of using yaml anchors

Co-authored-by: Josh Black <raskchanky@gmail.com>
2025-09-04 22:21:04 +00:00
Vault Automation
5909d3f4b7
actions(gofumpt): pin to gofumpt v0.8.0 (#9069) (#9075)
As part of this we also update the pin of gotestsum to 1.12.3 to allow
for building it with Go 1.25.

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-09-03 16:26:30 +00:00
Vault Automation
1d3b51b914
[VAULT-39208]: actions: update action pins (#8864) (#8865)
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-08-22 22:37:38 +00:00
Vault Automation
11458aa035
actions(metadata): fix metadata version for ce (#8713) (#8714)
Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-08-20 00:05:56 +00:00
Ryan Cragun
812a240c66
Backport VAULT-34830: enable the new workflow into ce/main (#8681)
* VAULT-34830: enable the new workflow (#8661)

* pipeline: various fixes for the cutover to the enterprise first workflow (#8686)

Various small fixes that were discovered when doing the cutover to the enterprise first merge workflow:

- The `actions-docker-build` action infers enterprise metadata magically from the repository name. Use a branch that allows configuring the repo name until it's merged upstream.
- Fix some CE-In-Enterprise outputs in our metadata job.
- Pass the recurse depth flag correctly when creating backports
- Set the package name when calling the `build-vault` composite action
- Disallow merging changes into `main` and `release/*` when executing in the `hashicorp/vault` repository. This is a hack until PSS-909 is resolved.
- Use self-hosted runners when testing arm64 CE containers in enterprise.

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

 Conflicts:
	.github/workflows/backport-automation-ent.yml
	.github/workflows/test-run-enos-scenario-containers.yml

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-08-18 20:26:44 -06:00
Ryan Cragun
8f4a2b5bc3
[VAULT-34830] actions: update CE workflows for unified enterprise repository (#31425)
Various small changes and tweaks to our CI/CD workflows to allow for running CE branches in the context of `hashicorp/vault-enterprise`.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-08-07 14:35:18 -06:00
Ryan Cragun
befafd5a9c
[VAULT-35682] build(cgo): Build CGO binaries in a container (#30834)
Ubuntu 20.04 has reached EOL and is no longer a supported runner host distro. Historically we've relied on it for our CGO builds as it contains an old enough version of glibc that we can retain compatibility with all of our supported distros and build on a single host distro. Rather than requiring a new RHEL 8 builder (or some equivalent), we instead build CGO binaries inside an Ubuntu 20.04 container along with its glibc and various C compilers.

I've separated out system package changes, the Go toolchain install, and external build tools tools install into different container layers so that the builder container used for each branch is maximally cacheable.

On cache misses these changes result in noticeably longer build times for CGO binaries. That is unavoidable with this strategy. Most of the time our builds will get a cache hit on all layers unless they've changed any of the following:
- .build/*
- .go-version
- .github/actions/build-vault
- tools/tools.sh
- Dockerfile

I've tried my best to reduce the cache space used by each layer. Currently our build container takes about 220MB of cache space. About half of that ought to be shared cache between main and release branches. I would expect total new cache used to be in the 500-600MB range, or about 5% of our total space.

Some follow-up idea that we might want to consider:
- Build everything inside the build container and remove the github actions that set up external tools
- Instead of building external tools with `go install`, migrate them into build scripts that install pre-built `linux/amd64` binaries
- Migrate external to `go tool` and use it in the builder container. This requires us to be on 1.24 everywhere so ought not be considered until that is a reality.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-06-03 17:32:14 -06:00
Ryan Cragun
3e9f84e666
[VAULT-36202] pipeline(releases): add releases list active-versions command (#30658)
While working on VAULT-34829 it became apparent that if our new backporter
could know which branches are active and which CE counterparts are active
then we could completely omit the need for `ce` backport labels and instead
automatically backport to corresponding CE branches that are active.

To facilitate that we can re-use our `.release/versions.hcl` file as it is
the current source of truth for our present backport assistant workflow.

Here we add a new `pipeline releases list versions` command that is capable
of decoding that file and optionally displaying it. It will be used in the
next PR that fully implements VAULT-34829.

As part of this work we refactors `pipeline releases` to include a new `list`
sub-command and moved both `list-active-versions` and `versions` to it.

We also include a few small fixes that were noticed:
  - `.release/verions.hcl` was not up-to-date
  - Our cached dynamic config was not getting recreated when the pipeline
    tool changed. That has been fixed so now dynamic config should always
    get recreated when the pipeline binary changes
  - We now initialize a git client when using the `github` sub-command.
    This will be used in more forthcoming work
  - Update our changed file detection to resolve some incorrect groupings
  - Add some additional changed file helpers that we be used in forthcoming
    work

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-05-20 11:10:24 -06:00
Ryan Cragun
0d8f1d30f3
VAULT-36174: pipeline(go): deal with relative path issues in cache restore (#30650)
* VAULT-36174: pipeline(go): Deal with relative path issues in cache restore

Cache restore have some surprising relative pathing behavior we need
to deal with. Since our Go module cache-path is in $HOME
(/home/runner/go/...) and $HOME can be different depending on our
self-hosted vs Github hosted runners (/home/runner/actions-runner/_work
vs. /home/runner/work) we need to factor in the absolute path of $HOME
when creating our cache key. If we don't then cache restores will be
incompatible on one or the other runner. This is because the tar restore
uses relative paths backwards our our depth doesn't match on both
runners.

We also slightly change our module caches here to only get
`.../mod/cache` instead of the whole `.../mod` directory. Go is able
to unzip the modules in cache faster than it takes a longer download
with the entire mod directory.

This will double our module caches *sigh* but they ought to be smaller
as they only contain the module zips.

See: https://github.com/actions/cache/issues/1127

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

* use working dir, not home

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

* fix logic on no-save

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

* do a module list after download

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

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
2025-05-16 12:41:18 -06:00