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

SWI-3689 Add Workflows and Issue Template #5

Merged
merged 28 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ff516a4
SWI-3689 Add Workflows and Issue Template
ckoegel Oct 17, 2023
b29c381
Merge branch 'SWI-3688' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
ff3815c
Merge branch 'SWI-3686' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
57ce52c
Merge branch 'SWI-3735' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
835c7d0
Merge branch 'SWI-3687' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
d0e4e55
try just node 18
ckoegel Oct 17, 2023
cac9938
try catch to see whats wrong
ckoegel Oct 18, 2023
7b930b6
removes references to ruby
ckoegel Oct 18, 2023
4a4d93e
remove try catch
ckoegel Oct 18, 2023
7365ea8
bring back all node versions
ckoegel Oct 18, 2023
94335c9
remove flaky message expiration assertion
ckoegel Oct 18, 2023
f6093eb
more try catches to find error
ckoegel Oct 18, 2023
f1c72b9
catch more errors
ckoegel Oct 18, 2023
4a6ad30
remove skipped tests and detectOpenHandles
ckoegel Oct 18, 2023
3a7bb0e
remove try catches
ckoegel Oct 18, 2023
2f1ed6a
remove beta deploy wf
ckoegel Oct 18, 2023
d532149
update timeout in recordings test
ckoegel Oct 18, 2023
436ca49
update timeout again just to be safe
ckoegel Oct 18, 2023
72f5133
semi colons
ckoegel Oct 26, 2023
a808545
Merge branch 'SWI-3688' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 27, 2023
3f117a2
update templates
ckoegel Oct 27, 2023
aec93b4
update checkout and setup node versions
ckoegel Oct 30, 2023
b2c29a1
update checkout and node elsewhere
ckoegel Oct 30, 2023
752213d
this one didnt save :/
ckoegel Oct 30, 2023
0ce9300
SWI-3836 Update BXML Library and Add Integration Tests
ckoegel Oct 31, 2023
dd4fd22
update workflows
ckoegel Nov 1, 2023
e541462
regenerate on 7.1.0
ckoegel Nov 14, 2023
0c45900
Merge pull request #6 from Bandwidth/SWI-3836
ckoegel Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug Report
about: Create a bug report.
title: '[BUG] Description'
labels: 'bug'
---

### Checklist
- [ ] Have you provided a description of the bug?
- [ ] Have you provided your Environment information?
- [ ] Have you provided a sample code snippet?
- [ ] Have you provided a stack trace?
- [ ] Have you outlined the expected behavior?

### Description
<!-- Please provide a clear and concise description of the bug. -->

### Environment Information
<!-- Please provide the version of the OS, SDK, and Environment you are experiencing the bug in. -->
- OS Version: _(e.g. Windows 10)_
- SDK Version: _(e.g. 1.1.0)_
- Environment: _(e.g. Node 18.16.0)_

### Sample Code Snippet
<!-- Please provide a code snippet that produces or is relevant to the bug. -->
```js
# Sample Code Snippet
```

### Stack Trace
<!-- Please provide the stack trace that shows the bug. -->
```shell
# Stack Trace
```

### Expected Behavior
<!-- Please outline the expected behavior of the SDK. -->

### Suggested Fix
<!-- If you have a fix or a suggestion for how this bug may be resolved, describe it here. -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Bandwidth Support
url: https://www.bandwidth.com/support/
about: Current customers can create tickets for our Support Team here.
68 changes: 68 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy SDK

on:
release:
types:
- published

jobs:
deploy:
name: Deploy SDK to NPM
runs-on: ubuntu-latest
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
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 }}
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: |
RELEASE_VERSION=${GITHUB_REF#refs/tags/v}
if [[ $RELEASE_VERSION =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|alpha|rc))(\.[0-9][0-9]*)?$ ]]; then
echo "PACKAGE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
else
echo 'Tag does not match expected semver regex pattern (^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|alpha|rc))(\.[0-9][0-9]*)?$)'
echo $RELEASE_VERSION
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi

- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install Packages and Test
run: |
npm i
npm test

- name: Publish npm Package
run: |
npm version $PACKAGE_VERSION --no-git-tag-version
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- uses: Bandwidth/[email protected]
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
64 changes: 64 additions & 0 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test Main Branch Nightly

on:
schedule:
- cron: "0 4 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
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 }}
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 }}

jobs:
test_main:
name: Test Main Branch Nightly
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
node-version: [16, 18, 20]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "main"

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Packages and Test
run: |
yarn
yarn test
env:
OPERATING_SYSTEM: ${{ matrix.os }}

notify_for_failures:
name: Notify for Failures
needs: [test_main]
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 }}
48 changes: 48 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test PR

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
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 }}
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 }}

jobs:
test_pr:
name: Test PR
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
node-version: [16, 18, 20]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Packages and Test
run: |
yarn
yarn test
env:
OPERATING_SYSTEM: ${{ matrix.os }}
95 changes: 95 additions & 0 deletions .github/workflows/update-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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@v4

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

- name: Determine if a New SDK is Needed
ckoegel marked this conversation as resolved.
Show resolved Hide resolved
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: Node
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: typescript-axios
config: ./openapi-config.yml

- name: Setup Node
if: steps.build.outputs.changes
uses: actions/setup-node@v4

- 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 }}
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.1
7.1.0
2 changes: 1 addition & 1 deletion base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class BaseAPI {
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
this.basePath = configuration.basePath ?? basePath;
}
}
};
Expand Down
Loading