Skip to content

Commit

Permalink
Updated Beta release 0.9.1 (#62)
Browse files Browse the repository at this point in the history
* Updated SEMP schema to 2.39
* Improvements and fixes:
   * SOL-109405	Upgrade Terraform provider to Go v1.21
   * SOL-100797	Objects that dont have dependancies dont follow the 'request_min_interval' provider attribute
   * SOL-100812	The request_min_interval attribute seems to wait before the first SEMP request is sent
   * SOL-101839	Improved retry mechanism in provider SEMP client
   * SOL-104984	Generator needs to escape certain charaters in attribute names
   * SOL-105581	Removed `id` attribute as it is no longer needed by the Terraform test framework v1.5
   * SOL-105859	broker provider makes API calls at configure time
   * SOL-105867	Generator needs to handle terraform interpolation in string  outputs
  • Loading branch information
bczoma authored Dec 20, 2023
1 parent ce6d2cf commit 3726eef
Show file tree
Hide file tree
Showing 281 changed files with 5,656 additions and 5,014 deletions.
40 changes: 7 additions & 33 deletions .github/workflows/cli-test-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Terraform latest
uses: hashicorp/setup-terraform@v2

- name: Setup Test broker
run: |
mkdir -p $HOME/solace; chmod 777 $HOME/solace
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard
docker run -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env username_admin_globalaccesslevel=admin --env username_admin_password=admin --env system_scaling_maxkafkabridgecount="10" --name=solace \
--mount type=bind,source=$HOME/solace,destination=/var/lib/solace,ro=false solace/solace-pubsub-standard:"10.6.1.52"
while ! curl -s localhost:8080 | grep aurelia ; do sleep 1 ; done
- name: Use local provider
Expand All @@ -35,36 +35,10 @@ jobs:
direct {}
}" > ~/.terraformrc
- name: Checkout generator
uses: actions/checkout@v3
with:
repository: SolaceDev/broker-terraform-provider-generator
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
path: broker-terraform-provider-generator
ref: "v0.1.0"

- name: Build and install generator
run: |
pushd broker-terraform-provider-generator
go mod tidy
go install .
ls ~/go/bin
popd
- name: Generate provider code
run: |
SWAGGER_SPEC_NAME=`ls ci/swagger_spec`
echo "Generating code using spec $SWAGGER_SPEC_NAME"
BASE=`pwd`
pushd internal/broker/generated
rm ./*
SEMP_V2_SWAGGER_CONFIG_EXTENDED_JSON="$BASE/ci/swagger_spec/$SWAGGER_SPEC_NAME" ~/go/bin/broker-terraform-provider-generator all
popd
- name: Build provider
run: |
go mod tidy
go install .
make test-coverage
make install
ls ~/go/bin
terraform-provider-solacebroker -h
Expand Down Expand Up @@ -136,7 +110,7 @@ jobs:
run: |
SOLACEBROKER_REGISTRY_OVERRIDE=registry.terraform.io/solaceproducts/solacebroker SOLACEBROKER_USERNAME=admin SOLACEBROKER_PASSWORD=admin terraform-provider-solacebroker generate --url=http://localhost:8080 solacebroker_msg_vpn.qn another messageVpn.tf
cat messageVpn.tf
grep -o 'solacebroker_msg_vpn_queue ' messageVpn.tf | wc -l | grep 21
grep -o 'solacebroker_msg_vpn_queue" ' messageVpn.tf | wc -l | grep 21
- name: Create custom messageVPN with large config
run: |
Expand Down
50 changes: 30 additions & 20 deletions .github/workflows/core-pipeline-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Build Terraform Provider in Development phase
# Branch naming convention assumes dev branches start with "dev" then semver release name,
# internal QA release candidate branches start with "v" then semver release name.

on:
push:
Expand All @@ -13,23 +15,23 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Terraform latest
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false

- name: Checkout generator
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: SolaceDev/broker-terraform-provider-generator
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
path: broker-terraform-provider-generator
ref: "v0.1.0"
ref: "v0.2.0"

- name: Build and install generator
run: |
Expand All @@ -51,24 +53,30 @@ jobs:
- name: Build provider
run: |
go mod tidy
go fmt
go install .
make dep
make fmt
make install
~/go/bin/terraform-provider-solacebroker version
~/go/bin/terraform-provider-solacebroker help
- name: Test Provider and generate documentations
run: |
make test-coverage
make testacc
make generate-docs
- name: Ensure version reflects release candidate version
run: |
if echo "${{ github.ref_name }}" | grep ^dev || echo "${{ github.ref_name }}" | grep ^v ; then
VERSION=$(echo "${{ github.ref_name }}" | cut -d'v' -f2)
sed -i "s/version =.*$/version = \"${VERSION}\"/g" version.go
fi
- name: Check changed files
uses: tj-actions/verify-changed-files@v14
uses: tj-actions/verify-changed-files@v16
id: check-changed-files
with:
files: |
internal/broker/generated
docs
!broker-terraform-provider-generator
- name: Run step only when any of the above files change.
if: steps.check-changed-files.outputs.files_changed == 'true'
Expand All @@ -81,17 +89,19 @@ jobs:
with:
committer_name: GitHub Actions
committer_email: [email protected]
message: 'Updating generated source [skip ci]'
add: 'internal/broker/generated/*.go'
message: 'Updating generated source'
add: ". ':!broker-terraform-provider-generator'"
new_branch: GeneratedSourceUpdates-${{ github.ref_name }}

# - name: Create pull request
# if: steps.check-changed-files.outputs.files_changed == 'true'
# run: |
# CURRENT_BRANCH=${GITHUB_REF_NAME}
# gh pr create -B ${CURRENT_BRANCH} -H "GeneratedSourceUpdates-${CURRENT_BRANCH}" --title "Merge generated source updates into ${CURRENT_BRANCH}" --body 'Created by Github action'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create pull request
if: steps.check-changed-files.outputs.files_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CURRENT_BRANCH=${GITHUB_REF_NAME}
gh pr create -B ${CURRENT_BRANCH} -H "GeneratedSourceUpdates-${CURRENT_BRANCH}" --title "Merge generated source updates into ${CURRENT_BRANCH}" --body 'Created by Github action'
echo Review and approve PR before push can continue
exit 1 // force actions stop here
Plugin-Integration-Test:
needs: build
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/core-pipeline-main-branch-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Terraform latest
uses: hashicorp/setup-terraform@v2
Expand All @@ -25,11 +25,8 @@ jobs:

- name: Build provider
run: |
go mod tidy
go fmt
go install .
make install
~/go/bin/terraform-provider-solacebroker version
~/go/bin/terraform-provider-solacebroker help
Plugin-Integration-Test:
needs: build
Expand Down
129 changes: 129 additions & 0 deletions .github/workflows/prep-internal-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Launched manually
on:
workflow_dispatch:
inputs:
release_branch_name:
description: 'Release branch name, must start with v'
required: true
default: 'v0.1.0-rc.1'


jobs:
build:
name: Prep release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"

- name: Checkout the code
uses: actions/checkout@v2

- name: Check release version and set next version
run: |
if ! echo "${{ github.event.inputs.release_branch_name }}" | grep ^v ; then
echo "Incorrect release branch name ${{ github.event.inputs.release_branch_name }}, must start with 'v'" ; exit 1
fi
if echo "${{ github.ref_name }}" | grep ^dev ; then
# set next dev version GH env, otherwise set it empty
echo "NEXT_DEV_VERSION=$(echo ${{ github.ref_name }} | awk -F. -v OFS=. '{$NF += 1 ; print}')" >> $GITHUB_ENV
fi
- name: Code format, dependencies, checks
run: |
make fmt
make dep
make vet
- name: Check code builds and pass acceptance test
run: |
make install
make testacc
- name: Ensure all docs have been generated
run: make generate-docs

- name: Ensure version reflects release candidate version
run: |
VERSION=$(echo "${{ github.event.inputs.release_branch_name }}" | cut -d'v' -f2)
sed -i "s/version =.*$/version = \"${VERSION}\"/g" version.go
- name: Check changed files
uses: tj-actions/verify-changed-files@v14
id: check-changed-files

- name: Run step only when any of the files change
if: steps.check-changed-files.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.check-changed-files.outputs.changed_files }}"
- name: Commit back updates when any of the files change
if: steps.check-changed-files.outputs.files_changed == 'true'
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions
committer_email: [email protected]
message: 'Updating release candidate [skip ci]'
new_branch: GeneratedSourceUpdates-${{ github.ref_name }}

- name: Create pull request if needed, then break here because manual approval of the changes is required
if: steps.check-changed-files.outputs.files_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CURRENT_BRANCH=${GITHUB_REF_NAME}
gh pr create -B ${CURRENT_BRANCH} -H "GeneratedSourceUpdates-${CURRENT_BRANCH}" --title "Merge generated source updates into release candidate ${CURRENT_BRANCH}" --body 'Created by Github action'
echo Review and approve PR before release can continue
exit 1 // force actions stop here
- name: Prep product release for Whitesource
run: |
VERSION=$(cat version.go | grep version | cut -d'=' -f2 | xargs)
sed -i "s/productVersion=.*$/productVersion=v${VERSION}/g" ci/whitesource/whitesource-agent.config
sed -i "s/productName=.*$/productName=${{ github.event.repository.name }}/g" ci/whitesource/whitesource-agent.config
sed -i "s/projectName=.*$/projectName=${{ github.event.repository.name }}/g" ci/whitesource/whitesource-agent.config
cat ci/whitesource/whitesource-agent.config | grep productVersion
- name: Run Whitesource Action to update licenses
uses: SolaceDev/[email protected]
with:
wssURL: https://saas.whitesourcesoftware.com/agent
apiKey: ${{ secrets.WSS_API_KEY }}
productName: ${{ github.event.repository.name }}
projectName: ${{ github.event.repository.name }}
configFile: 'ci/whitesource/whitesource-agent.config'

- name: Create the release branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "${{ github.event.inputs.release_branch_name }}"

# - name: Create next dev branch
# if: env.NEXT_DEV_VERSION != ''
# uses: peterjgrainger/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# branch: ${{ env.NEXT_DEV_VERSION }}

- name: Create next dev branch
if: env.NEXT_DEV_VERSION != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -b ${{ env.NEXT_DEV_VERSION }}
VERSION=$(echo "${{ env.NEXT_DEV_VERSION }}" | cut -d'v' -f2)
sed -i "s/version =.*$/version = \"${VERSION}\"/g" version.go
git commit -a -m "Uprev'd version to ${VERSION}"
git push --set-upstream origin ${{ env.NEXT_DEV_VERSION }}
- name: Delete last dev branch
if: env.NEXT_DEV_VERSION != ''
uses: dawidd6/action-delete-branch@v3
with:
github_token: ${{github.token}}
branches: "${{ github.ref_name }}"
4 changes: 2 additions & 2 deletions .github/workflows/provider-acceptance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Acceptance test
run: |
Expand Down
Loading

0 comments on commit 3726eef

Please sign in to comment.