refactor(common): versioned namespace includes major, minor, patch#7464
refactor(common): versioned namespace includes major, minor, patch#7464devjgm merged 3 commits intogoogleapis:mainfrom
Conversation
Fixes: googleapis#5976 This PR changes our inline namespace to include the major, minor, and patch numbers. It's been discussed that we should not include the patch number, and that's OK with me if there's a benefit to doing so. This PR also adds backward compatibility namespace aliases for both `v1` and `gcpcxxV1` to avoid breaking users. This does introduce the `gcpcxxV1` alias in non-generated code where it didn't previously exist (and the same with `v1` in generated code), but this solution seems to work fine and seems significantly simpler than any alternative that I was able to think of. There's no place to use `@deprecated` on these symbols, and indeed they don't even show up in Doxygen documentation. The only indication of deprecation is a mention in the `CHANGELOG.md` file that's included in this PR.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #7464 +/- ##
=======================================
Coverage 93.64% 93.64%
=======================================
Files 1364 1364
Lines 118362 118362
=======================================
Hits 110842 110842
Misses 7520 7520
Continue to review full report at Codecov.
|
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
| you can `CTRL-C` the build after CMake's configure step is finished. | ||
| `ci/cloudbuild/build.sh -t clang-tidy-pr` will do this, and you can `CTRL-C` | ||
| the build after CMake's configure step is finished. | ||
| - Update the ABI baseline to include the new version numbers in the inline |
There was a problem hiding this comment.
Interesting. I had thought about this "enforcing" an ABI break on each release, but I had not thought about the impact on our baselines. I am not sure if this is good, bad, or indifferent.
There was a problem hiding this comment.
As far as our ABI baselines dumps are concerned, I think this change is roughly equivalent to before, because we were already updating the baseline with each release, but now we need to do it at a different point in the release process.
There was a problem hiding this comment.
Okay, I think we have a problem for patch releases:
- We create release 1.100.0.
- We update the version numbers.
- We update the baseline, so all its symbols contain
v1_101_0, e.g. assumegoogle::cloud::v1_101_0::Barexists. - Commit the baseline to
main. - Some time goes by we add symbol
google::cloud::v1_101_0::Foo, we don't necessarily update the baseline because adding symbols does not break the CI builds. - We create the
v1.101.0release. - The
v1.101.xbranch contains the baseline withv1_101_0from whatever point it was last updated (which may not be the release point). - Let's say we want to create
v1.101.1 - We create a PR ... and send it to the CI builds.
- The CI builds will detect some changes, but will not detect other changes:
- Recall that the baseline was not updated when
v1.101.0was created, it is "stale" - Removing
google::cloud::v1_101_0::Barwould be detected. - Removing
google::cloud::v1_101_0::Foowould not be detected.
- Recall that the baseline was not updated when
Fixes: #5976
This PR changes our inline namespace to include the major, minor, and
patch numbers. It's been discussed that we should not include the patch
number, and that's OK with me if there's a benefit to doing so.
This PR also adds backward compatibility namespace aliases for both
v1andgcpcxxV1to avoid breaking users. This does introduce thegcpcxxV1alias in non-generated code where it didn't previously exist(and the same with
v1in generated code), but this solution seems towork fine and seems significantly simpler than any alternative that I
was able to think of.
There's no place to use
@deprecatedon these symbols, and indeed theydon't even show up in Doxygen documentation. The only indication of
deprecation is a mention in the
CHANGELOG.mdfile that's included inthis PR.
This change is