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

Add nox task prepare-release #134

Merged
merged 40 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0402e71
Add tests for version class
Nicoretti Feb 9, 2024
124bee2
Add implementation for Version from string
Nicoretti Feb 9, 2024
31f176f
Add tests for checking for later versions
Nicoretti Feb 9, 2024
c84e26e
Add implementation for version comparision
Nicoretti Feb 9, 2024
0dbe535
Add tasks stubs for releases to nox tasks
Nicoretti Feb 9, 2024
0aec1d5
Add version type parsing support
Nicoretti Feb 9, 2024
71a9159
Improve error message of version parser
Nicoretti Feb 9, 2024
8125532
Make sure prysk gets installed with pytest plugin support
Nicoretti Feb 9, 2024
bebce7a
Add basic tests for prepare-release task
Nicoretti Feb 9, 2024
8edbb22
Add function to retrieve all git tags within the workspace
Nicoretti Feb 12, 2024
30f1453
Add support for getting version from poetry
Nicoretti Feb 13, 2024
7465824
Add test for version check
Nicoretti Feb 13, 2024
89331db
Reformat tests
Nicoretti Feb 13, 2024
2f36695
Refactor changelog from reStructuredText to Markdown
Nicoretti Feb 13, 2024
0ec8556
Add support for release notes for GitHub release in release workflow
Nicoretti Feb 13, 2024
6ed6c31
Fix test
Nicoretti Feb 13, 2024
d29cf66
Add support for generating the changelog content
Nicoretti Feb 13, 2024
9087f40
Add prepare-release task
Nicoretti Feb 23, 2024
f54e9ef
Update developer guide
Nicoretti Mar 11, 2024
e29f8af
Fix type annotations in release module
Nicoretti Mar 11, 2024
d059abc
Fix tests
Nicoretti Mar 11, 2024
577b4f6
Refactor name of extract function
Nicoretti Mar 11, 2024
c3d605e
Add test for changelog extraction
Nicoretti Mar 11, 2024
7207150
Update comments
Nicoretti Mar 11, 2024
f14af07
Fix output in error case
Nicoretti Mar 11, 2024
7d03112
Fix tests
Nicoretti Mar 11, 2024
9fe216c
Update release workflow
Nicoretti Mar 11, 2024
e55e153
Fix test and import
Nicoretti Mar 12, 2024
7f431ea
Update changelog
Nicoretti Mar 12, 2024
f3c7d99
Update doc/changes/unreleased.md
Nicoretti Mar 13, 2024
87ab545
Update doc/changes/unreleased.md
Nicoretti Mar 13, 2024
9079ab3
Update doc/changes/unreleased.md
Nicoretti Mar 13, 2024
33b4428
Update doc/changes/unreleased.md
Nicoretti Mar 13, 2024
a6361b4
Update doc/developer_guide/development.rst
Nicoretti Mar 13, 2024
90c7351
Update exasol/toolbox/git.py
Nicoretti Mar 13, 2024
188eed6
Add type annotation
Nicoretti Mar 13, 2024
900524c
Update tasks
Nicoretti Mar 13, 2024
6e0f84f
Fix version condition
Nicoretti Mar 13, 2024
52474f7
Removed empty test file
Nicoretti Mar 13, 2024
43ac47c
Integrate review feedback
Nicoretti Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
run: >
gh release create ${GITHUB_REF_NAME}
--title ${GITHUB_REF_NAME}
--notes-file ./doc/changes/changes_${GITHUB_REF_NAME}.md
dist/*
140 changes: 0 additions & 140 deletions doc/changelog.rst

This file was deleted.

30 changes: 30 additions & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 📝 Changes

* [unreleased](unreleased.md)
* [0.8.0](changes_0.8.0.md)
* [0.7.0](changes_0.7.0.md)
* [0.6.2](changes_0.6.2.md)
* [0.6.1](changes_0.6.1.md)
* [0.6.0](changes_0.6.0.md)
* [0.5.0](changes_0.5.0.md)
* [0.4.0](changes_0.4.0.md)
* [0.3.0](changes_0.3.0.md)
* [0.2.0](changes_0.2.0.md)
* [0.1.0](changes_0.1.0.md)

```{toctree}
---
hidden:
---
unreleased
changes_0.8.0
changes_0.7.0
changes_0.6.2
changes_0.6.1
changes_0.6.0
changes_0.5.0
changes_0.4.0
changes_0.3.0
changes_0.2.0
changes_0.1.0
```
5 changes: 5 additions & 0 deletions doc/changes/changes_0.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0.1.0 - 2022-11-25

## Added

* ✨ Initial release
12 changes: 12 additions & 0 deletions doc/changes/changes_0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 0.2.0 - 2022-12-20

## ✨ Added
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved
* Added basic templates for workflow and config files
* Added additional Project metadata

## 🔧 Changed
* Updated dependencies
* Migrate project to exasol organization

## 📚 Documentation
* Updated workflow documentation
7 changes: 7 additions & 0 deletions doc/changes/changes_0.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 0.3.0 - 2022-12-21

## ✨ Added
* Added support for custom path filters to config object

## 🔧 Changed
* Updated dependencies
16 changes: 16 additions & 0 deletions doc/changes/changes_0.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 0.4.0 - 2023-04-19

## ✨ Added
* Added support for metrics
- Added nox metrics task :code:`nox -s report`
- Added GitHub workflow which generates and reports the metrics
- Added metrics workflow call invocation to standard workflows
* ci
* ci-cd
* pr-merge

## 🔧 Changed
* Updated dependencies

## 🗑 Removed
* Removed :code:`scriv` support
10 changes: 10 additions & 0 deletions doc/changes/changes_0.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 0.5.0 - 2023-10-12

## ✨ Added
* Added first version of the tbx cli tool with support for managing github workflows

## 🔧 Changed
* Changed autogenerated comment in version.py for better clarity
* Updated dependencies
* Updated github issue templates

6 changes: 6 additions & 0 deletions doc/changes/changes_0.6.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 0.6.0 - 2023-10-27

## ✨ Added
* Added security command
* Added security-issues action

5 changes: 5 additions & 0 deletions doc/changes/changes_0.6.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0.6.1 - 2023-10-27

## 🐞 Fixed
* Fixed failing security-issues action in case of empty ignore list

9 changes: 9 additions & 0 deletions doc/changes/changes_0.6.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 0.6.2 - 2023-11-20

## 🐞 Fixed
* Fix failing vulnerability issue creator when Maven report does not contain "vulnerable" entry

## 🔧 Changed
* Update pylint dependency
* Update import-lib dependency

5 changes: 5 additions & 0 deletions doc/changes/changes_0.7.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0.7.0 - 2024-01-26

## ✨ Added
* Added support for referencing projects in security-issues action.

5 changes: 5 additions & 0 deletions doc/changes/changes_0.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0.8.0 - 2024-02-07

## ✨ Added
* Added output `created-issues` to `security-issues` action containing the found security issues including the created GitHub issues in JSONL format.

40 changes: 40 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Unreleased

## 🚨 Breaking Changes
* **CI-CD Workflow (Breaking Change)**

**Overview:**

The CI-CD workflow now assumes the changelog to be in markdown and the location `/doc/changes/change_x.y.z.md`

## ✨ Added
* **Added Nox Task `prepare-release`**

**Overview:**

A new Nox task, `prepare-release`, has been introduced to streamline the release preparation process. This task automates several crucial steps:

- Create a dedicated branch for the release changes.
- Transfer changes from the "Unreleased" section to the appropriate versioned changelog section.
- Update the version number to the next release.
- Initiate a Pull Request (PR) for review and integration into the main branch.

**Usage:**

To prepare a release, simply execute a command in your terminal like in the example below:

```shell
nox -s prepare-release -- 1.10.1
```

Add the changes for releasing on top of the current branch:

```shell
nox -s prepare-release -- 1.10.1 --no-pr --no-branch
```

For additional options and help regarding the task `prepare-release`, execute:

```shell
nox -s prepare-release -- -h
```
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"sphinx.ext.autosummary",
"sphinx.ext.autosectionlabel",
"sphinx_copybutton",
"myst_parser",
]

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
Expand Down
39 changes: 18 additions & 21 deletions doc/developer_guide/development.rst
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
🚧 Development - Contributing
=============================

Setting up the Development Environment
++++++++++++++++++++++++++++++++++++++
Creating a Release
++++++++++++++++++

.. figure:: ../_static/nothing-to-see-here.png
:alt: nothing to see here
:target: https://imgflip.com/i/2a7gqa
Prepare the Release
-------------------

source: `imgflip.com <https://imgflip.com/>`_
To prepare for a release, a pull request with the following parameters needs to be created:

Creating a Release
++++++++++++++++++
- Updated version numbers
- Updated the changelog
- Updated workflow templates (not automated yet)
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved

This can be achieved by running the following command:

Prerequisites
-------------
.. code-block:: shell

* Change log needs to be up to date
* Latest change log version needs to match project and package version
* Release tag needs to match package, changelog and project version
nox -s prepare-release -- <major>.<minor>.<patch>
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved

For Example:
* Tag: 0.4.0
* Changelog: changes_0.4.0.md
* \`poetry version -s\`: 0.4.0
Replace `<major>`, `<minor>`, and `<patch>` with the appropriate version numbers.
Once the PR is successfully merged, the release can be triggered (see next section).

Triggering the Release
----------------------
In order to trigger a release a new tag must be pushed to Github.
For further details see: `.github/workflows/ci-cd.yml`.

To trigger a release, a new tag must be pushed to GitHub. For further details, see `.github/workflows/ci-cd.yml`.

#. Create a local tag with the appropriate version number
1. Create a local tag with the appropriate version number:

.. code-block:: shell

git tag x.y.z

#. Push the tag to Github
2. Push the tag to GitHub:

.. code-block:: shell

git push origin x.y.z


What to do if the release failed?
---------------------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
github_actions/github_actions
api
developer_guide/developer_guide
changelog
changes/changelog
Loading
Loading