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

Suggestion to update BUILD_VERSION policy #1733

Merged
merged 12 commits into from
Jul 9, 2023
Merged

Suggestion to update BUILD_VERSION policy #1733

merged 12 commits into from
Jul 9, 2023

Conversation

ia
Copy link
Collaborator

@ia ia commented Jul 5, 2023

  • Please check if the PR fulfills these requirements
  • The changes have been tested locally
  • There are no breaking changes
  • What kind of change does this PR introduce?
    Slightly updated BUILD_VERSION policy.

  • What is the current behavior?
    Currently, to distinguish right on a device a release tree build from a devel tree build, a user should get sha id of the latest commit from the repo to check & compare it on a device in debug menu.1

  • What is the new behavior (if this is a feature change)?
    Suggestion to update BUILD_VERSION policy:
  • use X.MNd version line for dev branch which means "this version under development and it will be next X.MN release".
  • when next stable release is taking place, just remove d suffix before placing git tag release for a commit;
  • with the next commit to dev branch right after release, increase minor number by one & put d suffix back until the next release.

What do you think?

  • Other information:
    P.S. Can't promise but I will try to do something more useful with the next PR :D

Footnotes

  1. When I have to test a few different builds from different commits at the same time, I have to make sure about the origin so this update would help to distinguish at least devel version from release one in a fast & easy way.

@Ralim
Copy link
Owner

Ralim commented Jul 5, 2023

Alternatively could the python code just check the branch and append a suffix automatically

I.e. no suffix for main release, d for Dev and something else for any other branch?

Then no human logic required :)

@ia
Copy link
Collaborator Author

ia commented Jul 5, 2023

Alternatively could the python code just check the branch and append a suffix automatically

Brief grepping tells me that this could be added somewhere around here, right?

I.e. no suffix for main release, d for Dev and something else for any other branch?

How about this (since we add one-char letter anyway) just for unification:

  • d - dev branch
  • b - any other branch
  • r - tagged with [stable] official release
  • h - anything else like local builds from tarballs (as in homebrew)

Then no human logic required :)

Yes, interesting approach! Will try to make it work.

@Ralim
Copy link
Owner

Ralim commented Jul 6, 2023

Yep and Yep 🙇🏼

I prefer automation to humans where ever possible given the number of mistakes I can make 🤣

tag = f"{subprocess.check_output(['git', 'tag', '--points-at', '%s' % sha_id]).strip().decode('ascii')}"
## - get short "traditional" branch name (as in `git branch` for that one with asterisk):
branch = f"{subprocess.check_output(['git', 'symbolic-ref', '--short', 'HEAD']).strip().decode('ascii')}"
if tag and "" != tag:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably such kind of extra checks is too much but since we work with strings I thought it's better to double-check (not sure it makes sense in Python though).

Copy link
Owner

Choose a reason for hiding this comment

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

If it has no runtime cost, check as much as possible is my personal belief :)

@ia
Copy link
Collaborator Author

ia commented Jul 8, 2023

How about this (since we add one-char letter anyway) just for unification:
[...]

Updated policy (copy-pasted from version.h):

  • R - git-related release tag vXX.YY
  • T - git-related release tag but version is not vXX.YY !
  • D - git-related dev branch
  • B - git-related custom branch
  • G - neither above but git-related
  • H - build outside of a git tree (i.e. release tarball)
  • S - something special (should not happen?)
  • V - something very special (should not happen!)

Copy link
Owner

@Ralim Ralim left a comment

Choose a reason for hiding this comment

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

This seems sensible to me.
Maybe worth throwing a note into the documentation to help people decode without reading the code?

@ia
Copy link
Collaborator Author

ia commented Jul 9, 2023

This seems sensible to me. Maybe worth throwing a note into the documentation to help people decode without reading the code?

Valid point. I guess the most suitable place where it should be added is Documentation/DebugMenu.md, right? Since a user sees a version line in debug menu only.

@ia
Copy link
Collaborator Author

ia commented Jul 9, 2023

Here is how DebugMenu.md document file looks with recent update (just for your convenience). Let me know what you think.

@Ralim Ralim merged commit cd7696b into Ralim:dev Jul 9, 2023
@ia ia deleted the version branch July 11, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants