Skip to content

Commit

Permalink
Update generator to 7.1.0 to be in line with other SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-mairose-sp committed Jan 17, 2024
1 parent 1401c2a commit 7606ed7
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,29 @@ jobs:
if: steps.prescript.outcome == 'success'
run: |
rm -rf ./sailpoint/v3
java -jar openapi-generator-cli-7.0.1.jar generate -i api-specs/idn/sailpoint-api.v3.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/v3-config.yaml --enable-post-process-file
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v3.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/v3-config.yaml --enable-post-process-file
- name: Build Beta SDK
id: buildBeta
if: steps.buildV3.outcome == 'success'
run: |
rm -rf ./sailpoint/beta
java -jar openapi-generator-cli-7.0.1.jar generate -i api-specs/idn/sailpoint-api.beta.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/beta-config.yaml --enable-post-process-file
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.beta.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/beta-config.yaml --enable-post-process-file
node sdk-resources/postscript.js ./sailpoint/beta
- name: Build V2 SDK
id: buildV2
if: steps.buildBeta.outcome == 'success'
run: |
rm -rf ./sailpoint/v2
java -jar openapi-generator-cli-7.0.1.jar generate -i api-specs/idn/sailpoint-api.v2.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/v2-config.yaml --enable-post-process-file
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v2.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/v2-config.yaml --enable-post-process-file
- name: Build CC SDK
id: buildCC
if: steps.buildV2.outcome == 'success'
run: |
rm -rf ./sailpoint/cc
java -jar openapi-generator-cli-7.0.1.jar generate -i api-specs/idn/sailpoint-api.cc.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/cc-config.yaml --enable-post-process-file
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.cc.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/cc-config.yaml --enable-post-process-file
- name: After SDK Build
Expand Down
147 changes: 147 additions & 0 deletions .github/workflows/bump_version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: "Update Python SDK Version"

run-name: Update Python SDK Version to ${{ github.event.inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: The version to bump to

jobs:
update_python_version:
name: Update Python Version
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ secrets.DEVREL_SERVICE_TOKEN }}


- name: Checkout API Specs Repo
uses: actions/checkout@v3
with:
repository: sailpoint-oss/api-specs
path: api-specs
ref: main

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "16"

- name: Run Prescript
id: prescript
run: |
node sdk-resources/prescript.js api-specs/idn
# Install yq for working with yaml files
- name: Set up yq
uses: frenck/action-setup-yq@v1

# Check input version is greater than the current tag
- name: Check valid version
run: |
function ver { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); }
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo $LATEST_TAG
if [ $(ver $LATEST_TAG) -lt $(ver ${{ github.event.inputs.version}}) ]
then
echo "Input version ${{ github.event.inputs.version }} valid"
else
echo "Current tagged version $LATEST_TAG is greater than input version ${{ github.event.inputs.version }}"
exit 1
fi
## Update configuration files to new version
- name: Update config files with new version
id: updateVersion
run: |
yq -i '.packageVersion = "${{ github.event.inputs.version }}"' sdk-resources/cc-config.yaml
yq -i '.packageVersion = "${{ github.event.inputs.version }}"' sdk-resources/v2-config.yaml
yq -i '.packageVersion = "${{ github.event.inputs.version }}"' sdk-resources/beta-config.yaml
yq -i '.packageVersion = "${{ github.event.inputs.version }}"' sdk-resources/v3-config.yaml
## Update setup.py file with new version
- name: Update setup.py package
id: updatePackageVersion
if: steps.updateVersion.outcome == 'success'
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
sed -e "s/VERSION = '$LATEST_TAG'/VERSION = '${{ github.event.inputs.version }}'/g" setup.py > setup.py.tmp && mv setup.py.tmp setup.py
- name: Build V3 SDK
id: buildV3
if: steps.updatePackageVersion.outcome == 'success'
run: |
rm -rf ./sailpoint/v3
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v3.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/v3-config.yaml --enable-post-process-file
- name: Build Beta SDK
id: buildBeta
if: steps.buildV3.outcome == 'success'
run: |
rm -rf ./sailpoint/beta
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.beta.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/beta-config.yaml --enable-post-process-file
node sdk-resources/postscript.js ./sailpoint/beta
- name: Build V2 SDK
id: buildV2
if: steps.buildBeta.outcome == 'success'
run: |
rm -rf ./sailpoint/v2
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.v2.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/v2-config.yaml --enable-post-process-file
- name: Build CC SDK
id: buildCC
if: steps.buildV2.outcome == 'success'
run: |
rm -rf ./sailpoint/cc
java -jar openapi-generator-cli.jar generate -i api-specs/idn/sailpoint-api.cc.yaml -g python -o . --global-property skipFormModel=false --config sdk-resources/cc-config.yaml --enable-post-process-file
- name: After SDK Build
id: buildSDK
if: steps.buildCC.outcome == 'success'
shell: pwsh
run: |
pip install -r requirements.txt
pip install -e sailpoint
python validation_test.py -v
- name: Commit changes and create new version tag
if: steps.buildSDK.outcome == 'success'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bump version to ${{ github.event.inputs.version }}
tagging_message: ${{ github.event.inputs.version }}
commit_user_name: developer-relations-sp
commit_user_email: [email protected]



- name: Create Draft Release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: v${{ github.event.inputs.version }}
draft: false
prerelease: false

7 changes: 6 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@
accounts = Paginator.paginate(sailpoint.v3.AccountsApi(api_client).list_accounts, 1000, limit=100)
print(len(accounts))
for account in accounts:
print(account.name)
print(account.name)


workgroups = sailpoint.beta.GovernanceGroupsApi(api_client).list_workgroups()
for workgroup in workgroups:
print(workgroup.name)
Binary file not shown.

0 comments on commit 7606ed7

Please sign in to comment.