-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(version): bump up dgraph version in source #8499
Conversation
ba2c5f6
to
da78c42
Compare
Looks like some our backup worker code uses |
@@ -140,7 +140,8 @@ const ( | |||
"X-CSRF-Token, X-Auth-Token, X-Requested-With" | |||
DgraphCostHeader = "Dgraph-TouchedUids" | |||
|
|||
DgraphVersion = 2103 | |||
// TODO: we should use ldflag in init.go (currently not exported) to set this version | |||
DgraphVersion = 2200 |
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.
Maybe we should add this to the "Doing a Release" doc, basically just making sure this value is correct when the release is cut. But yeah, I agree in principle that it really should be pulling from the environment.
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.
+1 ^ would it be possible to pull this info from the environment at build time instead?
Do we already know how we use this variable? My theory is that we use this in the "upgrade" subprogram. |
Actually this PR is not needed. The -X build tag in the Makefile here sets this variable at build time. @skrdgraph, I'm assuming the release pipeline still sets env DGRAPH_VERSION as expected. Maybe a comment could be added just above to let future readers know that it's set at build time and/or set the value to sometime like 0? @skrdgraph, feel free to close this PR once you're satisfied the new release pipeline is setting up DGRAPH_VERSION correctly. |
yeah ^ that makes sense. In the release pipeline we obtain the version like this and this gets passed to the build step like this I know that the |
Guys, I think this is necessary. See Line 143 in 6f7a6d2
It was renamed to Manifest version. So this is related to internal files. In the case to Backup files.
See the PR #7825 |
@matthewmcneely as far I undestood in the PRs related to this var. The -X build tag is irrelevant to this. It is related to backups and upgrades. So I think this variable needs attentio everytime we have a big change in the code that migh be breaking. Manually attention I mean. As its use has not been documented, we need to understand and document it. |
@matthewmcneely @skrdgraph Please take a look at my inline comment in the PR. There is a file |
@MichelDiz This is a good catch, I wasn't aware this was renamed at some point... Looks like that PR was merged into slash so presumably this will come up as we merge commits from slash into main. |
@MichelDiz I think this tool (ee/updatemanifest) was removed, right? |
@matthewmcneely Not sure, I never saw that tool. The backup and upgrades feels like isolated codes(subcommands) that wasn't well documented for future maintenance. |
OK, but what I can verify is that the on the main branch with the current Makefile, that variable x.DgraphVersion is set by whatever is in the -X build flag. |
@matthewmcneely correct, but it is a different variable. This one DgraphVersion is an exported variable, the one you're mentioning is in init.go which is private variable. That private one is set via -ldflags. If they are different, must be a reason for this. |
Ah right, sorry. So I guess the question remains, should this variable be set by an ldflag and not hardcoded? From what I can see, it's only used by worker/backup_ee.go::ProcessBackupRequest. Which I'm assuming we'd want that function to actually have a correct (current) version when it creates the backup |
This was changed to ManifestVersion, this solves the current naming issues. Please leave a comment while closing existing PRs / Issues (just for clarifications). |
Problem
Dgraph version is hard coded in source. Currently it is still at 2103. This should be bumped up to the latest version. Thanks to @MichelDiz for noticing this issue.
Solution
Added todo's because we probably should not be hard coding this into source. We already pass the version in via ldflags, we could potentially use this instead.