Skip to content

Add codename to version string and to bootloader title#1850

Merged
pfeerick merged 6 commits intomainfrom
VerCodename
Apr 24, 2022
Merged

Add codename to version string and to bootloader title#1850
pfeerick merged 6 commits intomainfrom
VerCodename

Conversation

@rotorman
Copy link
Member

@rotorman rotorman commented Apr 18, 2022

Solves #1847 by adding codename to version string in the VERSION page and also on the bootloader title.

Here, as tested on TX16S mkII physical target (notice the addition of -dev):

grafik

grafik

@rotorman rotorman added the enhancement ✨ New feature or request label Apr 18, 2022
@wimalopaan
Copy link
Contributor

You can get the same effect using the OPENTX_VERSION_SUFFIX environment variable for the cmake.

@raphaelcoeffic
Copy link
Member

You can get the same effect using the OPENTX_VERSION_SUFFIX environment variable for the cmake.

Thus meaning we should set the VERSION_SUFFIX (why OPENTX_?) depending on release / dev branch.

@rotorman
Copy link
Member Author

rotorman commented Apr 18, 2022

By default it could be set to -SB for self-builder. If users are building themselves, then vX.X.X-SB is automatically used and can be easily distinguished when providing help/support to users.

GitHub builds could use -DEV and -REL accordingly.

@pfeerick
Copy link
Member

pfeerick commented Apr 18, 2022

And/or link it to the release git tags and branch - if it is a tagged release, use the tag version (thus it will also indicate it is a rc). If it's not, it's a dev or self-build. But ideally it should be automated - unlike the codename - which needs updating for each release, and should be set to the new name after a release, not dev. It's not a secret, it's the working name for that release.

Then builds would show v2.7.0-rc1 for RC1, v2.7.0 for a release, v2.7.0-branchname for a github non-tagged build, and default to v2.7.0-sb for a self-build.

/radio/util/build-firmware.py is already looking at the OPENTX_VERSION_SUFFIX environment variable to manipulate VERSION_SUFFIX which is appeneded to VERSION, so it should just be a matter of initialising that environment variable (after renaming 😁)

@rotorman rotorman force-pushed the VerCodename branch 2 times, most recently from 5a72ab9 to afc20fe Compare April 19, 2022 15:08
@rotorman
Copy link
Member Author

rotorman commented Apr 19, 2022

Please double check if I got this right:

edgetx/tools/build-gh.sh

Lines 51 to 59 in e15156e

gh_tag=${GITHUB_REF##*/}
gh_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ -z $gh_tag ]];
then
export EDGETX_VERSION_SUFFIX=$gh_branch
else
export EDGETX_VERSION_SUFFIX=$gh_tag
fi

The result on radio with present state for GitHub built firmware (do not like "merge" string though so much, would prefer "dev" instead):
grafik

The output of the same source code locally built w/o specifying EDGETX_VERSION_SUFFIX (maybe we should go with -custom instead of -SB? Would be more intuitive, I guess):
grafik

Also, a test build warning screen is shown now on power-up, although at the moment only for self-built versions where EDGETX_VERSION_SUFFIX is not defined:

grafik

Ideally, this could be shown for all non-release versions.

Changed to lower case for "nightly" and "release".
@rotorman
Copy link
Member Author

rotorman commented Apr 19, 2022

Changed GitHub build merge string from edgetx/tools/build-gh.sh output to dev:

grafik

and local self-build appendix to custom:

grafik

I prefer this, but am open to suggestions.

@pfeerick
Copy link
Member

pfeerick commented Apr 19, 2022

Ideally, this could be shown for all non-release versions.

Most definitely not ... this was an intentional change right from the start AFAIK, and regardless, I do not want to see this re-introduced. It is annoying AF when running nightly releases regularly. It is also inappropriate when doing a build that for instance just turns on supported flags. The only place I see it being valid to be turned on in PRs, and even then, I'm on the fence as to whether it should be on or off there.

Regarding the tags, merge is correct if it is coming up for pull request branches, since they are merge branches. This also tells you the build is from a PR, not from the dev branch, which from what I can tell this obscures. And selfbuild would be more that SB, since it's not an acronym ;) Also just seem more descriptive than "custom" ... custom what? ;)

@rotorman
Copy link
Member Author

rotorman commented Apr 20, 2022

I hear you, thank you for the feedback!

In latest commit TEST_BUILD_WARNING screen is gone, -merge is back for GH PR builds and self built firmwares are marked with -selfbuild

grafik

grafik

@pfeerick pfeerick self-assigned this Apr 23, 2022
Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

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

I think this is a fantastic starting point. I would still like to see PR number exposed if it's a PR build, but that seems to be be somewhat involved to tease out of github, so can be something for a future PR.

Most importantly, this communicates that either a development, a release build, or a self build is in use :)

@pfeerick pfeerick merged commit 7aa27a6 into main Apr 24, 2022
pfeerick added a commit that referenced this pull request Apr 24, 2022
…ffix (#1850)

* Add codename to version string and to bootloader title.

* Use EDGETX_VERSION_SUFFIX instead of CODENAME

* use "dev" instead of "merge" and "custom" instead of "SB".
Changed to lower case for "nightly" and "release".

* Show TEST BUILD warning screen for all non release builds.

* Improved logic

* Removed TEST_BUILD_WARNING, reverted to "merge" and changed to "selfbuild".
@rotorman rotorman deleted the VerCodename branch April 24, 2022 08:19
@pfeerick pfeerick linked an issue Apr 25, 2022 that may be closed by this pull request
rotorman pushed a commit that referenced this pull request Apr 27, 2022
…ffix (#1850)

* Add codename to version string and to bootloader title.

* Use EDGETX_VERSION_SUFFIX instead of CODENAME

* use "dev" instead of "merge" and "custom" instead of "SB".
Changed to lower case for "nightly" and "release".

* Show TEST BUILD warning screen for all non release builds.

* Improved logic

* Removed TEST_BUILD_WARNING, reverted to "merge" and changed to "selfbuild".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "*-dev" to version string of non-releases

4 participants