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

There should be single source of truth for the project version #21302

Open
damccorm opened this issue Jun 4, 2022 · 7 comments
Open

There should be single source of truth for the project version #21302

damccorm opened this issue Jun 4, 2022 · 7 comments
Assignees

Comments

@damccorm
Copy link
Contributor

damccorm commented Jun 4, 2022

Now the Beam version is defined in two places:

The latter effectively overrides the former. For someone not very familiar with the Beam build system this may result in a hard to understand and debug behavior: unexpected version gets build and/or pushed to local Maven repository, and changing version in gradle.properties does not have any effect.

Adding a comment with a reference to BeamModulePlugin to gradle.properties can be a good start, and in the long run it would be great to have single source of truth for the project version.

 

 

Imported from Jira BEAM-14051. Original Jira may contain additional context.
Reported by: dmitryor.

@zjffdu
Copy link
Contributor

zjffdu commented Apr 3, 2023

@damccorm IIUC, if I just want to build a snapshot version on the master branch, I don't need to change anything in BeamModulePlugin and gradle.properties, is that right?

@damccorm
Copy link
Contributor Author

damccorm commented Apr 3, 2023

Yeah, that should be right

@kennknowles
Copy link
Member

I don't know how I did not know about this. Sheesh.

@kennknowles
Copy link
Member

Is "choose_rc_commit.sh" broken? Answer is "sort of". Yea why in the world does BeamModulePlugin do this.

@kennknowles kennknowles self-assigned this Sep 29, 2023
@kennknowles
Copy link
Member

It is actually defined in 6 places:

sed -i -e "s/version=.*/version=$TARGET_VERSION/" gradle.properties

Some of this is "essential" because Go and Python have a different concept for non-release versions than Java does. But I'm at least going to resolve the specific redundancy here which causes spurious -SNAPSHOT added when the source of truth should suffice for that determination.

@Naireen
Copy link
Contributor

Naireen commented Jan 26, 2024

Is this stale? I no longer see the version explicitly mentioned in BeamModulePluginGroovy (seems to have dissapeared between version 2.51 and 2.52.)

@kennknowles
Copy link
Member

I got rid of at least one. I think there are probably still a few. I guess I would want to check all the places that https://github.com/apache/beam/blob/master/release/src/main/scripts/set_version.sh sets things. This script may be obsoleted by some new GitHub Actions. (the only purpose the script really has is to know all the places the version exists)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants