(Closed - made a PR from main
) bug: dynamically parse the latest/actual release version when building docs
#311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
I was wondering why the online doc never displayed the latest release notes (i.g. 3.5.0) when we push 3.5.0 tag, even though
CHANGELOG.rst
contains 3.5.0 information inmain
.It turns outs, when we checkout the repository to build the doc, we checked out the commit of the tag, not the
main
repository which contains the modifiedCHANGELOG.rst
. The reason we checked out the tag is that it always displayed the correct version number. However, themain
branch contains an additional commit that modifies CHANGLEOG.rst by the CI. This is what we (I) failed to recognize for a while.Proposed solution
Hence, we need to build docs by checking out the
main
branch as shown in this PR (https://github.com/Billingegroup/release-scripts/pull/120/files#r1900318116). However, it doesn't have the tag information that can be automatically detected by ourgit-versioning
dependency. How do we still get the right tag version? We can dynamically parse the latest release from GitHub's release viarequests
- hence the changes in this code.Result:
Shown below, I have tested this implementation using my dummy org/repo that does full release of
0.5.14
, using a single run of git tag and push: