open-vault/scripts
Ryan Cragun 4c4798417f
[QT-358] Unify CRT and local builder workflows (#17766)
Here we make the following major changes:

* Centralize CRT builder logic into a script utility so that we can share the
  logic for building artifacts in CI or locally.
* Simplify the build workflow by calling a reusable workflow many times
  instead of repeating the contents.
* Create a workflow that validates whether or not the build workflow and all
  child workflows have succeeded to allow for merge protection.

Motivation

* We need branch requirements for the build workflow and all subsequent
  integration tests (QT-353)
* We need to ensure that the Enos local builder works (QT-558)
* Debugging build failures can be difficult because one has to hand craft the
  steps to recreate the build
* Merge conflicts between Vault OSS and Vault ENT build workflows are quite
  painful. As the build workflow must be the same file and name we'll reduce
  what is contained in each that is unique. Implementations of building
  will be unique per edition so we don't have to worry about conflict
  resolution.
* Since we're going to be touching the build workflow to do the first two
  items we might as well try and improve those other issues at the same time
  to reduce the overhead of backports and conflicts.

Considerations

* Build logic for Vault OSS and Vault ENT differs
* The Enos local builder was duplicating a lot of what we did in the CRT build
  workflow
* Version and other artifact metadata has been an issue before. Debugging it
  has been tedious and error prone.
* The build workflow is full of brittle copy and paste that is hard to
  understand, especially for all of the release editions in Vault Enterprise
* Branch check requirements for workflows are incredibly painful to use for
  workflows that are dynamic or change often. The required workflows have to be
  configured in Github settings by administrators. They would also prevent us
  from having simple docs PRs since required integration workflows always have
  to run to satisfy branch requirements.
* Doormat credentials requirements that are coming will require us to modify
  which event types trigger workflows. This changes those ahead of time since
  we're doing so much to build workflow. The only noticeable impact will be
  that the build workflow no longer runs on pushes to non-main or release
  branches. In order to test other branches it requires a workflow_dispatch
  from the Actions tab or a pull request.

Solutions

* Centralize the logic that determines build metadata and creates releasable
  Vault artifacts. Instead of cargo-culting logic multiple times in the build
  workflow and the Enos local modules, we now have a crt-builder script which
  determines build metadata and also handles building the UI, Vault, and the
  package bundle. There are make targets for all of the available sub-commands.
  Now what we use in the pipeline is the same thing as the local builder, and
  it can be executed locally by developers. The crt-builder script works in OSS
  and Enterprise so we will never have to deal with them being divergent or with
  special casing things in the build workflow.
* Refactor the bulk of the Vault building into a reusable workflow that we can
  call multiple times. This allows us to define Vault builds in a much simpler
  manner and makes resolving merge conflicts much easier.
* Rather than trying to maintain a list and manually configure the branch check
  requirements for build, we'll trigger a single workflow that uses the github
  event system to determine if the build workflow (all of the sub-workflows
  included) have passed. We'll then create branch restrictions on that single
  workflow down the line.

Signed-off-by: Ryan Cragun me@ryan.ec
2022-11-11 13:14:43 -07:00
..
cross Remove gox in favor of go build. (#16353) 2022-07-20 10:44:41 -07:00
docker Reduce number of places where go version is set (#17762) 2022-11-01 15:37:13 -04:00
windows Remove gox in favor of go build. (#16353) 2022-07-20 10:44:41 -07:00
assetcheck.sh Replace go-bindata-assetfs build dependency with native go:embed (#11208) 2021-08-18 11:05:11 -04:00
build.sh [QT-358] Unify CRT and local builder workflows (#17766) 2022-11-11 13:14:43 -07:00
coverage.sh
crt-builder.sh [QT-358] Unify CRT and local builder workflows (#17766) 2022-11-11 13:14:43 -07:00
deps_upgrade.py
dist.sh Rename some references from master to main (#11897) 2021-06-18 11:24:54 -07:00
gen_openapi.sh Fix gen_openapi.sh script to load plugins (#17752) 2022-11-01 17:32:54 -04:00
gofmtcheck.sh
goversioncheck.sh
protocversioncheck.sh Enforce a minimum version for protoc (#17122) 2022-09-13 19:46:35 -07:00
semgrep_plugin_repos.sh Add Semgrep Rules to OSS (#14513) 2022-03-18 11:14:03 -07:00
testciphers.sh
update_deps.sh
update_plugin_modules.sh Rename some references from master to main (#11897) 2021-06-18 11:24:54 -07:00