chore: Add content-driven multi-repo Cloud Agent environment - #79
Closed
erezrokah wants to merge 3 commits into
Closed
chore: Add content-driven multi-repo Cloud Agent environment#79erezrokah wants to merge 3 commits into
erezrokah wants to merge 3 commits into
Conversation
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
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.
What
Adds a repository-managed Cloud Agent environment that supports every repo mounted in the workspace, not just this one. Tools are not baked into a base image — instead the install script scans each repo's content on every provisioning and installs the pinned toolchains that repo actually needs. Version bumps in the repos are picked up automatically on the next run.
.cursor/environment.json— default base image + idempotentinstall. Nostart/terminals..cursor/install.sh— locates all repos in the workspace (/agent/repos/*, falls back to the single primary repo), detects each repo's toolchain from its own files, and installs the union of pinned tools. Idempotent: already-correct tools are detected and skipped, so re-runs take ~3s.Detection → tools (all versions read from repo content, overridable via env)
go.modgo.mod) +golangci-lint(version parsed from that repo's CI workflow, e.g.v2.12.2)package.json/pnpm-lock.yaml(+.nvmrc,engines,packageManager).nvmrcpins, e.g.24.12.0) + pnpm via corepack (each pinnedpackageManager)terramate.tm.hcl/*.tf1.14.7fromconfig.tm.hcl) + Terramate.tflint.hclv0.52.0from CI).terraform-docs.ymlkustomization.yamlChart.yaml/HelmReleaseYAMLtoolkit.fluxcd.io/flux checkYAML.pre-commit-config.yamlNode shims are symlinked into
~/go/bin(which precedes/exec-daemonon PATH) so the detected Node version wins over the workspace's default/exec-daemon/node.Verification
Validated on the provisioned workspace VM (all six repos present):
cloud-infrastructure,cloudquery-platform-api-go,frontend,platform,platform-cli,platform-gitops.noderesolves to detected versionv24.12.0(wins over/exec-daemon/nodev22.14.0)frontend→10.23.0while global default is10.34.4golangci-lint runcloudquery-platform-api-goandplatform-cliterramate list(cloud-infrastructure)kustomize build(platform-gitops)terraform / tflint / terraform-docs / helm / flux / pre-commitInstalled versions: go 1.26.5, golangci-lint 2.12.2, node 24.12.0, pnpm 10.23.0/10.34.4, terraform 1.14.7, terramate 0.17.2, tflint 0.52.0, terraform-docs 0.24.0, kustomize 5.8.1, helm 3.21.4, flux 2.9.4, pre-commit 4.6.2.
Note on the linked environment vs the workspace
environment-inforeports onlycloudquery-platform-api-goas the linked repo, so a draft build checks out just that repo and exercises the single-repo path (Go + golangci-lint) plus idempotence. The full multi-repo detection was validated on the provisioned workspace VM above, and the snapshot captures that warm state. To have fresh agents check out all six repos, add the others asrepositoryDependencies(or link them) in the environment settings.Note on
CLOUDQUERY_API_KEYA
CLOUDQUERY_API_KEYsecret is injected as a global env var. Three non-hermeticauthtests in this repo read it, so runenv -u CLOUDQUERY_API_KEY make test(matches CI). No library/test code was changed.Below the cut
Attached artifacts:
install.sh(the detector),environment.json, andmultirepo_validation.log.