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

fix(protos): regenerate protos #7102

Merged
merged 1 commit into from
Dec 10, 2020
Merged

fix(protos): regenerate protos #7102

merged 1 commit into from
Dec 10, 2020

Conversation

NamanJain8
Copy link
Contributor

@NamanJain8 NamanJain8 commented Dec 10, 2020


This change is Reviewable

Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain and @vvbalaji-dgraph)

Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

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

I've added a check during the CI build to check for proto differences:

cd ./protos
make regenerate
git diff --exit-code -- .

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain and @vvbalaji-dgraph)

@NamanJain8 NamanJain8 merged commit 7f16bf1 into master Dec 10, 2020
@NamanJain8 NamanJain8 deleted the naman/fix-proto branch December 10, 2020 08:51
danielmai added a commit that referenced this pull request Jan 18, 2021
If the proto dependencies change, then they need to be fetched first before the
protos can be regenerated. For example, when Badger protos change then this
error can happen:

    $ make regenerate
    cp: cannot stat '/pb/badgerpb3.proto': No such file or directory
    make: *** [Makefile:46: copy-protos] Error 1

Calling go get or go mod tidy fixes this issue:

    $ go mod tidy
    ...
    go: downloading github.com/dgraph-io/badger/v3 v3.0.0-20210113052537-b69163b5c21b

The dependencies need to be fetched in order to pick up the correct proto files
from the $GOMODCACHE directory using go list -m -f "{{.Dir}}".

Changes:
* Fetch dependencies (tidy-deps) before regenerating protos.
* Refactor Makefile with BADGER_PB_VERSION variable to make it
  easier to update Badger version
* Add Go tests to regenerate the protos and check for
  differences. This check originally added in CI in
  #7102 (review).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants