-
Notifications
You must be signed in to change notification settings - Fork 662
Replace Ruby bosh-nats-sync with Golang implementation #2746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aramprice
wants to merge
16
commits into
main
Choose a base branch
from
experiment-golang-bosh-nats-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2c72b1d
Golang bosh-nats-sync
aramprice 140f970
Remove ruby-isms now that nats is golang
aramprice a646f31
Fix bosh create-release to work for integration tests
aramprice 17cecf5
Add Go tests for AuthProvider with no CA cert configured (system trus…
colins 7cb6270
Add Go tests for per-error-type connection retry (isConnectionError)
colins 4c149fd
Fix health_monitor NATS Authorization Violation on fresh deployments
colins 2c30161
Fix NATS auth.json parse error caused by HTML-escaped '>' in JSON output
colins fcca786
Add fly:bats rake task to run BATs from local branch via Concourse
colins f0f10e9
Fix bosh-nats-sync writing malformed NATS users for VMs with null age…
colins 5319fa5
fly-bats: inline compile step with Go 1.26.3 workaround
colins e3c58b3
bosh-nats-sync: fix memoization, context plumbing, and connection-err…
aramprice d237223
bosh-nats-sync: address PR review findings in production code
aramprice 8dd13ca
bosh-nats-sync: address PR review findings in test code
aramprice 7bd095c
bosh-nats-sync: document intentional Ruby vs Go behaviour difference …
aramprice 0e01074
bosh-nats-sync: remove dead code + fix runner test temp file leak
aramprice 7e3388f
bosh-nats-sync: use code.cloudfoundry.org/tlsconfig instead of hand-r…
aramprice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| --- | ||
| # Standalone pipeline for running the BOSH Acceptance Test suite (BATs) | ||
| # against a specific branch. | ||
| # | ||
| # Intended to be driven by `bundle exec rake fly:bats` from src/, which | ||
| # pushes the current branch and sets this pipeline automatically. | ||
| # | ||
| # Manual usage: | ||
| # fly -t bosh set-pipeline -p bats-local \ | ||
| # -c ci/fly-bats.yml \ | ||
| # --var bosh_repo=https://github.com/cloudfoundry/bosh.git \ | ||
| # --var bosh_branch=my-feature-branch \ | ||
| # --var env_name=bats-local \ | ||
| # --var stemcell_name=bosh-google-kvm-ubuntu-noble \ | ||
| # --var deploy_args="-o bosh-deployment/external-ip-not-recommended.yml" \ | ||
| # --var bat_rspec_flags="" | ||
| # fly -t bosh unpause-pipeline -p bats-local | ||
| # fly -t bosh trigger-job -j bats-local/bats -w | ||
|
|
||
| resources: | ||
| - name: bosh | ||
| type: git | ||
| source: | ||
| uri: ((bosh_repo)) | ||
| branch: ((bosh_branch)) | ||
|
|
||
| # bosh-ci is the same repo as bosh but filtered to ci/ paths so that | ||
| # scripts under ci/bats/ are available at bosh-ci/ in the task workspace. | ||
| - name: bosh-ci | ||
| type: git | ||
| source: | ||
| uri: ((bosh_repo)) | ||
| branch: ((bosh_branch)) | ||
| paths: [ci] | ||
|
|
||
| - name: bosh-cli | ||
| type: github-release | ||
| source: | ||
| owner: cloudfoundry | ||
| repository: bosh-cli | ||
| access_token: ((github_public_repo_token)) | ||
|
|
||
| - name: stemcell | ||
| type: bosh-io-stemcell | ||
| source: | ||
| name: bosh-google-kvm-ubuntu-noble | ||
|
|
||
| - name: bats | ||
| type: git | ||
| source: | ||
| uri: https://github.com/cloudfoundry/bosh-acceptance-tests.git | ||
| branch: master | ||
|
|
||
| - name: bosh-deployment | ||
| type: git | ||
| source: | ||
| uri: https://github.com/cloudfoundry/bosh-deployment | ||
| branch: master | ||
|
|
||
| - name: integration-image | ||
| type: registry-image | ||
| source: | ||
| repository: ghcr.io/cloudfoundry/bosh/integration | ||
| tag: main | ||
| username: ((github_read_write_packages.username)) | ||
| password: ((github_read_write_packages.password)) | ||
|
|
||
| jobs: | ||
| - name: bats | ||
| serial: true | ||
| plan: | ||
| - do: | ||
| - in_parallel: | ||
| - get: bosh | ||
| - get: bosh-ci | ||
| - get: bosh-cli | ||
| params: | ||
| globs: [bosh-cli-*-linux-amd64] | ||
| - get: stemcell | ||
| - get: bats | ||
| - get: bosh-deployment | ||
| - get: integration-image | ||
|
|
||
| - task: make-candidate | ||
| image: integration-image | ||
| file: bosh-ci/ci/tasks/make-candidate.yml | ||
|
|
||
| - task: compile-bosh-release | ||
| config: | ||
| platform: linux | ||
| # ubuntu-noble-stemcell ships the BOSH agent at /var/vcap/bosh/bin/bosh-agent. | ||
| image_resource: | ||
| type: registry-image | ||
| source: | ||
| repository: ghcr.io/cloudfoundry/ubuntu-noble-stemcell | ||
| inputs: | ||
| - name: release | ||
| outputs: | ||
| - name: compiled-release | ||
| run: | ||
| path: /bin/bash | ||
| args: | ||
| - -exc | ||
| - | | ||
| # golang-1.26-linux on this branch is a stub (env files only; no binary | ||
| # blob in GCS yet). Install Go 1.26.3 and drop a shim at | ||
| # /usr/local/bin/go so `go build` works even though $GOROOT/bin is empty. | ||
| GO_VERSION=1.26.3 | ||
| if ! /usr/local/go/bin/go version 2>/dev/null | grep -q "go${GO_VERSION}"; then | ||
| curl -sSfL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" \ | ||
| | tar -C /usr/local -xz | ||
| fi | ||
| cat > /usr/local/bin/go <<'GOSHIM' | ||
| #!/bin/bash | ||
| export GOROOT=/usr/local/go | ||
| exec /usr/local/go/bin/go "$@" | ||
| GOSHIM | ||
| chmod +x /usr/local/bin/go | ||
|
|
||
| /var/vcap/bosh/bin/bosh-agent compile \ | ||
| --output-directory compiled-release \ | ||
| release/*.tgz | ||
|
|
||
| - task: run-bats | ||
| image: integration-image | ||
| input_mapping: | ||
| bosh-release: compiled-release | ||
| config: | ||
| platform: linux | ||
| inputs: | ||
| - name: bosh | ||
| - name: bosh-ci | ||
| - name: bosh-cli | ||
| - name: bosh-deployment | ||
| - name: stemcell | ||
| - name: bats | ||
| - name: bosh-release | ||
| caches: | ||
| - path: cache-dot-bosh-dir | ||
| params: | ||
| BAT_INFRASTRUCTURE: gcp | ||
| GCP_JSON_KEY: ((gcp_json_key)) | ||
| GCP_PROJECT_ID: ((gcp_project_id)) | ||
| STEMCELL_NAME: ((stemcell_name)) | ||
| ENV_NAME: ((env_name)) | ||
| DEPLOY_ARGS: ((deploy_args)) | ||
| BAT_RSPEC_FLAGS: ((bat_rspec_flags)) | ||
| run: | ||
| path: bosh/ci/tasks/run-bats-pipeline.sh |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.