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

Commit sdk to repo #445

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7996689
added a way to commit SDKs into the repo
Vibaswan Sep 11, 2023
04537a4
Update auto generated python code
actions-user Sep 11, 2023
99ddc39
bug fix
Vibaswan Sep 11, 2023
2fd0360
bug fix
Vibaswan Sep 11, 2023
168bbd5
Update auto generated go code
actions-user Sep 11, 2023
bb09c7f
adding git ignore
Vibaswan Sep 11, 2023
b649a8e
Update auto generated go code
actions-user Sep 11, 2023
e83d86b
move gen go files
Vibaswan Sep 11, 2023
796bd51
Merge branch 'commit_sdk_to_repo' of https://github.com/open-traffic-…
Vibaswan Sep 11, 2023
eb9eee7
remove pyc files
Vibaswan Sep 11, 2023
062ed3a
Update auto generated go code
actions-user Sep 11, 2023
f55d4a8
Merge branch 'main' into commit_sdk_to_repo
Vibaswan Sep 14, 2023
4463298
Merge branch 'commit_sdk_to_repo' of https://github.com/open-traffic-…
Vibaswan Sep 14, 2023
aa85db5
Update auto generated go code
actions-user Sep 14, 2023
5a7f371
refactor test as well gen sdk names
Vibaswan Sep 15, 2023
9b88772
bug fix
Vibaswan Sep 15, 2023
cc2733c
making changes to ci jobs to look for new folder, sdk names
Vibaswan Sep 15, 2023
1d3227e
Update auto generated go code
actions-user Sep 15, 2023
31c4985
Merge branch 'main' into commit_sdk_to_repo
Vibaswan Sep 21, 2023
d011c0a
resolve merge conflict
Vibaswan Sep 21, 2023
218323b
Update auto generated go code
actions-user Sep 21, 2023
8d3f015
changing name to previous
Vibaswan Sep 21, 2023
87b9ff3
Merge branch 'commit_sdk_to_repo' of https://github.com/open-traffic-…
Vibaswan Sep 21, 2023
832c8ac
Update auto generated go code
actions-user Sep 21, 2023
41e84ec
Merge branch 'main' into commit_sdk_to_repo
Vibaswan Oct 16, 2023
a99c2d3
Merge branch 'commit_sdk_to_repo' of https://github.com/open-traffic-…
Vibaswan Oct 16, 2023
8f009cb
resolve merge conflicts
Vibaswan Oct 16, 2023
355e633
Update auto generated go code
actions-user Oct 16, 2023
066ffdb
merge main
Vibaswan Jan 3, 2024
d32e5e2
Update auto generated go code
actions-user Jan 3, 2024
761ce55
dummy
Vibaswan Jan 3, 2024
31736ef
Update auto generated go code
actions-user Jan 3, 2024
70f79ca
bug fix
Vibaswan Jan 3, 2024
0a198e4
bug fix
Vibaswan Jan 3, 2024
a087c43
Update auto generated go code
actions-user Jan 3, 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
69 changes: 22 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,50 +68,25 @@ jobs:
- name: Trigger dev workflow
run: |
python do.py build

# dev_workflow_macos:
# runs-on: macos-latest
# steps:
# - name: Checkout source
# uses: actions/checkout@v2
# with:
# ref: ${{ github.head_ref }}
# - name: Set up Python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# - uses: actions/setup-go@v2
# with:
# go-version: "1.20"
# - name: Install Protoc
# uses: arduino/setup-protoc@v2
# with:
# version: "23.3"
# - name: Trigger dev workflow
# run: |
# python do.py build

# dev_workflow_windows:
# runs-on: windows-latest
# steps:
# - name: Checkout source
# uses: actions/checkout@v2
# with:
# ref: ${{ github.head_ref }}
# - name: Set up Python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# - uses: actions/setup-go@v2
# with:
# go-version: "1.20"
# - name: Install Protoc
# uses: arduino/setup-protoc@v2
# with:
# version: "23.3"
# - name: Trigger dev workflow
# run: |
# python do.py build
- name: show artifacts
run: |
ls artifacts
ls artifacts/pyapi
ls artifacts/goapi
- name: Commit packages
run: |
git config user.name "Github Actions Bot"
git config user.email "[email protected]"
git pull
git add --force artifacts/
git rm -r --cached artifacts/pyapi/__pycache__
if git status --porcelain | grep .
then
git commit -m "Update auto generated go code"
git push
else
echo "No change in auto generated go code"
fi

dev_workflow_docker:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -166,7 +141,7 @@ jobs:
with:
name: generated_py_package
path: |
art
artifacts
- name: Display structure of downloaded files
run: ls -R
- name: Run python tests
Expand Down Expand Up @@ -214,7 +189,7 @@ jobs:
name: generated_go_package
path: |
pkg
art
artifacts
- uses: actions/download-artifact@v2
with:
name: python_package
Expand Down Expand Up @@ -255,7 +230,7 @@ jobs:
- name: Check Genrated files
uses: andstor/file-existence-action@v2
with:
files: "art/openapi.json, art/openapi.yaml, art/sanity.proto"
files: "artifacts/openapi.json, artifacts/openapi.yaml, artifacts/openapi.proto"
fail: true

publish_python_package:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ __pycache__
/cov_report
/**/art
/**/art_go
/artifacts/pyapi/__pycache__
.local
/pkg/coverage.txt
/pkg/coverage.out
/pkg/sanity
/pkg/openapi
/pkg/go.mod
/pkg/go.sum
/pkg/openapiart.go
/pkg/goapi.go
/pkg/httpapi
/pkg/log.txt
_debug_bin
Expand Down
19 changes: 10 additions & 9 deletions artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys
import os
import importlib
import shutil


def create_openapi_artifacts(openapiart_class, sdk=None):
Expand All @@ -41,27 +42,27 @@ def create_openapi_artifacts(openapiart_class, sdk=None):
"./openapiart/goserver/api/service_b.api.yaml",
),
],
artifact_dir=os.path.join(os.path.dirname(__file__), "art"),
extension_prefix="sanity",
artifact_dir=os.path.join(os.path.dirname(__file__), "artifacts"),
extension_prefix="openapi",
proto_service="Openapi",
generate_version_api=True,
)
if sdk == "proto" or sdk is None or sdk == "all":
open_api.GenerateProtoDef(package_name="sanity")
open_api.GenerateProtoDef(package_name="openapi")

if sdk == "python" or sdk is None or sdk == "all":
open_api.GeneratePythonSdk(package_name="sanity")
open_api.GeneratePythonSdk(package_name="pyapi")

if sdk == "go" or sdk is None or sdk == "all":
open_api.GenerateGoSdk(
package_dir="github.com/open-traffic-generator/openapiart/pkg",
package_name="openapiart",
package_dir="github.com/open-traffic-generator/goapi/pkg",
package_name="goapi",
sdk_version="0.0.1",
)
open_api.GenerateGoServer(
module_path="github.com/open-traffic-generator/openapiart/pkg",
models_prefix="openapiart",
models_path="github.com/open-traffic-generator/openapiart/pkg",
module_path="github.com/open-traffic-generator/goapi/pkg",
models_prefix="openapi",
models_path="github.com/open-traffic-generator/goapi/pkg",
)
open_api.GoTidy(
relative_package_dir="pkg",
Expand Down
13 changes: 13 additions & 0 deletions artifacts/goapi/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/open-traffic-generator/goapi/pkg

go 1.16

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/ghodss/yaml v1.0.0
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.1
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.32.0
)
Loading