Skip to content

Name each patched package as a VEX product so Trivy and Grype match it #230

Name each patched package as a VEX product so Trivy and Grype match it

Name each patched package as a VEX product so Trivy and Grype match it #230

Workflow file for this run

name: Bazel patch compatibility (Go)
# The Go flows of the real-Bazel tests (`go::` in `e2e_bazel_build`):
# hosted, vendored and agent mode for a module that gazelle's `go_deps`
# resolves from `go.mod`, on each Bazel release below.
# bazel-compatibility.yml holds the legs and what every ecosystem shares;
# this file says when the Go legs run and on which releases.
#
# Beyond what every leg needs, a Go leg downloads the Go SDK from
# dl.google.com (about 100 MB, held by its repository cache) and asks go.dev
# for the Go release list on every run. A Go module under test never comes
# from the repository cache: `go` fetches a module into the output base,
# which every test makes anew. The same holds for the modules gazelle is
# built from, which a test that runs `bazel run //:gazelle` has `go` fetch
# from proxy.golang.org.
#
# Not required for merge: no `merge_group` trigger, and no job here is a
# `needs` of ci.yml's `ci-ok`.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# What a pull request run covers: the Go flow and its fixture, the
# harness and the workflows that run it, the Bazel installer and its
# pins, the Go files the flow runs through, as go-compatibility.yml
# lists them, what socket-patch does only in a Bazel workspace
# (`bazel/`), and the VEX code: `vex/` of the core and the files of the
# `vex` command. Every flow holds the exact document socket-patch writes
# about its patched build, so a change to how a document is built or
# worded starts the legs of every ecosystem. Nothing else that another
# ecosystem's flow owns is here, so any other change to one ecosystem
# starts that ecosystem's legs only.
#
# What it does not cover: shared engine code (patch/redirect/mod.rs,
# hosted/, the rest of commands/), the shared test helpers and the
# toolchain files.
# A change there gets its run on the push to main (when the file is in
# the list below) or in the nightly run, not on the pull request: that
# is the price of not running every ecosystem's legs on every shared
# change. On demand, workflow_dispatch runs the legs on any branch.
paths:
- '.github/workflows/bazel-go.yml'
- '.github/workflows/bazel-compatibility.yml'
- 'scripts/install-bazel.sh'
- 'scripts/bazel-pins.txt'
- 'crates/socket-patch-cli/tests/e2e_bazel_build/go.rs'
- 'crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs'
- 'crates/socket-patch-cli/tests/fixtures/bazel/gazelle/**'
- 'crates/*/src/**/*golang*'
- 'crates/*/src/**/*golang*/**'
- 'crates/socket-patch-core/src/vendor/go*.rs'
- 'crates/socket-patch-core/src/bazel/**'
- 'crates/socket-patch-core/src/vex/**'
- 'crates/socket-patch-cli/src/commands/vex*.rs'
push:
branches: [main]
# The pull request paths, and what only a push to main covers: the
# root of the test target (it changes when an ecosystem's module is
# added; ci.yml builds the target and runs its hermetic tests on every
# pull request), the shared engine code and test helpers the flow runs
# through, and the toolchain files. A main push outside this list waits
# for the nightly run below.
paths:
- '.github/workflows/bazel-go.yml'
- '.github/workflows/bazel-compatibility.yml'
- 'scripts/install-bazel.sh'
- 'scripts/bazel-pins.txt'
- 'crates/socket-patch-cli/tests/e2e_bazel_build/go.rs'
- 'crates/socket-patch-cli/tests/e2e_bazel_build/harness.rs'
- 'crates/socket-patch-cli/tests/fixtures/bazel/gazelle/**'
- 'crates/*/src/**/*golang*'
- 'crates/*/src/**/*golang*/**'
- 'crates/socket-patch-core/src/vendor/go*.rs'
- 'crates/socket-patch-core/src/bazel/**'
- 'crates/socket-patch-core/src/vex/**'
- 'crates/socket-patch-cli/src/commands/vex*.rs'
- 'crates/socket-patch-cli/tests/e2e_bazel_build/main.rs'
- 'crates/socket-patch-core/src/patch/redirect/**'
- 'crates/socket-patch-core/src/hosted/**'
- 'crates/socket-patch-cli/src/commands/**'
- 'crates/socket-patch-cli/tests/common/**'
- 'crates/socket-patch-cli/tests/hosted_memory_common/**'
- 'Cargo.lock'
- 'Cargo.toml'
- 'crates/*/Cargo.toml'
- 'rust-toolchain.toml'
- '.cargo/**'
schedule:
# Nightly, so a main change outside the push list still gets a run
# within a day. The macOS leg runs here and on demand only.
- cron: '17 4 * * *'
workflow_dispatch:
permissions:
contents: read
# The nightly run has a group of its own. A group holds one pending run, so
# in the group of main's pushes a second push would replace a nightly that
# waits behind the first, and the nightly is the only run with the macOS leg.
concurrency:
group: bazel-go-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'schedule' && '-nightly' || '' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
go:
uses: ./.github/workflows/bazel-compatibility.yml
with:
eco: go
fixtures: gazelle/bzlmod
# One leg per line: a Bazel release, and the era of the fixture that
# `go::FIXTURE` gives it.
releases: >-
[
{"bazel": "9.3.2", "era": "e9"},
{"bazel": "8.8.2", "era": "e9"},
{"bazel": "7.7.2", "era": "e7"}
]
macos: >-
[
{"bazel": "9.3.2", "era": "e9"}
]