Skip to content

Conversation

@ferdia-sopermaccafraidh-lrn
Copy link
Contributor

@ferdia-sopermaccafraidh-lrn ferdia-sopermaccafraidh-lrn commented Aug 23, 2024

Overview

Proposal to add a Versio Check step to the release action to ensure the release git tag version matches learnosity/_version.py.

This works well with the new workflow added by @walsh-conor.

Context

This came out of my initial experience with #80 where after creating a pre-release, it has overwritten v0.3.8 in PyPI, as when creating the release, _version.py was still used.
https://github.com/Learnosity/learnosity-sdk-python/releases/tag/v0.3.13-pre

This has been added to the documentation for contributing that a version bump is required for release.

Info on what github.ref_name is and why it matches for release where we create a new tag.
https://github.com/orgs/community/discussions/26686

Testing

This small step was manually tested in a fork of the project here:
https://github.com/ferdia-sopermaccafraidh-lrn/learnosity-sdk-python

Successful Run where the tag matches:
https://github.com/ferdia-sopermaccafraidh-lrn/learnosity-sdk-python/actions/runs/10992052191/job/30515674757
image

Failed Run where the reference didn't match (on a push so the ref_name was master).
https://github.com/ferdia-sopermaccafraidh-lrn/learnosity-sdk-python/actions/runs/10992018237/job/30515573917
image

Changes

  • [FEATURE] Check that package version matches release version.
  • [DOC] Updated release instructions to reflect changes.

Checklist

  • Feature
  • ChangeLog.md updated

@ferdia-sopermaccafraidh-lrn
Copy link
Contributor Author

ferdia-sopermaccafraidh-lrn commented Aug 23, 2024

💭 thought (non-blocking): We could potentially use autogenerated release notes as the single source of truth for the Changelog instead of Changelog.md to avoid further duplication now that Github Actions are being used for deployment?

💭 thought (non-blocking): we could potentially remove _version.py from source control as well so it's fully controlled by this process to avoid confusion?

@shtrom
Copy link
Contributor

shtrom commented Aug 25, 2024

Autogenerating version.py is a good idea. Removing it from Git may be, too, but I worry this might break the SDK if running from a Git clone, so worth checking first.

@ferdia-sopermaccafraidh-lrn
Copy link
Contributor Author

Autogenerating version.py is a good idea. Removing it from Git may be, too, but I worry this might break the SDK if running from a Git clone, so worth checking first.

@shtrom I'll investigate the consequences of removing version.py when building the locally installable version to see if there's any issues if we remove this and leave it only for releases to add.

@ferdia-sopermaccafraidh-lrn ferdia-sopermaccafraidh-lrn changed the title Use Release Tag as Library Version Check Package Version Matches Release Tag On Deployment Sep 23, 2024
@ferdia-sopermaccafraidh-lrn ferdia-sopermaccafraidh-lrn marked this pull request as ready for review September 23, 2024 10:44
@ferdia-sopermaccafraidh-lrn ferdia-sopermaccafraidh-lrn deleted the release-tag-as-publish-version branch September 23, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants