Skip to content

Adjust versioning to new format #9695

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

Merged
merged 24 commits into from
Aug 18, 2021
Merged

Conversation

MariaSemple
Copy link
Collaborator

@MariaSemple MariaSemple commented Aug 3, 2021

Intent

Addresses Pro #2788.

Approach

The CALENDAR_VERSION file must be present in the root of the repo.

Here is the output for RStudio.Version() from an R terminal in a locally built copy:

image

Updated about page:

image

Pro would show Build 16.pro1.

Automated Tests

N/A - build system change.

QA Notes

When we release a branch, the version should not continue to increment with the date on that branch for future builds. You can test locally by creating a release version file and giving it a value other than the current year and month.

Upgrades and downgrades should work as expected. I did some preliminary testing on this using dpkg and rpm version comparators and we are not expecting issues here.

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

@MariaSemple
Copy link
Collaborator Author

It actually appears that a trailing newline in RELEASE_VERSION is not a problem.

@jmcphers
Copy link
Member

jmcphers commented Aug 3, 2021

Where is the patch version going to be stored and incremented?

@MariaSemple
Copy link
Collaborator Author

@jmcphers
Copy link
Member

jmcphers commented Aug 3, 2021

Right, it defaults to 0 ... so how will we change it to 1 when we start working on the first patch release? (Is the idea that the Jenkinsfile will be different on each branch?)

@MariaSemple
Copy link
Collaborator Author

Yeah, exactly, just like we would have updated the old default from major version 1, minor version 5 to major version 1, minor version 6 for the next release

@MariaSemple MariaSemple changed the title Allow the version of a release to be fixed at a date Adjust versioning to new format Aug 17, 2021
@MariaSemple MariaSemple requested a review from jmcphers August 17, 2021 20:08
Copy link
Member

@jmcphers jmcphers 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 we also need adjustments to show the new version properly in (a) the About dialog, (b) the output of "rstudio-server version", and (c) the server homepage, which shows the version in the footer.

CMakeGlobals.txt Outdated
else()
set(CPACK_PACKAGE_VERSION_PATCH $ENV{RSTUDIO_VERSION_PATCH})
endif()
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION_SUFFIX $ENV{RSTUDIO_VERSION_SUFFIX})
Copy link
Member

Choose a reason for hiding this comment

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

Should we have a default suffix if one isn't defined in the environment? (Bonus points if it helps distinguish development builds, which typically don't have env vars set, from lab builds, which do; a job formerly done by the 9/99 parts of the version)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you think about -developer+999 or something like that?

Copy link
Member

Choose a reason for hiding this comment

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

I'm a fan. Maybe just -dev+999 for brevity?

@@ -348,6 +348,17 @@ SEXP rs_rstudioEdition()

// get version
SEXP rs_rstudioVersion()
{
std::string processedVersion = RSTUDIO_VERSION;
Copy link
Member

Choose a reason for hiding this comment

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

Would it be easier and/or less fragile to compose this from the component variables (RSTUDIO_VERSION_MAJOR, etc.)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can do that - we'll still have to apply regex on the RSTUDIO_VERSION_SUFFIX portion to strip the release channel and/or pro from the string

CALENDAR_VERSION Outdated
@@ -0,0 +1 @@
2021.09
Copy link
Member

Choose a reason for hiding this comment

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

Not something we have to change in this PR, but we're starting to accumulate a large number of these files at the repo root. I wonder if we should just have one that contains calendar version, flower, build type, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that would add complexity to the parsing system. What about moving them to their own folder, like version or release or something?

Copy link
Contributor

@kevinushey kevinushey left a comment

Choose a reason for hiding this comment

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

LGTM; some nits re: quoting variable expansions (since $RSTUDIO_ROOT_DIR could in theory contain spaces)

@@ -348,6 +348,17 @@ SEXP rs_rstudioEdition()

// get version
SEXP rs_rstudioVersion()
{
std::string processedVersion = RSTUDIO_VERSION;
processedVersion = boost::regex_replace(processedVersion, boost::regex("(?:-[a-zA-Z]*)?\\+"), ".");
Copy link
Contributor

@kevinushey kevinushey Aug 17, 2021

Choose a reason for hiding this comment

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

As a habit, I think it's usually better to hoist the boost::regex() object into its own variable, since (at least for other regex functions) the regular expression usually needs to live at least as long as other objects derived from using it (e.g. when finding and generating regex matches).

It's probably fine here, but pointing this out just in case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't know that! Is that primarily for when you'll iterate through multiple matches in a single input?

At any rate, I agree that it's necessary here since we keep no objects except the resulting string, which can't have a dependence on anything in boost.

@MariaSemple
Copy link
Collaborator Author

MariaSemple commented Aug 17, 2021

@jmcphers Updated the about page (see screenshots). I think rstudio-server version looks fine.
image

If the server homepage needs updates, I'll need to open a Pro PR for that after this one is merged.

@MariaSemple MariaSemple requested a review from jmcphers August 18, 2021 16:18
@MariaSemple MariaSemple merged commit c583827 into main Aug 18, 2021
@valerie-rstudio valerie-rstudio deleted the feature/allow-fixed-release-ver branch January 21, 2022 18:04
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