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

Add planetscale/vitess module #365

Merged
merged 7 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ We currently sync automatically the following modules:
| grpc-ecosystem/grpc-gateway | https://github.com/grpc-ecosystem/grpc-gateway | |
| opencensus/opencensus | https://github.com/census-instrumentation/opencensus-proto | |
| opentelemetry/opentelemetry | https://github.com/open-telemetry/opentelemetry-proto | |
| planetscale/vitess | https://github.com/planetscale/vitess-types | |
| prometheus/client-model | https://github.com/prometheus/client_model | |
| protocolbuffers/wellknowntypes | https://github.com/protocolbuffers/protobuf | |

Expand Down
13 changes: 13 additions & 0 deletions modules/static/planetscale/vitess/buf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**This is a third-party repository managed by Buf.**

Updates to the [source repository](https://github.com/planetscale/vitess-types) are automatically
synced on a periodic basis, and each BSR commit is tagged with corresponding Git commits.

To depend on a specific Git commit, you can use it as your reference in your dependencies:

```
deps:
- buf.build/planetscale/vitess:<GIT_COMMIT_TAG>
```

For more information, see the [documentation](https://docs.buf.build/bsr/overview).
2 changes: 2 additions & 0 deletions modules/static/planetscale/vitess/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version: v1
name: buf.build/planetscale/vitess
1 change: 1 addition & 0 deletions modules/static/planetscale/vitess/initref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
770e14433716a816905f267650191319f7d0515b
Copy link
Member Author

Choose a reason for hiding this comment

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

Latest git main hash at the moment of opening this PR.

4 changes: 4 additions & 0 deletions modules/static/planetscale/vitess/rsync.incl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+ LICENSE
+ *.proto
+ */
- *
24 changes: 22 additions & 2 deletions scripts/fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,27 @@ process_ref() {
cp "${module_root}/${git_owner}/${git_repo}/LICENSE" .
fi

# Copy only curated subset of files from that repo into a tmp module dir.
rsync -amR --include-from="${module_static_path}/rsync.incl" . "${mod_tmp_path}"
# rsync flags: https://linux.die.net/man/1/rsync
rsync_args=(
# Archive mode is a shortcut to preserve files modification times, permissions, recursive
# folders, among others: https://serverfault.com/questions/141773/what-is-archive-mode-in-rsync
--archive

# Prune empty directory chains from file-list
--prune-empty-dirs

# Use relative path names
--relative

# Copy symlinks as content, not as symlinks, it overrides the --links option embedded in
# --archive that copies symlinks as symlinks (eg LICENSE for planetscale/vitess)
--copy-links

# Copy only curated subset of files from that repo into a tmp module dir using `rsync.incl` file
# on each module's static dir
--include-from="${module_static_path}/rsync.incl"
Copy link
Member

Choose a reason for hiding this comment

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

Nice - this is helpful to see it expanded like this.

)
rsync "${rsync_args[@]}" . "${mod_tmp_path}"
[ ! -e "${module_static_path}/buf.md" ] || cp "${module_static_path}/buf.md" "${mod_tmp_path}"
[ ! -e "${module_static_path}/buf.yaml" ] || cp "${module_static_path}/buf.yaml" "${mod_tmp_path}"

Expand Down Expand Up @@ -192,6 +211,7 @@ sync_references commits grpc grpc https://github.com/grpc/grpc-proto
sync_references commits grpc-ecosystem grpc-gateway https://github.com/grpc-ecosystem/grpc-gateway
sync_references commits opencensus opencensus https://github.com/census-instrumentation/opencensus-proto src
sync_references commits opentelemetry opentelemetry https://github.com/open-telemetry/opentelemetry-proto
sync_references commits planetscale vitess https://github.com/planetscale/vitess-types src
sync_references commits prometheus client-model https://github.com/prometheus/client_model
sync_references releases protocolbuffers wellknowntypes https://github.com/protocolbuffers/protobuf src

Expand Down