Skip to content
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

Adds semantic versioning and release publishing #39

Conversation

AlexandruAntonescuKeysight
Copy link
Contributor

Summary

This PR is intended to enhance the CI pipeline and simplify the modules calling. It has the following additions:

A new workflow file was created for versioning task and it contains the following:

  1. installs protolock for backward compatibility checking
  2. adds semantic versioning and backward compatibility checking
  • a few files have been added: VERSION, version.py, proto.lock

    • VERSION contains the version (major.minor.patch) in plain text; it is necessary for manually updating the major and dynamic version retrieval in pyproject.toml when installing with pip
    • proto.lock is a file generated by running the command protolock init (only once, after that when there are modification it is ran protolock commit); this tool is used for checking protobuff backward compatibility
    • version.py is a python script that checks if backward compatibility is broken by calling protolock status and if so, the minor version is incremented, otherwise the patch number is incremented. Also, it manages the incrementing step of the version and also updates the VERSION file with the new version
  • the pyproject.toml was also updated to dynamically read the version from the VERSION file when building or installing

  • also after the version is updated, a commit is made for submitting the new VERSION and proto.lock files to the repo

  • the previous commit is done by an action and the commiter is actions-user. Because of this, actions-user was added to the allow list in the CLA-bot workflow

  1. adds steps for publishing the release on the main project page under the Releases section
  2. adds steps for building a python wheel of the project and publishing it to the assets section of the last added release

Test Plan

I've tested this by locally running version.py script after randomly making changes to the proto (to check if protolock is working fine).
Also, I've made test branches on my fork and on Dan's to see if the workflows are working good on github runners.

Copy link

github-actions bot commented Apr 12, 2024

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@TaekyungHeo
Copy link
Contributor

TaekyungHeo commented Apr 15, 2024

Short Summary: This PR has been thoroughly tested by Dan and @AlexandruAntonescuKeysight. It automatically increases the minor version of semantic versioning when there is a minor change in the protobuf definition. The major version should be updated manually.

cc: @srinivas212

.gitignore Outdated
@@ -7,3 +7,4 @@ __pycache__/
*.et
*.dot
.pyre
.vscode/

Choose a reason for hiding this comment

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

nit seems a bit user editor specific

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed it

@briancoutinho
Copy link

Looks good (y)
QQ @AlexandruAntonescuKeysight what happens when we increment major version, then the code need to not be compatible with previous minor, it was not clear how to do that with version.py

@danmih-ixia
Copy link

Looks good (y) QQ @AlexandruAntonescuKeysight what happens when we increment major version, then the code need to not be compatible with previous minor, it was not clear how to do that with version.py

Major version is only incremented manually. version.py does not increment it.

Copy link
Contributor

@srinivas212 srinivas212 left a comment

Choose a reason for hiding this comment

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

lgtm. Thank you for your contributions @AlexandruAntonescuKeysight!

@srinivas212 srinivas212 merged commit 946834d into mlcommons:main May 17, 2024
5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants