Skip to content

Commit 15b965c

Browse files
authored
Merge branch 'release/1.16.x' into backport/miagilepner/VAULT-36229-recovery-rekey-cancel/1.16
2 parents c00703f + 9f15f22 commit 15b965c

File tree

126 files changed

+11744
-6548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+11744
-6548
lines changed

.github/actions/build-vault/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ runs:
9292
shell: bash
9393
run: git config --global url."https://${{ inputs.github-token }}:@github.com".insteadOf "https://github.com"
9494
- name: Restore UI from cache
95-
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
95+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
9696
with:
9797
# Restore the UI asset from the UI build workflow. Never use a partial restore key.
9898
enableCrossOsArchive: true
@@ -146,7 +146,7 @@ runs:
146146
BUNDLE_PATH: out/${{ steps.metadata.outputs.artifact-basename }}.zip
147147
shell: bash
148148
run: make ci-bundle
149-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
149+
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
150150
with:
151151
name: ${{ steps.metadata.outputs.artifact-basename }}.zip
152152
path: out/${{ steps.metadata.outputs.artifact-basename }}.zip
@@ -178,13 +178,13 @@ runs:
178178
echo "deb-files=$(basename out/*.deb)"
179179
} | tee -a "$GITHUB_OUTPUT"
180180
- if: inputs.create-packages == 'true'
181-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
181+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
182182
with:
183183
name: ${{ steps.package-files.outputs.rpm-files }}
184184
path: out/${{ steps.package-files.outputs.rpm-files }}
185185
if-no-files-found: error
186186
- if: inputs.create-packages == 'true'
187-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
187+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
188188
with:
189189
name: ${{ steps.package-files.outputs.deb-files }}
190190
path: out/${{ steps.package-files.outputs.deb-files }}

.github/actions/changed-files/action.yml

Lines changed: 30 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,45 @@
22
# SPDX-License-Identifier: BUSL-1.1
33

44
---
5-
name: Determine what files changed between two git referecnes.
5+
name: Determine what files have changed on either a pull request or commit.
66
description: |
7-
Determine what files have changed between two git references. If the github.event_type is
8-
pull_request we'll compare the github.base_ref (merge target) and pull request head SHA.
9-
For other event types we'll gather the changed files from the most recent commit. This allows
10-
us to support PR and merge workflows.
7+
Determine what files have changed on either a pull request or commit.
8+
Writes the list of files to
9+
10+
inputs:
11+
github-token:
12+
description: A preferred Github token to access private modules if necessary.
1113

1214
outputs:
13-
app-changed:
14-
description: Whether or not the vault Go app was modified.
15-
value: ${{ steps.changed-files.outputs.app-changed }}
16-
docs-changed:
17-
description: Whether or not the documentation was modified.
18-
value: ${{ steps.changed-files.outputs.docs-changed }}
19-
ui-changed:
20-
description: Whether or not the web UI was modified.
21-
value: ${{ steps.changed-files.outputs.ui-changed }}
22-
files:
23-
description: All of the file names that changed.
24-
value: ${{ steps.changed-files.outputs.files }}
15+
changed-files:
16+
description: All of the files that changed.
17+
value: ${{ steps.changed-files.outputs.changed-files }}
2518

2619
runs:
2720
using: composite
2821
steps:
29-
- id: ref
22+
- id: changed-files-set-up-pipeline
23+
name: Set up the pipeline tool
24+
uses: ./.github/actions/set-up-pipeline
25+
with:
26+
github-token: ${{ inputs.github-token || github.token }}
27+
- id: changed-files
28+
name: Determine the changed files
3029
shell: bash
31-
name: ref
30+
env:
31+
GITHUB_TOKEN: ${{ inputs.github-token || github.token }}
3232
run: |
33-
# Determine our desired checkout ref.
34-
#
35-
# * If the trigger event is pull_request we will default to a magical merge SHA that Github
36-
# creates. This SHA is the product of what merging our PR into the merge target branch at
37-
# at the point in time when we created the PR. When you push a change to a PR branch
38-
# Github updates this branch if it can. When you rebase a PR it updates this branch.
39-
#
40-
# * If the trigger event is pull_request and a `checkout-head` tag is present or the
41-
# checkout-head input is set, we'll use HEAD of the PR branch instead of the magical
42-
# merge SHA.
43-
#
44-
# * If the trigger event is a push (merge) then we'll get the latest commit that was pushed.
45-
#
46-
# * For anything any other event type we'll default to whatever is default in Github.
33+
# Get a list of changed files and write the "changed-files" output to $GITHUB_OUTPUT
4734
if [ '${{ github.event_name }}' = 'pull_request' ]; then
48-
checkout_ref='${{ github.event.pull_request.head.sha }}'
49-
elif [ '${{ github.event_name }}' = 'push' ]; then
50-
# Our checkout ref for any other event type should default to the github ref.
51-
checkout_ref='${{ github.event.after && github.event.after || github.event.push.after }}'
35+
pipeline github list changed-files \
36+
--owner hashicorp \
37+
--repo '${{ github.event.pull_request.head.repo.name }}' \
38+
--pr '${{ github.event.pull_request.number }}' \
39+
--github-output
5240
else
53-
checkout_ref='${{ github.ref }}'
41+
pipeline github list changed-files \
42+
--owner hashicorp \
43+
--repo '${{ github.event.repository.name }}' \
44+
--commit '${{ github.event.after && github.event.after || github.event.push.after && github.event.push.after || github.sha }}' \
45+
--github-output
5446
fi
55-
echo "ref=${checkout_ref}" | tee -a "$GITHUB_OUTPUT"
56-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
57-
with:
58-
repository: ${{ github.repository }}
59-
path: "changed-files"
60-
# The fetch-depth could probably be optimized at some point. It's currently set to zero to
61-
# ensure that we have a successfull diff, regardless of how many commits might be present
62-
# present between the two references we're comparing. It would be nice to change this
63-
# depending on the number of commits by using the push.commits and/or pull_request.commits
64-
# payload fields, however, they have different behavior and limitations. For now we'll do
65-
# the slow but sure thing of getting the whole repository.
66-
fetch-depth: 0
67-
ref: ${{ steps.ref.outputs.ref }}
68-
- id: changed-files
69-
name: changed-files
70-
# This script writes output values to $GITHUB_OUTPUT and STDOUT
71-
shell: bash
72-
run: ./.github/scripts/changed-files.sh ${{ github.event_name }} ${{ github.ref_name }} ${{ github.base_ref }}
73-
working-directory: changed-files

.github/actions/checkout/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ runs:
7070
echo "ref=${checkout_ref}"
7171
echo "depth=${fetch_depth}"
7272
} | tee -a "$GITHUB_OUTPUT"
73-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
73+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7474
with:
7575
path: ${{ inputs.path }}
7676
fetch-depth: ${{ steps.ref.outputs.depth }}

.github/actions/containerize/action.yml

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,24 @@ description: |
1010
1111
inputs:
1212
docker:
13-
type: boolean
1413
description: |
1514
Package the binary into a Docker container suitable for the Docker and AWS registries. We'll
1615
automatically determine the correct tags and target depending on the vault edition.
17-
default: true
16+
default: 'true'
1817
goarch:
19-
type: string
2018
description: The Go GOARCH value environment variable to set during the build.
2119
goos:
22-
type: string
2320
description: The Go GOOS value environment variable to set during the build.
2421
redhat:
25-
type: boolean
2622
description: Package the binary into a UBI container suitable for the Redhat Quay registry.
27-
default: false
23+
default: 'false'
2824
vault-binary-path:
29-
type: string
3025
description: The path to the vault binary.
3126
default: dist/vault
3227
vault-edition:
33-
type: string
3428
description: The edition of vault to build.
3529
default: ce
3630
vault-version:
37-
type: string
3831
description: The vault version.
3932

4033
outputs:
@@ -48,31 +41,52 @@ runs:
4841
- id: vars
4942
shell: bash
5043
run: |
51-
if [[ '${{ inputs.vault-edition }}' =~ 'ce' ]]; then
52-
# CE containers
53-
container_version='${{ inputs.vault-version }}'
54-
docker_container_tags='docker.io/hashicorp/vault:${{ inputs.vault-version }} public.ecr.aws/hashicorp/vault:${{ inputs.vault-version }}'
55-
docker_container_target='default'
56-
redhat_container_tags='quay.io/redhat-isv-containers/5f89bb5e0b94cf64cfeb500a:${{ inputs.vault-version }}-ubi'
57-
redhat_container_target='ubi'
58-
else
59-
# Ent containers
60-
container_version='${{ inputs.vault-version }}+${{ inputs.vault-edition }}'
61-
62-
if [[ '${{ inputs.vault-edition }}' =~ 'fips' ]]; then
63-
# Ent FIPS 140-2 containers
64-
docker_container_tags='docker.io/hashicorp/vault-enterprise-fips:${{ inputs.vault-version }}-${{ inputs.vault-edition }} public.ecr.aws/hashicorp/vault-enterprise-fips:${{ inputs.vault-version }}-${{ inputs.vault-edition }}'
65-
docker_container_target='ubi-fips'
66-
redhat_container_tags='quay.io/redhat-isv-containers/6283f645d02c6b16d9caeb8e:${{ inputs.vault-version }}-${{ inputs.vault-edition }}-ubi'
67-
redhat_container_target='ubi-fips'
68-
else
69-
# All other Ent containers
44+
case '${{ inputs.vault-edition }}' in
45+
"ce")
46+
container_version='${{ inputs.vault-version }}'
47+
docker_container_tags='docker.io/hashicorp/vault:${{ inputs.vault-version }} public.ecr.aws/hashicorp/vault:${{ inputs.vault-version }}'
48+
docker_container_target='default'
49+
redhat_container_tags='quay.io/redhat-isv-containers/5f89bb5e0b94cf64cfeb500a:${{ inputs.vault-version }}-ubi'
50+
redhat_container_target='ubi'
51+
;;
52+
"ent")
53+
container_version='${{ inputs.vault-version }}+${{ inputs.vault-edition }}'
7054
docker_container_tags='docker.io/hashicorp/vault-enterprise:${{ inputs.vault-version }}-${{ inputs.vault-edition}} public.ecr.aws/hashicorp/vault-enterprise:${{ inputs.vault-version }}-${{ inputs.vault-edition }}'
7155
docker_container_target='default'
7256
redhat_container_tags='quay.io/redhat-isv-containers/5f89bb9242e382c85087dce2:${{ inputs.vault-version }}-${{ inputs.vault-edition }}-ubi'
7357
redhat_container_target='ubi'
74-
fi
75-
fi
58+
;;
59+
"ent.hsm")
60+
container_version='${{ inputs.vault-version }}+${{ inputs.vault-edition }}'
61+
docker_container_tags='docker.io/hashicorp/vault-enterprise:${{ inputs.vault-version }}-${{ inputs.vault-edition}} public.ecr.aws/hashicorp/vault-enterprise:${{ inputs.vault-version }}-${{ inputs.vault-edition }}'
62+
docker_container_target='ubi-hsm'
63+
redhat_container_tags='quay.io/redhat-isv-containers/5f89bb9242e382c85087dce2:${{ inputs.vault-version }}-${{ inputs.vault-edition }}-ubi'
64+
redhat_container_target='ubi-hsm'
65+
;;
66+
"ent.hsm.fips1402")
67+
container_version='${{ inputs.vault-version }}+${{ inputs.vault-edition }}'
68+
docker_container_tags='docker.io/hashicorp/vault-enterprise:${{ inputs.vault-version }}-${{ inputs.vault-edition}} public.ecr.aws/hashicorp/vault-enterprise:${{ inputs.vault-version }}-${{ inputs.vault-edition }}'
69+
docker_container_target='ubi-hsm-fips'
70+
redhat_container_tags='quay.io/redhat-isv-containers/5f89bb9242e382c85087dce2:${{ inputs.vault-version }}-${{ inputs.vault-edition }}-ubi'
71+
redhat_container_target='ubi-hsm-fips'
72+
;;
73+
"ent.fips1402")
74+
# NOTE: For compatibility we still publish the ent.fips1402 containers to different
75+
# namespaces. All ent, ent.hsm, and ent.hsm.fips1402 containers are released in the
76+
# enterprise namespaces. After we've updated the upstream docker action to support
77+
# multiple tags we can start to tag images with both namespaces, publish to both, and
78+
# eventually sunset the fips1402 specific namespaces.
79+
container_version='${{ inputs.vault-version }}+${{ inputs.vault-edition }}'
80+
docker_container_tags='docker.io/hashicorp/vault-enterprise-fips:${{ inputs.vault-version }}-${{ inputs.vault-edition }} public.ecr.aws/hashicorp/vault-enterprise-fips:${{ inputs.vault-version }}-${{ inputs.vault-edition }}'
81+
docker_container_target='ubi-fips'
82+
redhat_container_tags='quay.io/redhat-isv-containers/6283f645d02c6b16d9caeb8e:${{ inputs.vault-version }}-${{ inputs.vault-edition }}-ubi'
83+
redhat_container_target='ubi-fips'
84+
;;
85+
*)
86+
echo "Cannot generate container tags for unknown vault edition: ${{ inputs.vault-edition }}" 2>&1
87+
exit 1
88+
;;
89+
esac
7690
{
7791
echo "container-version=${container_version}"
7892
echo "docker-container-tags=${docker_container_tags}"
@@ -90,7 +104,7 @@ runs:
90104
[[ ! -d "$dest_dir" ]] && mkdir -p "$dest_dir"
91105
[[ ! -f "$dest_path" ]] && cp ${{ inputs.vault-binary-path }} "${dest_path}"
92106
- if: inputs.docker == 'true'
93-
uses: hashicorp/actions-docker-build@v2
107+
uses: hashicorp/actions-docker-build@f22d5ac7d36868afaa4be1cc1203ec1b5865cadd
94108
with:
95109
arch: ${{ inputs.goarch }}
96110
do_zip_extract_step: 'false' # Don't download and extract an already present binary
@@ -99,7 +113,7 @@ runs:
99113
revision: ${{ steps.vars.outputs.revision }}
100114
version: ${{ steps.vars.outputs.container-version }}
101115
- if: inputs.redhat == 'true'
102-
uses: hashicorp/actions-docker-build@v2
116+
uses: hashicorp/actions-docker-build@f22d5ac7d36868afaa4be1cc1203ec1b5865cadd
103117
with:
104118
arch: ${{ inputs.goarch }}
105119
do_zip_extract_step: 'false' # Don't download and extract an already present binary
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: BUSL-1.1
3+
4+
---
5+
name: Create dynamic pipeline configuration
6+
description: Create dynamic test configuration by restoring existing valid config or creating new config
7+
8+
inputs:
9+
github-token:
10+
description: An elevated Github token to access private HashiCorp modules.
11+
vault-edition:
12+
description: The vault edition to use when generating the dynamic config
13+
vault-version:
14+
description: The vault version to use when generating the dynamic config
15+
16+
runs:
17+
using: composite
18+
steps:
19+
- name: dyn-cfg-metadata
20+
id: dyn-cfg-metadata
21+
shell: bash
22+
run: |
23+
# We're using a weekly cache key here so that we only regenerate the configuration on a
24+
# weekly basis. If/when Github decides to purge our tiny config file cache we'll also
25+
# recreate it as necessary.
26+
#
27+
# Uses GITHUB_ENV instead of GITHUB_OUTPUT because composite actions are broken,
28+
# see: https://github.com/actions/cache/issues/803#issuecomment-1793565071
29+
{
30+
echo "DYNAMIC_CONFIG_KEY=${{ inputs.vault-version }}-$(date +%Y-%m-%U)"
31+
echo "DYNAMIC_CONFIG_PATH=enos/enos-dynamic-config.hcl"
32+
} | tee -a "$GITHUB_ENV"
33+
- name: Try to restore dynamic config from cache
34+
id: dyn-cfg-cache
35+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
36+
with:
37+
path: ${{ env.DYNAMIC_CONFIG_PATH }}
38+
key: dyn-cfg-${{ env.DYNAMIC_CONFIG_KEY }}
39+
- if: steps.dyn-cfg-cache.outputs.cache-hit != 'true'
40+
id: dyn-cfg-set-up-pipeline
41+
# If we can't restore it from config then set up pipeline and generate it
42+
name: Set up the pipeline tool
43+
uses: ./.github/actions/set-up-pipeline
44+
with:
45+
github-token: ${{ inputs.github-token }}
46+
- if: steps.dyn-cfg-cache.outputs.cache-hit != 'true'
47+
id: dyn-cfg-generate
48+
name: Create dynamic configuration
49+
shell: bash
50+
run: |
51+
# Make sure that any branch specific dynamic config has been generated
52+
pipeline generate enos-dynamic-config -d ./enos -f enos-dynamic-config.hcl -v ${{ inputs.vault-version }} -e ${{ inputs.vault-edition }} -n 3 --log debug

.github/actions/install-external-tools/action.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,23 @@ runs:
1313
steps:
1414
- uses: ./.github/actions/set-up-buf
1515
with:
16-
version: v1.25.0 # This should match the version in tools/tool.sh
16+
version: v1.45.0 # This should match the version in tools/tool.sh
1717
- uses: ./.github/actions/set-up-gofumpt
1818
- uses: ./.github/actions/set-up-gotestsum
1919
- uses: ./.github/actions/set-up-misspell
20+
- uses: ./.github/actions/set-up-shfmt
2021
- uses: ./.github/actions/set-up-staticcheck
2122
# We assume that the Go toolchain will be managed by the caller workflow so we don't set one
2223
# up here.
23-
- run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
24+
- run: ./.github/scripts/retry-command.sh go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.1
2425
shell: bash
25-
- run: go install google.golang.org/grpc/cmd/[email protected]
26+
- run: ./.github/scripts/retry-command.sh go install google.golang.org/grpc/cmd/[email protected]
2627
shell: bash
27-
- run: go install github.com/favadi/protoc-go-inject-tag@latest
28+
- run: ./.github/scripts/retry-command.sh go install github.com/favadi/protoc-go-inject-tag@latest
2829
shell: bash
29-
- run: go install golang.org/x/tools/cmd/goimports@latest
30+
- run: ./.github/scripts/retry-command.sh go install golang.org/x/tools/cmd/goimports@latest
3031
shell: bash
31-
- run: go install github.com/golangci/revgrep/cmd/revgrep@latest
32+
- run: ./.github/scripts/retry-command.sh go install github.com/golangci/revgrep/cmd/revgrep@latest
3233
shell: bash
33-
- run: go install github.com/loggerhead/enumer@latest
34+
- run: ./.github/scripts/retry-command.sh go install github.com/stevendpclark/enumer@v0.0.0-20250122154818-a42b666c3cd3
3435
shell: bash

0 commit comments

Comments
 (0)