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

[SDK: ruby/python/C#] Add initial module: createCaseHealth (RS-EDA) #138

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
5f296dd
add initial module : Health (RS-EDA)
bou3108 Jul 15, 2024
78512d6
add ruby-on-rails generator
bou3108 Jul 16, 2024
eebc7c2
add ruby-on-rails generator doc
bou3108 Jul 16, 2024
afc0f12
add ruby-on-rails generator doc
bou3108 Jul 16, 2024
10863ef
Update generator/docs/Ruby/0-generator-overview.md
romainfd Jul 23, 2024
6d7342f
Update generator/docs/Ruby/0-generator-overview.md
romainfd Jul 23, 2024
5cb7295
add gh action and rename moduleName
bou3108 Jul 26, 2024
741ca86
rm non ruby config options
bou3108 Jul 26, 2024
1ddf2c7
rm non ruby config options
bou3108 Jul 26, 2024
8d9b7de
fix path
bou3108 Jul 26, 2024
ff3f9d4
add autocommit
bou3108 Jul 26, 2024
471ea64
⚙️ Auto-génération des classes et des specs
bou3108 Jul 26, 2024
eb19b3f
fix typo
bou3108 Jul 26, 2024
55af29a
Adding Python and updating logic
romainfd Jul 30, 2024
04460e2
Adding pull_request trigger for workflow to be registered
romainfd Jul 30, 2024
6785342
⚙️ Auto-génération des classes et des specs
romainfd Jul 30, 2024
da7986e
Updating config for cleaner imports
romainfd Jul 30, 2024
66a2fe3
⚙️ Auto-génération des classes et des specs
romainfd Jul 30, 2024
b40d073
Adding C# config
romainfd Jul 30, 2024
c697abb
⚙️ Auto-génération des classes et des specs
romainfd Jul 30, 2024
52f648a
Adding output directory cleaning
romainfd Jul 30, 2024
de92ba7
⚙️ Auto-génération des classes et des specs
romainfd Jul 30, 2024
4843e69
fix: better python naming
romainfd Jul 31, 2024
15bba06
⚙️ Auto-génération des classes et des specs
romainfd Jul 31, 2024
547a6f5
Update Config
LauryLct Aug 6, 2024
d7c732d
add other ruby packages
bou3108 Sep 23, 2024
22f63f5
⚙️ Auto-génération des classes et des specs
bou3108 Sep 23, 2024
0b9034f
add other ruby packages
bou3108 Sep 23, 2024
017f5a1
fix typo
bou3108 Sep 23, 2024
df4738d
⚙️ Auto-génération des classes et des specs
bou3108 Sep 23, 2024
61f99b1
add EDXL
bou3108 Sep 23, 2024
472d77a
Merge remote-tracking branch 'origin/feature/ruby-lib' into feature/r…
bou3108 Sep 23, 2024
223636b
⚙️ Auto-génération des classes et des specs
bou3108 Sep 23, 2024
43ced39
feat: adding gem generation
romainfd Sep 26, 2024
93e48c4
feat: adding gem generation
romainfd Sep 26, 2024
8676566
feat: adding all github action to see if it runs
romainfd Sep 26, 2024
c0c14c5
feat: removing [ ] in step names
romainfd Sep 26, 2024
b7b8a4e
feat: fixing gem name
romainfd Sep 26, 2024
481c999
⚙️ Auto-génération des classes et des specs
romainfd Sep 26, 2024
c5bbc23
feat: update GitHub SDK build action to use param for RELEASE_NAME
romainfd Sep 26, 2024
baebf8a
feat: update GitHub SDK build action to use param for RELEASE_NAME
romainfd Sep 26, 2024
78cc51b
feat: update RELEASE_VERSION github action
romainfd Sep 26, 2024
a58c137
feat: update RELEASE_VERSION github action
romainfd Sep 26, 2024
6db86b6
feat: update RELEASE_VERSION github action
romainfd Sep 26, 2024
4bf0d96
feat: update RELEASE_VERSION github action
romainfd Sep 26, 2024
75a3bea
feat: update RELEASE_VERSION github action
romainfd Sep 26, 2024
f669288
feat: update RELEASE_VERSION github action
romainfd Sep 26, 2024
93448db
Add hubsante_model.rb
LauryLct Sep 26, 2024
73d051c
feat: update file sync to support base/ files
romainfd Sep 26, 2024
d35538e
⚙️ Auto-génération des classes et des specs
romainfd Sep 26, 2024
b8d8f99
fix: typo
romainfd Sep 26, 2024
7c85e34
feat: make generation run with base/
romainfd Sep 26, 2024
ca58517
⚙️ Auto-génération des SDKs
romainfd Sep 26, 2024
6a2f6ff
feat: make generation run with base/
romainfd Sep 26, 2024
e3b0616
feat: make gem build last stage to commit even when failed
romainfd Sep 26, 2024
69d53b5
fix: adding debug ls
romainfd Sep 26, 2024
e580b94
fix: recursive rsync
romainfd Sep 26, 2024
1f2d287
⚙️ Auto-génération des SDKs
romainfd Sep 26, 2024
9ae7b51
fix: trigger run
romainfd Sep 26, 2024
a3c16c0
Fix gem path
LauryLct Oct 1, 2024
5e8b906
⚙️ Auto-génération des SDKs
LauryLct Oct 1, 2024
367c911
Merge branch 'main' into feature/ruby-lib
romainfd Oct 1, 2024
68f1503
fix: trigger run
romainfd Oct 1, 2024
adb60b2
⚙️ Auto-génération des SDKs
romainfd Oct 1, 2024
07f28b1
fix: upload gem as artifact to be able to investigate
romainfd Oct 9, 2024
627ef46
Merge branch 'main' into feature/ruby-lib
romainfd Nov 12, 2024
7d25de5
fix: correct schema names and add latest schemas
romainfd Nov 13, 2024
fe6ecad
fix: fix Ruby config for OpenAPI generator
romainfd Nov 13, 2024
d962efd
⚙️ Auto-génération des SDKs
romainfd Nov 13, 2024
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
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .github/workflows/generate-bundle.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Zip Files and Upload Artifact
name: Generate Bundle

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-model.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: generate-model
name: Generate Model

on:
pull_request:
Expand Down
126 changes: 126 additions & 0 deletions .github/workflows/generate-sdks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Generate SDKs

on:
pull_request:
branches:
- '**'
release:
types:
- published
workflow_dispatch:
inputs:
release_name:
description: 'Release name for manual dispatch'
required: true
# Workflow dependencies, also to avoid concurrent commits
# Ref.: https://github.com/orgs/community/discussions/26238
workflow_run:
workflows: ["generate-model"]
types:
- completed

env:
SCHEMAS: "RC-EDA RS-EDA EMSI GEO-POS GEO-REQ GEO-RES RC-REF RS-ERROR RS-RI RS-DR RS-RR RS-RPIS RS-EDA-MAJ RS-SR RS-URL RS-ER RS-BPV TECHNICAL TECHNICAL_NOREQ"

jobs:
generate-sdks:
runs-on: ubuntu-latest

steps:
- name: Set RELEASE_VERSION based on the trigger type
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
RELEASE_VERSION="${{ github.ref_name }}"
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
RELEASE_VERSION="${{ github.event.inputs.release_name }}"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
RELEASE_VERSION="0.0.0.${{ github.head_ref }}"
fi

# Make the RELEASE_VERSION semver compatible (replacing non letter/digit/. chars with .)
RELEASE_VERSION=$(echo "$RELEASE_VERSION" | sed 's/[^a-zA-Z0-9\.]/./g')

# Display the RELEASE_VERSION for verification
echo "The RELEASE_VERSION is: $RELEASE_VERSION"

# Check if RELEASE_VERSION matches the semver allowed pattern
if [[ ! $RELEASE_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9].* ]]; then
echo "RELEASE_VERSION is NOT semver compatible (1.1.1.xxx)"
exit 1
fi

# Export the RELEASE_VERSION environment variable for future steps (in env.RELEASE_VERSION)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@v3

- name: Install node env 🏗
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install openapi-generator-cli
run: npm install -g @openapitools/openapi-generator-cli

- name: Cleaning output directories
working-directory: ./generator
run: |
rm -r ruby python csharp || true

- name: Ruby - Generate classes
working-directory: ./generator
run: |
npx @openapitools/openapi-generator-cli generate -c ./config/EDXL-DE/ruby/EDXL-DE.generator-config.json --skip-validate-spec

IFS=' ' read -ra SCHEMAS_ARRAY <<< "$SCHEMAS"
for SCHEMA in "${SCHEMAS_ARRAY[@]}"; do
npx @openapitools/openapi-generator-cli generate -c ./config/$SCHEMA/ruby/$SCHEMA.generator-config.json --skip-validate-spec
done

- name: Ruby - Move classes to SDK folder
run: |
rm -r ./sdks/ruby/lib || true
mkdir ./sdks/ruby/lib
cp -r ./sdks/ruby/base/* ./sdks/ruby/lib/
rsync --remove-source-files -r generator/ruby/ruby_classes/* ./sdks/ruby/

- name: Python - Generate classes
working-directory: ./generator
run: |
npx @openapitools/openapi-generator-cli generate -c ./config/RS-EDA/python/RS-EDA.generator-config.json --skip-validate-spec

- name: C# - Generate classes
working-directory: ./generator
run: |
npx @openapitools/openapi-generator-cli generate -c ./config/RS-EDA/csharp/RS-EDA.generator-config.json --skip-validate-spec

- name: Commit and push changes
if: ${{ !env.ACT }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ⚙️ Auto-génération des SDKs

- name: Ruby - Set up
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true

- name: Ruby - Build Gem
working-directory: ./sdks/ruby/
run: gem build hubsante_model.gemspec
env:
GEM_VERSION: ${{ env.RELEASE_VERSION }}

- name: Ruby - Upload Gem as artifact
uses: actions/upload-artifact@v3
with:
name: ruby-gem-artifact
path: ./sdks/ruby/hubsante_model-*.gem

- name: Ruby - Push Gem to GitHub Packages
working-directory: ./sdks/ruby/
run: gem push --key github --host https://rubygems.pkg.github.com/ansforge ./hubsante_model-*.gem
env:
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }} # GitHub token used to authenticate
20 changes: 20 additions & 0 deletions generator/config/EDXL-DE/ruby/EDXL-DE.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/EDXL-DE.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "EdxlMessage",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/EMSI/ruby/EMSI.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/EMSI.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Emsi",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/GEO-POS/ruby/GEO-POS.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/GEO-POS.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Geolocation",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/GEO-REQ/ruby/GEO-REQ.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/GEO-REQ.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Geolocation",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/GEO-RES/ruby/GEO-RES.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/GEO-RES.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Geolocation",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/RC-DE/ruby/RC-DE.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/RC-DE.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "DistributionElement",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/RC-EDA/ruby/RC-EDA.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/RC-EDA.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Cisu",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/RC-REF/ruby/RC-REF.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/RC-REF.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Reference",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/RS-BPV/ruby/RS-BPV.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/RS-BPV.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "InterventionReport",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/RS-DR/ruby/RS-DR.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/RS-DR.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "ResourcesRequest",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
20 changes: 20 additions & 0 deletions generator/config/RS-EDA-MAJ/ruby/RS-EDA-MAJ.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"inputSpec": "./input/RS-EDA-MAJ.openapi.yaml",
"outputDir": "ruby/ruby_classes/",
"generatorName": "ruby",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"moduleName": "Health",
"gemName": "hubsanteModel",
"allowUnicodeIdentifiers": true,
"useAutoload": true,
"sortParamsByRequiredFlag": true
}
}
16 changes: 16 additions & 0 deletions generator/config/RS-EDA/csharp/RS-EDA.generator-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"inputSpec": "./input/RS-EDA.openapi.yaml",
"outputDir": "csharp/",
"generatorName": "csharp",
"globalProperties": {
"models": "",
"apis": false,
"apiTests": false,
"apiDocs": false,
"modelDocs": false,
"modelTests": false
},
"additionalProperties": {
"packageName": "HubsanteModel.Health"
}
}
Loading