From d5420e075a903442256ae767d1da062c44499741 Mon Sep 17 00:00:00 2001 From: Neel Gala Date: Sun, 20 Aug 2023 16:37:15 +0530 Subject: [PATCH] Updating CONTRIBUTING.rst to capture the new git strategy --- .github/pull_request_template.md | 25 +++++++++++ CHANGELOG.md | 8 ++++ CONTRIBUTING.rst | 71 ++++++++++++++++++++++---------- setup.cfg | 4 -- setup.py | 3 +- 5 files changed, 85 insertions(+), 26 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..6b0e8c95 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,25 @@ + + +#DEVELOPMENT PRs SHOULD BE TO DEV BRANCH ONLY + +## Description + +> Provide a detailed description of the changes performed by the PR. + +### Related Issues + +> Please list all the issues related to this PR. Use NA if no issues exist. + +### Update to/for Ratified/Unratified Extensions or to framework + +- [ ] Ratified +- [ ] Unratified +- [ ] Framework + +### List Extensions + +> List the extensions that your PR affects. In case of unratified extensions, please provide a link to the spec draft that was referred to make this PR. + +### Mandatory Checklist: + + - [ ] Make sure to have created a suitable entry in the CHANGELOG.md under `[WIP-DEV]` section. diff --git a/CHANGELOG.md b/CHANGELOG.md index 14d689c5..f540f0b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +Please note the header `WIP-DEV` is to always remain indicating the changes done on the dev branch. +Only when a release to the main branch is done, the contents of the WIP-DEV are put under a +versioned header while the `WIP-DEV` is left empty + +## [WIP-DEV] +- Updating CONTRIBUTING.rst to capture the new git strategy adopted to follow a monthly release + cadence. + ## [0.11.1] - 2023-08-15 - Fixed hex values handling for K extensions - Fixed set indexing error during opcomb gen diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5e0df16b..391e2711 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -2,9 +2,9 @@ .. highlight:: shell -============ -Contributing -============ +====================== +Developer Contribution +====================== Contributions are welcome, and they are greatly appreciated and credit will always be given. @@ -30,15 +30,31 @@ If you are proposing a feature: * Remember that this is a volunteer-driven project, and that contributions are welcome :) +Git Strategy +------------ + +The repo adopts a simple git strategy where all contributions to the repo are made to the ``dev`` +branch (i.e. all Pull-Requests must use ``dev`` as the target branch). On a monthly cadence (decided +and controlled by the SIG-ARCH-TEST members) the ``dev`` branch will be merged to the ``main`` to by +the official maintainers of the repo. This will create an official release capturing all the +development over the month into a single release. + +To implement the above strategy successfully the following needs be followed: + +* Developers: All pull-requests from developers must target the ``dev`` branch and the PR must +contain an entry in the CHANGELOG.md file under `[WIP-DEV]` section. +* Maintainers: When a making a release the maintainers shall assign semantic version number by +updating the CHANGELOG and the respective python files before raising a PR from the `dev` to `main`. + Get Started! ------------ Ready to contribute? Here's how to set up `riscv_ctg` for local development. 1. Fork the `riscv_ctg` repo on GitHub. -2. Clone your fork locally:: +2. Clone your fork locally and checkout the ``dev`` branch:: - $ git clone https://github.com/riscv-software-src/riscv-ctg.git + $ git clone https://github.com/riscv-software-src/riscv-ctg.git -b dev 3. Create an issue and WIP merge request that creates a working branch for you:: @@ -58,33 +74,46 @@ Ready to contribute? Here's how to set up `riscv_ctg` for local development. $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature -6. Submit a merge request through the GitHub website. +6. Submit a pull-request through the GitHub website. Make sure the pull-request is on the `dev` +branch of the origin repo. + +7. Do not forget to make an entry in the CHANGELOG.md file under the `[WIP-DEV]` section +highlighting the changes you have done. Merge Request Guidelines ----------------------------- +------------------------ Before you submit a merge request, check that it meets these guidelines: -1. The merge request should include tests. +1. The merge request should include tests (if any). 2. If the merge request adds functionality, the docs should be updated. -3. The merge request should work for Python 3.6, 3.7 and 3.8, and for PyPy. - and make sure that the tests pass for all supported Python versions. +3. The target branch must always be the `dev` branch. + + +Versioning (only for maintainers) +--------------------------------- + +When issuing pull requests to the main branch (from dev), a version entry in the CHANGELOG.md is mandatory. The tool adheres to +the [`Semantic Versioning`](https://semver.org/spec/v2.0.0.html) scheme. Following guidelines must +be followed while assigning a new version number : + +- Patch-updates: all doc updates (like typos, more clarification,etc). +- Minor-updates: Fixing bugs in current features, adding new features which do not break current + features or working. Adding new extensions. +- Major-updates: Backward incompatible changes. -Tips ----- +Note: You can have either a patch or minor or major update. +Note: In case of a conflict, the maintainers will decide the final version to be assigned. -To run a subset of tests:: +To update the version of the python package for deployment you can use `bumpversion` (installed +using ``pip install bumpversion``):: - $ pytest tests.test_riscv_ctg +$ bumpversion --no-tag --config-file setup.cfg patch # last arg can be: major or minor or patch +If you don't have bumpversion installed you can manually update the version in the following files: -Deploying ---------- +- change the value of variable ``current_version`` in `./setup.cfg` +- change the value of variable ``__version__`` in `./riscv_ctg/__init__.py` -A reminder for the maintainers on how to deploy. -Make sure all your changes are committed. -Then run:: -$ bumpversion --no-tag --config-file setup.cfg patch # possible: major / minor / patch -$ git push origin name-of-your-branch diff --git a/setup.cfg b/setup.cfg index 878241cf..a9364240 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,10 +3,6 @@ current_version = 0.11.1 commit = True tag = True -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - [bumpversion:file:riscv_ctg/__init__.py] search = __version__ = '{current_version}' replace = __version__ = '{new_version}' diff --git a/setup.py b/setup.py index edf39544..cfba8937 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ from setuptools import setup, find_packages import os +import riscv_ctg # Base directory of package here = os.path.abspath(os.path.dirname(__file__)) @@ -26,7 +27,7 @@ def read_requires(): setup( name='riscv_ctg', - version='0.11.1', + version=riscv_ctg.__version__, description="RISC-V CTG", long_description=readme + '\n\n', classifiers=[