Repository navigation
Add build-rejson composite action - #10
Merged
Merged
Conversation
Shared, cached RedisJSON build for RediSearch-family flow tests, unifying the per-repo copies. The RediSearch checkout root is an input so repos that vendor RediSearch as a submodule can use it, an optional toolchain script is sourced before keying and building, and the cache key also covers the C compiler and job-level build flags so entries are never shared across toolchains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b5a6995. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Purpose
A shared, cached RedisJSON build for flow tests that load RedisJSON as a side module. Today RediSearch has its own
.github/actions/build-rejson, and a repo that vendors RediSearch as a submodule keeps a near-copy of it. This action is the union of the two, so both can drop their local copy and keep the same behaviour.On a cache hit,
rejson.sois restored. On a miss, it is built through RediSearch's owntests/deps/setup_rejson.sh(the script the flow tests source) and then saved. Every step is inline, so the action is container-safe and doesn't depend ongithub.action_path.Inputs / outputs
rejson-branchmastersan""""oraddress). Passed asSAN.cov"0"1= coverage build. Passed asCOV.cache_platform_idredisearch-root.$GITHUB_WORKSPACEor absolute. It must contain.rust-nightlyandtests/deps/setup_rejson.sh.toolchain-enable""export-rejson-pathtruetrue, writesREJSON_PATHto$GITHUB_ENV.rejson-path$GITHUB_WORKSPACE/bin/rejson.so(built or restored).cache-hit'true'when restored from cache.Cache key
cc_<hash>is the first 12 hex digits of a SHA-256. It covers the first line of${CC:-cc} --versionplus the values ofCFLAGS,CXXFLAGS,LDFLAGS,RUSTFLAGSandCARGO_ENCODED_RUSTFLAGS. It is computed in the same login shell as the build, aftertoolchain-enablehas been sourced. The hashed material is printed to the log.setup_rejson.shrunsmakewith the inherited environment, so the compiler and any job-level flags shape the binary. Hashing them means an entry is never shared across compilers or flags. The other components are the same as the RediSearch original.Differences from the RediSearch original
redisearch-rootinput replaces the hardcoded$GITHUB_WORKSPACEfor.rust-nightlyandsetup_rejson.sh. This is required for reuse; the default.keeps current behaviour.toolchain-enableinput lets jobs that switch compilers via an enable script key and build with the compiler their tests use.cc_key component, as above.bash -leo pipefail(as the build step already did), so the compiler and flags it sees match the build.set -u, because typical toolchain enable scripts read unset variables. The shell still runs with-eo pipefail.rejson-path/cache-hitoutputs are added. TheREJSON_PATHexport stays, as the default, behindexport-rejson-path.rejson-branchis optional and defaults tomaster, the same default assetup_rejson.sh. Existing callers always pass it.shasum -a 256wheresha256sumis missing (macOS runners).actions/cache/{restore,save}stay on the same SHA pin (v5.1.0).Differences from the submodule-consumer copy
san/covinputs and theREJSON_PATHexport are restored. Defaults are empty,0andtrue. Passexport-rejson-path: 'false'to keep output-only behaviour.actions/cacheis pinned by SHA (v5.1.0) instead of the@v6tag, per this repo's third-party pinning rule.san_none-cov_0and the flags hash, so expect one cold miss per platform after migrating.Migration
RediSearch is a one-line swap in
task-build-rejson.ymlandtask-test.yml, after which.github/actions/build-rejson/can be deleted:The inputs are unchanged. Expect one cold miss per platform/flavour, because of the added
cc_component.Submodule consumers:
If a job selects its compiler through
CCrather than an enable script, setCCin theenv:of theuses:step so it is applied to both the key and the build.Validation
actionlint1.7.7 and the strict duplicate-key YAML check pass locally. Shellcheck of the extractedrun:scripts shows only the expected dynamic-sourcenotes. The key script was smoke-tested locally, and it produces a different key whenRUSTFLAGSchanges.🤖 Generated with Claude Code
Note
Low Risk
CI-only shared action and documentation; no runtime product or auth/data-path changes.
Overview
Adds a shared
build-rejsoncomposite action so RediSearch-family repos can build or restore a cachedrejson.sofor flow tests instead of duplicating local actions.The action resolves a RedisJSON ref to a SHA, restores
rejson.sofrom GitHub Actions cache on a hit, or on a miss runs RediSearch’stests/deps/setup_rejson.sh(via configurableredisearch-root) and saves the binary. Cache keys include RedisJSON SHA, platform id, arch, sanitizer/coverage, pinned.rust-nightly, and a hash of the active C compiler plusCFLAGS/RUSTFLAGS(with optionaltoolchain-enable). It outputsrejson-pathandcache-hit, and by default exportsREJSON_PATHfor later steps. Steps are fully inline for container jobs.README documents the new utility in the shared CI table.
Reviewed by Cursor Bugbot for commit b5a6995. Bugbot is set up for automated code reviews on this repo. Configure here.