-
Notifications
You must be signed in to change notification settings - Fork 111
[CLIENT-3467] CI/CD: use orchestrator workflow instead of individual shared workflows #994
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
juliannguyen4
wants to merge
83
commits into
dev
Choose a base branch
from
CLIENT-3467-cicd-use-orchestrator-workflow-instead-of-individual-ones
base: dev
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
83 commits
Select commit
Hold shift + click to select a range
ebed4ca
wip
juliannguyen4 b3cf0ed
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 da9f480
get jfrog project name dynamically from env var
juliannguyen4 ff0960e
example was wrong?
juliannguyen4 cab272e
do basic plumbing
juliannguyen4 03d1fd7
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 1bc924a
Update shared-workflows
juliannguyen4 35b8c93
Limit permissions for the bump-version workflow
juliannguyen4 e38ee31
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 f730670
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 974612b
Just use config variable for simplcity for now
juliannguyen4 3c477a9
fix
juliannguyen4 cc815dc
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 85ba1cb
Remove overly permissive permissions. Add dry run option to avoid aff…
juliannguyen4 e620aa2
Finish dry run
juliannguyen4 f8608e2
Fix dry run not working in push event
juliannguyen4 ae61fdb
fix
juliannguyen4 1a42a96
Fix oidc credentials
juliannguyen4 76c389c
try databases proj
juliannguyen4 ff27629
Add glue code
juliannguyen4 ec8d426
fix...
juliannguyen4 23e8734
fix...
juliannguyen4 b5f62a8
fix
juliannguyen4 aa6fc5b
Replace oidc credentials with variables in case it's changed upstream
juliannguyen4 2c25023
Fix
juliannguyen4 4f7b0a1
Add job to promote release bundle to DEV
juliannguyen4 ea8975c
fix
juliannguyen4 2d57d4c
Create reusable workflow to promote release bundle to any stage
juliannguyen4 38f679a
In dev-to-stage workflow, promote release bundle to TEST environment
juliannguyen4 543008b
Fix syntax..
juliannguyen4 fb9549a
Write skeleton code for promoting to dev
juliannguyen4 84f7172
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 e11b6b7
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 97440d8
very WIP
juliannguyen4 255d129
Add back dev-workflow-part2.yml. It will be used to tag commits but n…
juliannguyen4 f246032
Todo wip
juliannguyen4 0076fc7
fix
juliannguyen4 2163d70
Resolve warnings about permissions
juliannguyen4 83e32cd
Valgrind: have option to use github artifact instead of jfrog artifact
juliannguyen4 bfae492
Register
juliannguyen4 d5713c3
fix
juliannguyen4 2706116
Revert "Register"
juliannguyen4 293a21b
Both reusable workflows need this permission
juliannguyen4 7a3f55a
Calling workflow permissions cannot be elevated
juliannguyen4 9e2f5a4
Fix permissions
juliannguyen4 1b2e981
fix ghcr.io docker images not being pulled
juliannguyen4 424a09c
Add test-file input to speed up debugging.
juliannguyen4 11755d3
Only download a specific artifact and not all artifacts
juliannguyen4 e774330
Add inputs to run name to make easier to find test runs
juliannguyen4 14795a7
Reusable workflow must inherit secrets to access them
juliannguyen4 c976de5
We want valgrind job to pass to test the other jobs downstream
juliannguyen4 1efd797
TODO WIP
juliannguyen4 951fab3
fix
juliannguyen4 5fce493
Forgot that workflow_call is not set in github.event_name
juliannguyen4 1b7924e
fix
juliannguyen4 97f55e0
fix
juliannguyen4 ac98873
fix
juliannguyen4 7f49a57
fix..
juliannguyen4 0cd96e8
just use this for now
juliannguyen4 7554b36
Add ability to skip dev tests in case self hosted runners are being u…
juliannguyen4 2147e1e
Fix...
juliannguyen4 b1ffab4
Revert "just use this for now"
juliannguyen4 d44f31d
fix
juliannguyen4 460b4a8
Try passing signing-key
juliannguyen4 d24575e
Jerry rig for testing
juliannguyen4 b499f09
Push to a specific repo to avoid pushing to all repos mapping to DEV …
juliannguyen4 3315d8c
leave as todo for now.
juliannguyen4 a6d15bb
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 9985035
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 6dab600
Test changes in my PR
juliannguyen4 6b27148
For dry running, don't promote release bundle
juliannguyen4 fa5204e
Since this workflow is only run manually, don't check for push events
juliannguyen4 816b901
fix workflow
juliannguyen4 fb84775
have jf rbp composite action take in the repo name to allow other tea…
juliannguyen4 8db6b53
Fix workflow. Also allow passing in JFrog project name to composite a…
juliannguyen4 8f06652
Make sure jf rbp also knows the project to use
juliannguyen4 de1ee5f
Create new revision to test release bundle workflow. Cannot delete re…
juliannguyen4 1a3af4c
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 0af4ff5
Download artifact from latest release bundle
juliannguyen4 3be525d
For now, don't bump and commit the new version in dev.
juliannguyen4 78ee4be
Merge remote-tracking branch 'origin/dev' into CLIENT-3467-cicd-use-j…
juliannguyen4 1a9ee87
WIP definitely not done
juliannguyen4 a2abc21
WIP on shell script that builds python client from source. This can b…
juliannguyen4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,57 @@ | ||
| # On macOS and Windows, this is expected to run on bare metal | ||
| # On Linux, this is expected to run in a container from the manylinux image | ||
| os=$(uname -s) | ||
| running_on_windows=$([[ "$os" =~ CYGWIN* || "$os" =~ MINGW* ]]) | ||
| if [[ $running_on_windows ]]; then | ||
| nuget restore | ||
| fi | ||
|
|
||
| if [[ $os =~ Darwin* ]]; then | ||
| brew install openssl@3 libyaml | ||
|
|
||
| export MACOSX_DEPLOYMENT_TARGET | ||
| MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -d"." -f 1).0" | ||
|
|
||
| if [[ $(uname -m) == "arm64" ]]; then | ||
| libraries=('libyaml' 'openssl') | ||
| for library in "${libraries[@]}"; do | ||
| LIBRARY_PATH="${LIBRARY_PATH}:$(brew --prefix "$library")/lib" | ||
| done | ||
| export LIBRARY_PATH="$LIBRARY_PATH" | ||
| else | ||
| export LDFLAGS='-headerpad_max_install_names' | ||
| fi | ||
| fi | ||
|
|
||
| if [[ $os =~ Linux* ]]; then | ||
| yum install libyaml-devel -y | ||
| fi | ||
|
|
||
| python3 -m pip install build -c requirements.txt | ||
| python3 -m build | ||
|
|
||
| if [[ $os =~ Linux* ]]; then | ||
| unrepaired_wheel_path=$(find dist/ -type f -name '*.whl' | head -n 1) | ||
| if [[ "$DEBUG" != "" ]]; then | ||
| auditwheel show "$unrepaired_wheel_path" | ||
| WHEEL_DIR=wheel-contents | ||
| unzip "$unrepaired_wheel_path" -d $WHEEL_DIR | ||
| ldd $WHEEL_DIR/*.so | awk '{print $1}' | grep libssl.so.3 | ||
| ldd $WHEEL_DIR/*.so | awk '{print $1}' | grep libcrypto.so.3 | ||
| fi | ||
|
|
||
| auditwheel repair -w wheelhouse/ "$unrepaired_wheel_path" | ||
|
|
||
| if [[ "$DEBUG" != "" ]]; then | ||
| auditwheel show wheelhouse/* | ||
| fi | ||
|
|
||
| # TODO: This should happen if any steps after creating the dir fail | ||
| rm -rf "$WHEEL_DIR" | ||
| elif [[ $os =~ Darwin* ]]; then | ||
| delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} | ||
| delocate-listdeps {dest_dir}/*.whl | grep libcrypto.3.dylib | ||
| delocate-listdeps {dest_dir}/*.whl | grep libssl.3.dylib | ||
| elif [[ $running_on_windows ]]; then | ||
| delvewheel repair -vv --add-path ./aerospike-client-c/vs/x64/Release -w wheelhouse "$unrepaired_wheel_path" | ||
| fi |
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
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,34 @@ | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| release-bundle-name: | ||
| type: string | ||
| required: true | ||
| release-bundle-version: | ||
| type: string | ||
| required: true | ||
| new-environment: | ||
| type: string | ||
| required: true | ||
| jfrog-project: | ||
| type: string | ||
| required: true | ||
| jfrog-repo-name: | ||
| type: string | ||
| required: true | ||
|
|
||
| jobs: | ||
| promote-release-bundle-to-dev: | ||
| runs-on: ubuntu-24.04 | ||
| env: | ||
| JF_PROJECT: ${{ inputs.jfrog-project }} | ||
| steps: | ||
| - name: Setup JFrog CLI | ||
| uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1 | ||
| env: | ||
| JF_URL: https://artifact.aerospike.io | ||
| with: | ||
| oidc-provider-name: ${{ vars.OIDC_PROVIDER_NAME }} | ||
| oidc-audience: ${{ vars.OIDC_AUDIENCE }} | ||
|
|
||
| - run: jf rbp --signing-key=aerospike --include-repos ${{ inputs.jfrog-repo-name }} ${{ inputs.release-bundle-name }} ${{ inputs.release-bundle-version }} ${{ inputs.new-environment }} | ||
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,64 @@ | ||
| name: Run dev tests and promote release bundle to DEV | ||
| run-name: Run dev tests and promote release bundle to DEV (dry-run=${{ inputs.dry-run }}, test-file=${{ inputs.test-file }}) | ||
|
|
||
| permissions: | ||
| # We are building the artifacts in build-artifacts.yml | ||
| contents: read | ||
| # For shared reusable workflows | ||
| # TODO: look into more | ||
| id-token: write | ||
| statuses: write | ||
| # For downloading docker images from ghcr.io | ||
| packages: read | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| # These inputs are in case we need to test against a server RC | ||
| registry-name: | ||
| type: string | ||
| required: true | ||
| description: Registry name | ||
| default: 'docker.io' | ||
| image-name: | ||
| type: string | ||
| required: true | ||
| description: Image name | ||
| default: 'aerospike/aerospike-server-enterprise' | ||
| server-tag: | ||
| type: string | ||
| required: true | ||
| default: 'latest' | ||
| description: 'Server docker image tag (e.g to test a client backport version)' | ||
| # For testing purposes | ||
| dry-run: | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| description: Don't create release bundle | ||
| run_tests: | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| description: Run dev tests | ||
| test-file: | ||
| required: false | ||
| type: string | ||
| description: For speeding up debugging | ||
|
|
||
| jobs: | ||
| dev-workflow: | ||
| uses: aerospike/shared-workflows/.github/workflows/reusable_artifacts-cicd.yaml@8f53b63b33d86e63aeb37d951283dd974574885b | ||
| with: | ||
| gh-workflows-ref: 8f53b63b33d86e63aeb37d951283dd974574885b | ||
| jf-project: ${{ vars.JFROG_PROJECT_FOR_CLIENT_TEAM }} | ||
| jf-build-name: ${{ vars.JFROG_BUILD_NAME }} | ||
| # TODO: ${{ needs.run-dev-tests.outputs.build-version }}- needs to be applied to version | ||
| version: ${{ github.run_number }} | ||
| gh-artifact-directory: dist | ||
| build-script: | | ||
| make build | ||
| # Optional: | ||
| build-type: release # Freeform label, applied as build.type target-prop | ||
| internal: false # Set true to mark artifacts as internal-only | ||
| secrets: inherit |
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 6 days ago
In general, the fix is to add an explicit
permissionsblock either at the workflow root or on the specific job so thatGITHUB_TOKENdoes not default to potentially broad repository/organization permissions. The permissions should be limited to the least privilege necessary for this workflow.For this specific workflow, the job only sets up the JFrog CLI with OIDC and runs
jf rbp .... There is no evidence of creating or modifying issues, pull requests, releases, or repository contents via the GitHub API. The safest change that preserves existing behavior is to add a job-levelpermissionsblock that restrictscontentstoread. If in reality the job does not needGITHUB_TOKENat all, you could go further and usepermissions: {}; however, that may cause future steps added to this reusable workflow to fail unexpectedly. A conservative, compatible fix is therefore:placed under the
promote-release-bundle-to-devjob, aligned with other job keys likeruns-on. No imports or additional methods are needed because this is a GitHub Actions YAML configuration change only.Concretely, in
.github/workflows/promote-release-bundle.yml, update thepromote-release-bundle-to-devjob definition (around line 21–24) to insert apermissionsblock betweenruns-on: ubuntu-24.04andenv:.