Repository navigation
GO-7383 Mirror v1 protos into any-block's format/v1/proto - #3290
Merged
Merged
Conversation
any-block dropped the four root-level .proto paths this workflow used to write; it now keeps a single import graph under format/v1/proto. Copy the sources there and rewrite both halves of what made the root copies distinct: the import paths, which used to be flattened to bare basenames, and the go_package values, which named Heart's own Go bindings and would otherwise clobber any-block's. models.proto has since gained export_report.proto as a dependency, so mirror that too, tolerating its absence on branches that predate it. Guard the copy with a check that every non-google import resolves to a mirrored file, which turns the next unmirrored dependency into a failed job here rather than an unresolvable import in any-block. Skip the commit when nothing changed, which used to fail the step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
anyproto/any-block#15 removes the four root-level
.protopaths this workflow writes to. any-block now keeps a single import graph underformat/v1/proto, so the mirror has to write there instead.Changes
any-block/format/v1/proto/rather than the repository root.format/v1/proto/<name>.protoinstead of flattening them to bare basenames.option go_package. The old workflow copied files verbatim, so a mirror run restored"pkg/lib/pb/model"/"pb"over any-block's"github.com/anyproto/any-block/format/v1/...", which its generated bindings depend on. That was already broken before this PR.pkg/lib/pb/model/protos/export_report.proto, whichmodels.protohas imported since 5fd547c and which has no counterpart in any-block. Without it the mirror pushes an unresolvable import. The steps skip the file when absent, so the workflow still works on branches predating it.git commitpreviously exited 1 and failed the step.Delivery is unchanged: still a direct commit and push to any-block's
main.Verification
Ran the exact
sedpair against bothdevelop's protos and the pre-export_reportversions onmain, then compiled the output in any-block's layout:format/v1/proto/*.protobyte for byte (go_packageand all imports).protoc -I . format/v1/proto/{models,events,changes,snapshot}.protocompiles, both with and withoutexport_report.protopresent.models.protoimportinglocalstore.proto.Locally this used BSD
sed -i ''; CI uses GNUsed -ion ubuntu. The expressions are POSIX ERE, so only the-isuffix argument differs.Note for reviewers
any-block generates
format/v1/model/models.pb.goand its JSON Schemas from these sources, so a mirror push leaves them stale and reds any-block'smainuntil someone runsgo generate ./format/v1 ./codec/anyblockjson. The pushed commit body says so. That tradeoff is inherent to pushing straight tomainand predates this PR — today the same push reds a different check.Merge order
Merge anyproto/any-block#15 first.