Skip to content

Commit

Permalink
docs: how to merge from public upstream (#40)
Browse files Browse the repository at this point in the history
* docs: how to merge from public upstream

* update contents
  • Loading branch information
cojenco authored Nov 22, 2024
1 parent d6fe248 commit e96974d
Showing 1 changed file with 74 additions and 19 deletions.
93 changes: 74 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ is expected to be used by Storage library maintainers.
- [Run the testbench](#run-the-testbench)
- [Start the gRPC server](#start-the-gRPC-server)
- [Check that the testbench is running](#check-that-the-testbench-is-running)
- [Updating Proto Files](#updating-proto-files)
- [Force Failures](#force-failures)
- [return-broken-stream](#return-broken-stream)
- [return-corrupted-data](#return-corrupted-data)
Expand All @@ -35,6 +34,8 @@ is expected to be used by Storage library maintainers.
- [Delete a Retry Test resource](#delete-a-retry-test-resource)
- [Causing a failure using x-retry-test-id header](#causing-a-failure-using-x-retry-test-id-header)
- [Forced Failures Supported](#forced-failures-supported)
- [Merging from Upstream](#merging-from-upstream)
- [Updating Proto Files](#updating-proto-files)
- [Releasing the testbench](#releasing-the-testbench)

## Issue Policy
Expand Down Expand Up @@ -120,24 +121,6 @@ The response you get should be: `OK`
Now you can use the testbench (while it's running) with the client libraries.

## Updating Proto Files

From time to time you may need to update the files generated by protobuf and
gRPC. To do so, clone the [protos](https://github.com/googleapis/googleapis) and
run the grpc_tools generator:

```shell
cd $HOME/storage-testbench
pip install --no-deps grpcio-tools
./update-protos.sh $PWD/.googleapis
```

Then commit the files generated in `google/**`:

```shell
git commit -m"chore: update protos" google
```

## Force Failures

You can force the following failures by using the `x-goog-emulator-instructions` header.
Expand Down Expand Up @@ -276,6 +259,78 @@ curl -H "x-retry-test-id: 1d05c20627844214a9ff7cbcf696317d" "http://localhost:91
| redirect-send-token-T | [HTTP] Unsupported [GRPC] Testbench will fail the RPC with `ABORTED` and include appropriate redirection error details.
| redirect-send-handle-and-token-T | [HTTP] Unsupported [GRPC] Testbench will fail the RPC with `ABORTED` and include appropriate redirection error details.

## How-to Guide: maintaining the pre-launch branch(es)

### Merging from Upstream

Clone a repository (you may already have one) that has both the public and
`*-prelaunch` repos as remotes. We choose a configuration that makes it really
hard to accidentally push prelaunch code to the public repo:

```shell
git clone git@github.com:googleapis/storage-testbench.git
cd storage-testbench
git remote add prelaunch git@github.com:googleapis/storage-testbench-prelaunch.git
```

Update your clone to the latest versions:

```shell
git fetch prelaunch
git fetch origin
```

Find out the latest commit from the public repo already present in the
`*-prelaunch` repo:

```shell
A=$(git rev-parse prelaunch/upstream)
```

Find out the latest commit from the public repo main branch:

```shell
B=$(git rev-parse origin/main)
```

Update the `upstream` branch on the `*-prelaunch` repository:

```shell
git push prelaunch origin/main:upstream
```

You can use a separate workspace for the next steps:

```shell
cd $HOME/
git clone git@github.com:googleapis/storage-testbench-prelaunch.git
cd storage-testbench
git checkout pre-launch-acv2
git checkout -b chore-merge-from-public-circa-$(date +%Y-%m-%d)
git cherry-pick ${A}..${B}
```

Send a PR and squash commit as usual.


## Updating Proto Files

From time to time you may need to update the files generated by protobuf and
gRPC. To do so, clone the [protos](https://github.com/googleapis/googleapis) and
run the grpc_tools generator:

```shell
cd $HOME/storage-testbench
pip install --no-deps grpcio-tools
./update-protos.sh $PWD/.googleapis
```

Then commit the files generated in `google/**`:

```shell
git commit -m"chore: update protos" google
```

## Releasing the testbench

The repository currently uses [Github Tags](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release)
Expand Down

0 comments on commit e96974d

Please sign in to comment.