-
Notifications
You must be signed in to change notification settings - Fork 338
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
Submodule protobuf #41
Changes from all commits
46b9a42
1dcd8c7
d3dc9fb
a4e8074
4c37c03
52ebef3
2998f4b
1fb22be
72fc21b
38e5568
114fc3e
c9f13ba
3fef3e0
eb0b3e4
4cc4330
8b20c3b
c947869
711a281
65a4cb8
59064fa
d8e0ad2
edd98d4
2caa5f8
d60f636
3d33a7c
e07f2fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Update protobuf stubs | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update_proto: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Copy files | ||
run: | | ||
SRC=./api-interfaces/gooseai | ||
TGT=./src/stability_sdk/interfaces/gooseai | ||
KIND=generation | ||
cp $SRC/$KIND/${KIND}_pb2_grpc.py $TGT/$KIND/${KIND}_pb2_grpc.py | ||
cp $SRC/$KIND/${KIND}_pb2.py $TGT/$KIND/${KIND}_pb2.py | ||
############################# | ||
# for backwards compatibility | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know how I feel about copying these files out of the submodule. I know people already rely on this directory structure, but I wonder if it would be better for us to have a clean, versioned break. Open to arguments either way, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm inclined to agree. Since people can now pull these generated files out of the Like Chia said, we'll want to cut a major version so we don't break existing consumers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's been less than a month since the beta release so the timing for a major version is good too. especially considering the third party ts client is currently broken because of this dependency already. maybe we do this PR leaving the backwards compatibility stuff in it as a temporary fix to get people who are using the third party ts client back on their feet, and then follow that up with a new major version. this would give a little bit of breathing room to users depending on the current structure to upgrade without requiring that their stuff be broken and unavilable while they're in transition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alternatively, choosing not to support backwards compatibility is a good forcing function for upgrading |
||
############################# | ||
cp ./api-interfaces/src/proto/generation.proto ./src/proto/generation.proto | ||
cp $SRC/$KIND/${KIND}_pb_service.d.ts ./src/js/${KIND}_pb_service.d.ts | ||
cp $SRC/$KIND/${KIND}_pb_service.js ./src/js/${KIND}_pb_service.js | ||
cp $SRC/$KIND/${KIND}_pb.d.ts ./src/js/${KIND}_pb.d.ts | ||
cp $SRC/$KIND/${KIND}_pb.js ./src/js/${KIND}_pb.js | ||
#- name: Commit files | ||
# run: | | ||
# shopt -s globstar | ||
# git config --local user.name ${{ github.actor }} | ||
# git add ./src/**/*.py | ||
# git add ./src/**/*.js | ||
# git add ./src/**/*.ts | ||
# git add ./src/**/*.proto | ||
# git commit -m "Updated protobuf files" | ||
#- name: Push change | ||
# uses: ad-m/github-push-action@master | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# branch: ${{ github.ref }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
add-paths: | | ||
api-interfaces/ | ||
src/ | ||
base: main | ||
delete-branch: true | ||
branch: "actions/update-interfaces" | ||
commit-message: "chore: update protobuf stubs" | ||
title: "chore: update protobuf stubs" | ||
body: "Update protobuf stubs from changes in ${{ github.sha }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "api-interfaces"] | ||
path = api-interfaces | ||
url = https://github.com/stability-ai/api-interfaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably only want this running on main (once it is known to work), and possibly with a path filter to just when
api-interfaces
is changed.