Skip to content

Commit

Permalink
Merge branch 'main' into docs-fix-k8s-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletHynes authored Sep 23, 2024
2 parents 345e4c5 + fc5ed22 commit 58d4436
Show file tree
Hide file tree
Showing 591 changed files with 20,094 additions and 8,050 deletions.
4 changes: 2 additions & 2 deletions .github/actions/containerize/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ runs:
[[ ! -d "$dest_dir" ]] && mkdir -p "$dest_dir"
[[ ! -f "$dest_path" ]] && cp ${{ inputs.vault-binary-path }} "${dest_path}"
- if: inputs.docker == 'true'
uses: hashicorp/actions-docker-build@v2
uses: hashicorp/actions-docker-build@f22d5ac7d36868afaa4be1cc1203ec1b5865cadd
with:
arch: ${{ inputs.goarch }}
do_zip_extract_step: 'false' # Don't download and extract an already present binary
Expand All @@ -99,7 +99,7 @@ runs:
revision: ${{ steps.vars.outputs.revision }}
version: ${{ steps.vars.outputs.container-version }}
- if: inputs.redhat == 'true'
uses: hashicorp/actions-docker-build@v2
uses: hashicorp/actions-docker-build@f22d5ac7d36868afaa4be1cc1203ec1b5865cadd
with:
arch: ${{ inputs.goarch }}
do_zip_extract_step: 'false' # Don't download and extract an already present binary
Expand Down
1 change: 1 addition & 0 deletions .github/actions/install-external-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ runs:
- uses: ./.github/actions/set-up-gosimports
- uses: ./.github/actions/set-up-gotestsum
- uses: ./.github/actions/set-up-misspell
- uses: ./.github/actions/set-up-shfmt
- uses: ./.github/actions/set-up-staticcheck
# We assume that the Go toolchain will be managed by the caller workflow so we don't set one
# up here.
Expand Down
61 changes: 61 additions & 0 deletions .github/actions/set-up-shfmt/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1

---
name: Set up shfmt from Github releases
description: Set up shfmt from Github releases

inputs:
destination:
description: "Where to install the shfmt binary (default: $HOME/bin/shfmt)"
type: boolean
default: "$HOME/bin/shfmt"
version:
description: "The version to install (default: latest)"
type: string
default: Latest

outputs:
destination:
description: Where the installed shfmt binary is
value: ${{ steps.install.outputs.destination }}
destination-dir:
description: The directory where the installed shfmt binary is
value: ${{ steps.install.outputs.destination-dir }}
version:
description: The installed version of shfmt
value: ${{ steps.install.outputs.version }}

runs:
using: composite
steps:
- id: install
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=$(./.github/scripts/retry-command.sh gh release list -R mvdan/sh --exclude-drafts --exclude-pre-releases | grep ${{ inputs.version }} | cut -f1)
mkdir -p $(dirname ${{ inputs.destination }})
DESTINATION="$(readlink -f "${{ inputs.destination }}")"
DESTINATION_DIR="$(dirname "$DESTINATION")"
echo "$DESTINATION_DIR" >> "$GITHUB_PATH"
{
echo "destination=$DESTINATION"
echo "destination-dir=$DESTINATION_DIR"
echo "version=$VERSION"
} | tee -a "$GITHUB_OUTPUT"
ARCH="$(echo "$RUNNER_ARCH" | tr '[:upper:]' '[:lower:]')"
OS="$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')"
if [ "$ARCH" = "x64" ]; then
export ARCH="amd64"
fi
if [ "$OS" = "macos" ]; then
export OS="darwin"
fi
./.github/scripts/retry-command.sh gh release download "$VERSION" --clobber -p "shfmt_*_${OS}_${ARCH}" -O shfmt -R mvdan/sh
chmod +x shfmt
mv shfmt "$DESTINATION"
2 changes: 1 addition & 1 deletion .github/workflows/build-artifacts-ce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
redhat: true
- goos: linux
goarch: arm64
redhat: false
redhat: true
fail-fast: true
runs-on: ${{ fromJSON(inputs.compute-build) }}
name: (${{ matrix.goos }}, ${{ matrix.goarch }})
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ jobs:
run: |
yarn install --frozen-lockfile
npm rebuild node-sass
- if: needs.setup.outputs.is-enterprise != 'true'
name: Rebuild font cache on Github hosted runner
# Fix `Fontconfig error: No writable cache directories` error on Github hosted runners
# This seems to have been introduced with this runner image: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240818.1
# Hopefully this will resolve itself at some point with a newer image and we can remove it
run: fc-cache -f -v
- if: needs.setup.outputs.is-enterprise == 'true'
id: vault-auth
name: Authenticate to Vault
Expand All @@ -188,6 +194,7 @@ jobs:
secrets: |
kv/data/github/hashicorp/vault-enterprise/github-token username-and-token | PRIVATE_REPO_GITHUB_TOKEN;
kv/data/github/hashicorp/vault-enterprise/license license_1 | VAULT_LICENSE;
kv/data/github/${{ github.repository }}/datadog-ci DATADOG_API_KEY;
- if: needs.setup.outputs.is-enterprise == 'true'
name: Set up Git
run: git config --global url."https://${{ steps.secrets.outputs.PRIVATE_REPO_GITHUB_TOKEN }}@github.com".insteadOf https://github.com
Expand All @@ -211,6 +218,32 @@ jobs:
with:
name: test-results-ui
path: ui/test-results
- name: Prepare datadog-ci
if: (github.repository == 'hashicorp/vault' || github.repository == 'hashicorp/vault-enterprise') && (success() || failure())
continue-on-error: true
run: |
if type datadog-ci > /dev/null 2>&1; then
exit 0
fi
# Curl does not always exit 1 if things go wrong. To determine if this is successful
# we'll silence all non-error output and check the results to determine success.
if ! out="$(curl -sSL --fail https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64 --output /usr/local/bin/datadog-ci 2>&1)"; then
printf "failed to download datadog-ci: %s" "$out"
fi
if [[ -n "$out" ]]; then
printf "failed to download datadog-ci: %s" "$out"
fi
chmod +x /usr/local/bin/datadog-ci
- name: Upload test results to DataDog
if: success() || failure()
continue-on-error: true
env:
DD_ENV: ci
run: |
if [[ ${{ github.repository }} == 'hashicorp/vault' ]]; then
export DATADOG_API_KEY=${{ secrets.DATADOG_API_KEY }}
fi
datadog-ci junit upload --service "$GITHUB_REPOSITORY" 'ui/test-results/qunit/results.xml'
- if: always()
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/enos-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
ENOS_VAR_tfc_api_token: ${{ secrets.TF_API_TOKEN }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
cache: false # save cache space for vault builds: https://github.com/hashicorp/vault/pull/21764
go-version-file: .go-version
- uses: ./.github/actions/install-external-tools
- uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enos-run-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
jobs:
enos:
name: Integration
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(contains(inputs.artifact-name, 'vault-enterprise') && (contains(inputs.artifact-name, 'arm64') && '["self-hosted","ondemand","os=ubuntu-arm","type=c6g.xlarge"]' || '["self-hosted","linux","small"]') || '"ubuntu-latest"') }}
env:
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
steps:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/plugin-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,27 @@ jobs:
cache: false # save cache space for vault builds: https://github.com/hashicorp/vault/pull/21764
go-version-file: .go-version

- name: update plugin
- name: Update plugin
if: github.repository == 'hashicorp/vault'
run: |
go get "github.com/hashicorp/${{ inputs.plugin }}@v${{ inputs.version }}"
go mod tidy
- name: detect changes
- name: Update Enterprise-only plugin
if: github.repository == 'hashicorp/vault-enterprise'
run: |
(cd vault_ent && go get "github.com/hashicorp/${{ inputs.plugin }}@v${{ inputs.version }}" && go mod tidy)
go mod tidy
- name: Detect changes
run: |
count=$(git status --porcelain=v1 2>/dev/null | wc -l)
if [ "$count" -eq 0 ]; then
echo "::error::no updates were made for ${{ inputs.plugin }} with tag v${{ inputs.version }}"
exit 1
fi
- name: commit/push
- name: Commit and push
run: |
git config user.name hc-github-team-secure-vault-ecosystem
git config user.email [email protected]
Expand All @@ -72,8 +79,9 @@ jobs:
gh pr create \
--head "$VAULT_BRANCH" \
--reviewer "$REVIEWER" \
--assignee "$REVIEWER" \
--title "Update ${{ inputs.plugin }} to v${{ inputs.version }}" \
--body "This PR was generated by a GitHub Action. Full log: https://github.com/hashicorp/vault/actions/runs/${{ github.run_id }}"
--body "This PR was generated by a GitHub Action. Full log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "vault_pr_num=$(gh pr list --head "$VAULT_BRANCH" --json number -q '.[0].number')" >> "$GITHUB_OUTPUT"
echo "vault_pr_url=$(gh pr list --head "$VAULT_BRANCH" --json url -q '.[0].url')" >> "$GITHUB_OUTPUT"
Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout-ref }}
- uses: ./.github/actions/set-up-go
with:
github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
- id: metadata
name: Set up metadata
run: echo "go-test-dir=test-results/go-test" | tee -a "$GITHUB_OUTPUT"
- name: Authenticate to Vault
id: vault-auth
if: github.repository == 'hashicorp/vault-enterprise'
Expand Down Expand Up @@ -131,6 +125,12 @@ jobs:
if: github.repository != 'hashicorp/vault-enterprise'
run: |
git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN}}@github.com".insteadOf https://github.com
- uses: ./.github/actions/set-up-go
with:
github-token: ${{ github.repository == 'hashicorp/vault-enterprise' && steps.secrets.outputs.github-token || secrets.ELEVATED_GITHUB_TOKEN }}
- id: metadata
name: Set up metadata
run: echo "go-test-dir=test-results/go-test" | tee -a "$GITHUB_OUTPUT"
- uses: ./.github/actions/set-up-gotestsum
- run: mkdir -p ${{ steps.metadata.outputs.go-test-dir }}
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand Down Expand Up @@ -243,24 +243,26 @@ jobs:
# Example comments assume:
# - needs.test-matrix.outputs.go-test-dir == test-results/go-test
# - inputs.name == testonly
# - inputs.checkout-ref == main
# - matrix.id == 1
name='${{ inputs.name }}-${{ matrix.id }}' # testonly-1
ref="$(tr / - <<< "${{ inputs.checkout-ref }}")" # main, but removes special characters from refs with /
name="${{ inputs.name }}-${ref}-${{ matrix.id }}" # testonly-main-1
go_test_dir='${{ needs.test-matrix.outputs.go-test-dir }}' # test-results/go-test
test_results_dir="$(dirname "$go_test_dir")" # test-results
go_test_dir_absolute="$(pwd)/${go_test_dir}" # /home/runner/work/vault/vault/test-results/go-test
go_test_log_dir="${go_test_dir}/logs" # test-results/go-test/logs
go_test_log_dir_absolute="${go_test_dir_absolute}/logs" # /home/runner/work/vault/vault/test-results/go-test/logs
go_test_log_archive_name="test-logs-${name}.tar" # test-logs-testonly-1.tar
go_test_results_upload_key="${test_results_dir}-${name}" # test-results/go-test-testonly-1
go_test_results_download_pattern="${test_results_dir}-${{ inputs.name }}-*" # test-results/go-test-testonly-*
go_test_log_archive_name="test-logs-${name}.tar" # test-logs-testonly-main-1.tar
go_test_results_upload_key="${test_results_dir}-${name}" # test-results/go-test-testonly-main-1
go_test_results_download_pattern="${test_results_dir}-${{ inputs.name }}-*" # test-results/go-test-testonly-main-*
gotestsum_results_prefix="results" # results
gotestsum_junitfile=${go_test_dir}/${gotestsum_results_prefix}-${name}.xml # test-results/go-test/results-testonly-1.xml
gotestsum_jsonfile=${go_test_dir}/${gotestsum_results_prefix}-${name}.json # test-results/go-test/results-testonly-1.json
gotestsum_timing_events=failure-summary-${name}.json # failure-summary-testonly-1.json
failure_summary_file_name="failure-summary-${name}.md" # failure-summary-testonly-1.md
gotestsum_junitfile=${go_test_dir}/${gotestsum_results_prefix}-${name}.xml # test-results/go-test/results-testonly-main-1.xml
gotestsum_jsonfile=${go_test_dir}/${gotestsum_results_prefix}-${name}.json # test-results/go-test/results-testonly-main-1.json
gotestsum_timing_events=failure-summary-${name}.json # failure-summary-testonly-main-1.json
failure_summary_file_name="failure-summary-${name}.md" # failure-summary-testonly-main-1.md
data_race_log_file="data-race.log" # data-race.log
data_race_log_download_pattern="data-race-${{ inputs.name }}*.log" # data-race-testonly-*.log
data_race_log_upload_key="data-race-${name}.log" # data-race-testonly-1.log
data_race_log_download_pattern="data-race-${{ inputs.name }}*.log" # data-race-testonly-main-*.log
data_race_log_upload_key="data-race-${name}.log" # data-race-testonly-main-1.log
{
echo "name=${name}"
echo "failure-summary-file-name=${failure_summary_file_name}"
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.22.5
1.22.7
3 changes: 3 additions & 0 deletions .release/versions.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

schema = 1
active_versions {
version "1.18.x" {
ce_active = true
}
version "1.17.x" {
ce_active = true
}
Expand Down
Loading

0 comments on commit 58d4436

Please sign in to comment.