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

Mono core #22

Merged
merged 13 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .errors/errors_kafka_mgmt.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
"code": "KAFKAS-MGMT-121"
},
{
"reason": "Too Many requests",
"reason": "Too many requests",
"id": "429",
"kind": "Error",
"href": "/api/kafkas_mgmt/v1/errors/429",
Expand Down
84 changes: 42 additions & 42 deletions .errors/errors_srs_mgmt.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,116 +5,116 @@
"total": 14,
"items": [
{
"reason": "Unspecified error",
"operation_id": "",
"id": "1",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/1",
"code": "SRS-MGMT-1",
"reason": "Unspecified error",
"operation_id": ""
"code": "SRS-MGMT-1"
},
{
"reason": "Registry with id='?' not found",
"operation_id": "",
"id": "2",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/2",
"code": "SRS-MGMT-2",
"reason": "Registry with id='?' not found",
"operation_id": ""
"code": "SRS-MGMT-2"
},
{
"reason": "Bad date or time format",
"operation_id": "",
"id": "3",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/3",
"code": "SRS-MGMT-3",
"reason": "Bad date or time format",
"operation_id": ""
"code": "SRS-MGMT-3"
},
{
"reason": "Invalid request content or parameters. Make sure the request conforms to the given JSON schema",
"operation_id": "",
"id": "4",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/4",
"code": "SRS-MGMT-4",
"reason": "Invalid request content or parameters. Make sure the request conforms to the given JSON schema",
"operation_id": ""
"code": "SRS-MGMT-4"
},
{
"reason": "Bad request format - invalid JSON",
"operation_id": "",
"id": "5",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/5",
"code": "SRS-MGMT-5",
"reason": "Bad request format - invalid JSON",
"operation_id": ""
"code": "SRS-MGMT-5"
},
{
"reason": "Required terms have not been accepted for account id='?'",
"operation_id": "",
"id": "6",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/6",
"code": "SRS-MGMT-6",
"reason": "Required terms have not been accepted for account id='?'",
"operation_id": ""
"code": "SRS-MGMT-6"
},
{
"reason": "The maximum number of allowed Registry instances has been reached",
"operation_id": "",
"id": "7",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/7",
"code": "SRS-MGMT-7",
"reason": "The maximum number of allowed Registry instances has been reached",
"operation_id": ""
"code": "SRS-MGMT-7"
},
{
"reason": "Error type with id='?' not found",
"operation_id": "",
"id": "8",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/8",
"code": "SRS-MGMT-8",
"reason": "Error type with id='?' not found",
"operation_id": ""
"code": "SRS-MGMT-8"
},
{
"reason": "Data conflict. Make sure a Registry with the given name does not already exist",
"operation_id": "",
"id": "9",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/9",
"code": "SRS-MGMT-9",
"reason": "Data conflict. Make sure a Registry with the given name does not already exist",
"operation_id": ""
"code": "SRS-MGMT-9"
},
{
"reason": "Bad request format - unsupported media type",
"operation_id": "",
"id": "10",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/10",
"code": "SRS-MGMT-10",
"reason": "Bad request format - unsupported media type",
"operation_id": ""
"code": "SRS-MGMT-10"
},
{
"reason": "Could not check quota for user?",
"operation_id": "",
"id": "11",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/11",
"code": "SRS-MGMT-11",
"reason": "Could not check quota for user?",
"operation_id": ""
"code": "SRS-MGMT-11"
},
{
"reason": "Evaluation instances not allowed.",
"operation_id": "",
"id": "12",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/12",
"code": "SRS-MGMT-12",
"reason": "Evaluation instances not allowed.",
"operation_id": ""
"code": "SRS-MGMT-12"
},
{
"reason": "User already has the maximum number of allowed Evaluation instances.",
"operation_id": "",
"id": "13",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/13",
"code": "SRS-MGMT-13",
"reason": "User already has the maximum number of allowed Evaluation instances.",
"operation_id": ""
"code": "SRS-MGMT-13"
},
{
"reason": "Total (global) number of instances exhausted.",
"operation_id": "",
"id": "14",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/14",
"code": "SRS-MGMT-14",
"reason": "Total (global) number of instances exhausted.",
"operation_id": ""
"code": "SRS-MGMT-14"
}
]
}
46 changes: 31 additions & 15 deletions .errors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,37 @@


module.exports ={
kafka: {
definition: require("./errors_kafka_mgmt.json"),
file: "packages/kafka-management-sdk/src/errors.ts"
go : {
kafkamgmt: {
definition: require("./errors_kafka_mgmt.json"),
file: "app-services-sdk-go/kafkamgmt/apiv1/error/errors.go"
},
registrymgmt: {
definition: require("./errors_srs_mgmt.json"),
file: "app-services-sdk-go/registrymgmt/apiv1/error/errors.go"
},
connectormgmt: {
definition: require("./errors_connector_mgmt.json"),
file: "app-services-sdk-go/connectormgmt/apiv1/error/errors.go"
},
},
srs: {
definition: require("./errors_srs_mgmt.json"),
file: "packages/registry-management-sdk/src/errors.ts"
},
connector: {
definition: require("./errors_connector_mgmt.json"),
file: "packages/connector-management-sdk/src/errors.ts"
},
kafkainstance: {
definition: require("./errors_kafka_instance.json"),
file: "packages/kafka-instance-sdk/src/errors.ts"
},
js : {
kafka: {
definition: require("./errors_kafka_mgmt.json"),
file: "app-services-sdk-js/packages/kafka-management-sdk/src/errors.ts"
},
srs: {
definition: require("./errors_srs_mgmt.json"),
file: "app-services-sdk-js/packages/registry-management-sdk/src/errors.ts"
},
connector: {
definition: require("./errors_connector_mgmt.json"),
file: "app-services-sdk-js/packages/connector-management-sdk/src/errors.ts"
},
kafkainstance: {
definition: require("./errors_kafka_instance.json"),
file: "app-services-sdk-js/packages/kafka-instance-sdk/src/errors.ts"
},
}
}

17 changes: 14 additions & 3 deletions .github/workflows/api-update.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Update SDK
name: Update API specs
on:
schedule:
- cron: '0 0 * * *'
## Manual request that can be used for testing and retriggering failed updates
workflow_dispatch:
jackdelahunt marked this conversation as resolved.
Show resolved Hide resolved
jobs:
generate_client:
generate_api_specs:
env:
APP_SERVICES_TOKEN: ${{ secrets.APP_SERVICES_TOKEN }}
BF2_TOKEN: ${{ secrets.BF2_TOKEN }}
Expand All @@ -21,6 +21,17 @@ jobs:
run: sudo apt-get install jq
- name: Fetch OpenAPI doc
run: python scripts/fetch_api.py
start-generate-sdks-workflow:
needs: generate_api_specs # these 'need' fields are used to keep jobs running in order
uses: ./.github/workflows/generate-sdks.yaml
start-generate-errors-workflow:
needs: start-generate-sdks-workflow
uses: ./.github/workflows/generate-errors.yaml
make-pull-request:
needs: start-generate-errors-workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Make pull request
uses: peter-evans/create-pull-request@v4
with:
Expand All @@ -31,6 +42,6 @@ jobs:
branch-suffix: timestamp
delete-branch: true
body: |
_This pull request was auto-generated_
_This pull request was auto-generated from [api-update.yaml](https://github.com/redhat-developer/app-services-sdk-core/blob/main/.github/workflows/api-update.yaml)_

This PR adds the latest openapi files
20 changes: 20 additions & 0 deletions .github/workflows/generate-errors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Generate Errors
on:
workflow_dispatch:
workflow_call:
jobs:
generate_errors:
env:
APP_SERVICES_TOKEN: ${{ secrets.APP_SERVICES_TOKEN }}
BF2_TOKEN: ${{ secrets.BF2_TOKEN }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Fetch errors
run: bash scripts/errors/fetch-errors.sh
- name: Generate errors
run: node scripts/errors/generate_errors.js
17 changes: 17 additions & 0 deletions .github/workflows/generate-sdks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Generate SDKs
on:
jackdelahunt marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:
workflow_call:
jobs:
generate_sdks:
env:
APP_SERVICES_TOKEN: ${{ secrets.APP_SERVICES_TOKEN }}
BF2_TOKEN: ${{ secrets.BF2_TOKEN }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate SDKs
run: |
bash scripts/generate-go.sh
bash scripts/generate-js.sh
35 changes: 35 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: npm-publish
on:
workflow_dispatch:
jackdelahunt marked this conversation as resolved.
Show resolved Hide resolved
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js 16.3.0
uses: actions/setup-node@v3
with:
node-version: 16.3.0
registry-url: "https://registry.npmjs.org"
- run: |
cd app-services-sdk-js
yarn install
yarn build
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be worth trying each release with your own npm / pypi etc. account from this dir structure to ensure the paths are correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after this pr but before we update the openapi generator version

# - name: Validate Tag
# run: |
# cd app-services-sdk-js
# yarn semver $GITHUB_REF_SLUG
- name: Update versions of packages
run: |
cd app-services-sdk-js
yarn setupRelease
- name: Publish packages
run: |
cd app-services-sdk-js
npm publish --workspace=packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} #
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
openapitools.json
9 changes: 9 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/package.json
**/tsconfig.json
**/.npmignore
**/.gitignore
**/README.md
**/.travis.yml
**/.openapi-generator-ignore
**/.openapi-generator
**/git_push.sh
Loading