Skip to content

Latest commit

 

History

History
102 lines (68 loc) · 4.57 KB

developer-guide.md

File metadata and controls

102 lines (68 loc) · 4.57 KB

Notebook Connector Developer Guide

How to Release?

Creating a new release of the NC requires 4 steps

  1. Prepare the release
  2. Merge your pull request to the default branch
  3. Switch to main branch and update it from remote
  4. Create and push a tag to GitHub

Prepare the Release

poetry run nox -s release:prepare -- -- <additional-options> <version>

<additional-options> include

  • --no-branch if already working on a branch
  • --no-pr if you already created a pull request or plan to do so manually after preparing the release

The command uses the nox task project:fix of the Python Tool Box (PTB) and

  • Optionally creates a branch
  • Optionally creates a pull request
  • Updates the version number and the Change Log

Updating the Change Log includes

  • Moving file doc/changes/unreleased.md to a filename reflecting the specified version, e.g. doc/changes/changes_1.2.3.md
  • Updating the list of changes files in doc/changes/changelog.md
  • Adding the current date at the top of the changelog as the date of the release
  • Creating a new file doc/changes/unreleased.md

Switching to the default Branch

You can find out the default branch with

git remote show origin | sed -n '/HEAD branch/s/.*: //p'

The following commands switches to branch main and updates it from remote

git checkout main
git pull

Creating a Git Tag and Pushing it to GitHub

Use the following commands to create a Git Tag and push it to GitHub:

TAG=<version>
git tag "$TAG"
git push origin "$TAG"

Pushing the new tag to GitHub will trigger GitHub workflow ci-cd.yml.

The workflow completely automates the release process, incl.

  • Creating a release on GitHub and
  • Publishing the release to PyPi

Updating the Version Number Without Preparing a Release

You can use the following commands to manually update the version number without preparing a release:

  1. Update version in file pyproject.toml or call poetry version <version>
  2. Call poetry run version-check version.py --fix

The second command will update the version number in file version.py.

Selecting the Versions for SLCT and SLCR

NC contains multiple dependencies including the following

Dependency Defined in Example
script-languages-container-tool (SLCT) File pyproject.toml exasol-script-languages-container-tool = "^1.0.0"
A release of the Exasol Script Language Containers script-languages-release (SLCR) File exasol/nb_connector/slct_manager.py SLC_RELEASE_TAG = "9.1.0"

Additionally, each version of the SLCR depends on a specific version of the SLCT, see the SLCR release letters and the file pyproject.toml used by any specific released version of the SLCR.

Conclusion: Whenever you update the major version of script-languages-container-tool in pyproject.toml you will need to update the referenced tag of SLCR in slct_manager.py

Example

For the versions named in the table above

  • SLCR version 9.1.0 in the release letter, section "Script-Language-Container-Tool (Exaslct)" states "This release uses version 1.0.0 of the container tool."
  • When clicking on the commit 60492ad and "Browse files", then SLCR's file pyproject.toml shows exasol-script-languages-container-tool = "^1.0.0"

In this case the dependencies shown in the table above are ✅ valid as NC's file pyproject.toml depends on the same major version of SLCT.

General instructions

Check if the referred version of SLCR is also compatible with the version of SLCT:

  1. Go to SLCR releases
  2. Search for the SLCR version referenced in NC's file exasol/nb_connector/slct_manager.py
  3. Check if in the SLCR release, file pyproject.toml, dependency script-languages-container-tools has the same major version