Skip to content
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

OpenAPI Generator SDK Feature Branch #61

Merged
merged 39 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
12e2c15
OpenAPI Generator SDK Feature Branch
ckoegel Sep 26, 2022
bb9e93c
remove old sdk
ckoegel Oct 14, 2022
357837f
Update to OpenAPI Generator v6.3 (#66)
ckoegel Feb 17, 2023
c204953
update bw spec and use v6.4.0 of the generator (#72)
ckoegel Feb 21, 2023
bb15dc5
Remove webrtc (#73)
ckoegel Feb 21, 2023
2ba210e
Small changes to clean up repo for beta release (#74)
ckoegel Feb 23, 2023
ff94865
DX-2940 Messaging Integration Tests (#67)
ckoegel Feb 24, 2023
dc77611
DX-2941 MFA Integration Tests (#68)
ckoegel Feb 24, 2023
f6e4ee8
DX-2942 TN Lookup Integration Tests (#69)
ckoegel Feb 24, 2023
cc4c4e5
Merge branch 'main' into feature/openapi-generator-sdk
ckoegel Feb 24, 2023
c65595b
DX-2938 Media Integration Tests (#70)
ckoegel Feb 28, 2023
79b4553
Add BXML Verbs (#75)
ckoegel Mar 2, 2023
90f420e
Calls, Recordings, Conferences, and Statistics Integration Tests (#71)
ckoegel Mar 2, 2023
dc1fc1e
Merge branch 'main' of https://github.com/Bandwidth/ruby-sdk into fea…
ckoegel Mar 2, 2023
5a80cf6
update version
ckoegel Mar 2, 2023
3a41fd7
Merge branch 'main' of https://github.com/Bandwidth/ruby-sdk into fea…
ckoegel Mar 2, 2023
34008b9
SWI-1988 Update SDK with `expiration` field (#87)
ckoegel Mar 16, 2023
51aa00f
Merge branch 'main' of https://github.com/Bandwidth/ruby-sdk into fea…
ckoegel Mar 20, 2023
a389f4d
Merge branch 'feature/openapi-generator-sdk' of https://github.com/Ba…
ckoegel Mar 20, 2023
28ed449
remove application id assert from recordings test because its not gua…
ckoegel Mar 20, 2023
29ab2f5
Merge branch 'main' of https://github.com/Bandwidth/ruby-sdk into fea…
ckoegel Mar 22, 2023
f13032c
update tests workflows for feature branch
ckoegel Mar 22, 2023
677fd3d
Task: Update Manteca Test IDs (#89)
matthewkmartin Mar 23, 2023
03f457f
Merge branch 'main' of https://github.com/Bandwidth/ruby-sdk into fea…
ckoegel Mar 23, 2023
43e2870
Merge branch 'feature/openapi-generator-sdk' of https://github.com/Ba…
ckoegel Mar 23, 2023
ad74e91
SWI-2788 Add Transcription BXML to Feature Branch (#100)
ckoegel Jun 9, 2023
6f3eab7
SWI-2821 Prep for GA (#101)
ckoegel Jun 19, 2023
446c463
SWI-1771 Add Unit Tests (#103)
ckoegel Jul 18, 2023
0ddacd4
SWI-2821 Improve BXML Library (#106)
ckoegel Jul 19, 2023
43eca92
fix deploy workflow
ckoegel Jul 19, 2023
dbe4968
please deploy this time
ckoegel Jul 19, 2023
68f6089
SWI-3149 Update to Generator Version 7.0.0 (#107)
ckoegel Jul 26, 2023
330022e
update workflow
ckoegel Jul 26, 2023
8aa576c
SWI-3336 Update SDK to OpenAPI Generator 7.0.0 (#108)
ckoegel Aug 25, 2023
295e19d
remove assignee from Jira
ckoegel Aug 28, 2023
4b6b52a
SWI-3338 Update SDK for GA (#109)
ckoegel Aug 30, 2023
005993d
update release regex
ckoegel Aug 30, 2023
b343699
Merge branch 'main' into feature/openapi-generator-sdk
ckoegel Aug 30, 2023
22a9926
remove ruby-notes and old sdk files
ckoegel Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 0 additions & 11 deletions .github/actions/deploy/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions .github/actions/deploy/action.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .github/actions/deploy/entrypoint.sh

This file was deleted.

89 changes: 26 additions & 63 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,7 @@ on:

jobs:
deploy:
name: Deploy to Rubygems
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"

- name: Install Packages
run: bundle install

- name: Test
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
run: rake

- name: Deploy to Rubygems
uses: ./.github/actions/deploy
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

- uses: Bandwidth/[email protected]
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}

deploy_pre_release:
name: Deploy OpenAPI Generator Client Pre-Release to Rubygems
if: ${{ github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }}
name: Deploy SDK to Rubygems
runs-on: ubuntu-latest
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
Expand All @@ -61,49 +20,53 @@ jobs:
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
RUBY_VERSION: '3.0'
OPERATING_SYSTEM: 'ubuntu'
RUBY_VERSION: "3.0"
OPERATING_SYSTEM: "ubuntu"
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }}

steps:
- name: Set Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Check Release Tag Format
run: |
re=[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*
if ! [[ $RELEASE_VERSION =~ $re ]]; then
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+\.pre\.beta\.[0-9]+\.?[0-9]*\.?[0-9]*)'
RELEASE_VERSION=${GITHUB_REF#refs/tags/v}
re=[0-9]+\.[0-9]+\.[0-9]+
if [[ $RELEASE_VERSION =~ $re ]]; then
echo "GEM_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
else
echo "Tag does not match expected semver regex pattern (v$re)"
echo $RELEASE_VERSION
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi

- name: Checkout
uses: actions/checkout@v3
with:
ref: feature/openapi-generator-sdk

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"

- name: Install Packages
run: bundle install
- name: Update Gem Version
run: sed -i "s/VERSION = '.*'/VERSION = '$GEM_VERSION'/g" lib/bandwidth-sdk/version.rb

- name: Install Packages and Test
run: |
bundle install
rake

- name: Test
run: rake

- name: Deploy to Rubygems
uses: ./.github/actions/deploy
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

run: |
mkdir ~/.gem
touch ~/.gem/credentials
chmod 0600 ~/.gem/credentials
printf -- "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > ~/.gem/credentials
gem build *.gemspec
gem push *.gem

- uses: Bandwidth/[email protected]
if: always()
with:
Expand Down
32 changes: 4 additions & 28 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Main and Feature Branch Nightly
name: Test Main Branch Nightly

on:
schedule:
Expand Down Expand Up @@ -31,12 +31,12 @@ jobs:
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
ruby-version: [2.6, 2.7, 3.0]
ruby-version: [2.7, 3.0, 3.1, 3.2]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'main'
ref: "main"

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -47,37 +47,13 @@ jobs:
run: |
bundle install
rake

test_feature:
name: Test Feature Branch Nightly
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
ruby-version: [2.7, 3.0, 3.1, 3.2]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'feature/openapi-generator-sdk'

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}

- name: Install Packages and Test
env:
RUBY_VERSION: ${{ matrix.ruby-version }}
OPERATING_SYSTEM: ${{ matrix.os }}
GEM_VERSION: "11.0.0"
run: |
bundle install
rake

notify_for_failures:
name: Notify for Failures
needs: [test_main, test_feature]
needs: [test_main]
if: failure()
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ env:
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}

jobs:
test_pr_main:
test_pr:
name: Test PR
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
ruby-version: [2.6, 2.7, 3.0]
ruby-version: [2.7, 3.0, 3.1, 3.2]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -44,3 +44,6 @@ jobs:
run: |
bundle install
rake
env:
RUBY_VERSION: ${{ matrix.ruby-version }}
OPERATING_SYSTEM: ${{ matrix.os }}
106 changes: 106 additions & 0 deletions .github/workflows/update-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Update SDK

on:
schedule:
- cron: "0 14 * * 2"
workflow_dispatch:

jobs:
update-sdk:
name: Update SDK if Necessary
runs-on: ubuntu-latest
outputs:
generate: ${{ steps.compare.outputs.generate }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Combine Product Specs
uses: Bandwidth/[email protected]
with:
token: ${{ secrets.DX_GITHUB_TOKEN }}

- name: Determine if a New SDK is Needed
id: compare
run: |
if cmp -s "bandwidth.yml" "api-specs/bandwidth.yml"; then :; else mv -f api-specs/bandwidth.yml bandwidth.yml; rm -r -f api-specs; echo "generate=true" >> $GITHUB_OUTPUT; fi

- name: Create JIRA Card for SDK Update
if: ${{ steps.compare.outputs.generate == 'true' }}
id: jira
run: |
JIRA_KEY=$(jq -r '.key' <<< $(curl -s -u $JIRA_USERNAME:$JIRA_TOKEN \
-X POST https://bandwidth-jira.atlassian.net/rest/api/2/issue \
-H "Content-Type: application/json" \
--data-binary @- << EOF
{
"fields": {
"project": {
"key": "SWI"
},
"summary": "[$LANGUAGE] Update SDK for New Spec Version",
"description": "Prepare the $LANGUAGE SDK for release based on the latest spec changes.",
"issuetype": {
"name": "Story"
},
"customfield_12108": "$LANGUAGE SDK is ready for release. Tests are created/updated if need be.",
"customfield_10205": "$EPIC",
"components": [{
"name": "Client SDKs"
}]
}
}
EOF
))
echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT
env:
LANGUAGE: Ruby
EPIC: SWI-1876
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}

- name: Build SDK
id: build
if: ${{ startsWith(steps.jira.outputs.jira-key, 'SWI') }}
uses: Bandwidth/[email protected]
with:
branch-name: ${{ steps.jira.outputs.jira-key }}
token: ${{ secrets.DX_GITHUB_TOKEN }}
openapi-generator-version: 7.0.0
language: ruby
config: ./openapi-config.yml

- name: Setup Ruby
if: steps.build.outputs.changes
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"

- name: Clean SDK
if: steps.build.outputs.changes
run: |
bundle install
rubocop -A
git add .
git commit -m "Clean SDK using Rubocop"
git push origin ${{ steps.jira.outputs.jira-key }}

- name: Open Pull Request
if: steps.build.outputs.changes
run: |
gh pr create -B main -H Bandwidth:${{ steps.jira.outputs.jira-key }} -t '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -b 'Auto-generated by Update SDK Workflow'
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

notify-for-failures:
name: Notify for Failures
needs: [update-sdk]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack of Failures
uses: Bandwidth/[email protected]
with:
job-status: failure
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
42 changes: 41 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
Gemfile.lock
# Generated by: https://openapi-generator.tech
#

*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

.DS_Store
4 changes: 0 additions & 4 deletions .gitkeep

This file was deleted.

Loading