Skip to content

Commit

Permalink
Update README CONTRIBUTING RELEASE
Browse files Browse the repository at this point in the history
* README: add information pertaining to shell completion;
* CONTRIBUTING: remove release information;
* RELEASE: create a dedicated file with all the relevant release
  information.
  • Loading branch information
blogh committed Aug 30, 2023
1 parent 68b230c commit 82e0af8
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 21 deletions.
16 changes: 1 addition & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ A vagrant file can be found in [this
repository](https://github.com/ioguix/vagrant-patroni) to generate a patroni/etcd
setup.

The `README.md` can be geneated with `./docs/make_readme.sh`.
The `README.md` can be generated with `./docs/make_readme.sh`.

## Executing Tests

Expand Down Expand Up @@ -99,17 +99,3 @@ Here's an example usage:
```bash
./vagrant/check_patroni.sh http://10.20.30.51:8008
```
## Release
Update the Changelog.
The package is generated and uploaded to pypi when a `v*` tag is created (see
`.github/workflow/publish.yml`).
Alternatively, the release can be done manually with:
```
tox -e build
tox -e upload
```
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ pip install git+https://github.com/dalibo/check_patroni.git

check_patroni works on python 3.6, we keep it that way because patroni also
supports it and there are still lots of RH 7 variants around. That being said
python 3.6 has been EOL for age and there is no support for it in the github
python 3.6 has been EOL for ages and there is no support for it in the github
CI.

## Support
Expand Down Expand Up @@ -98,8 +98,8 @@ A match is found when: `start <= VALUE <= end`.

For example, the following command will raise:

* a warning if there is less than 1 nodes, wich can be translated to outside of range [2;+INF[
* a critical if there are no nodes, wich can be translated to outside of range [1;+INF[
* a warning if there is less than 1 nodes, which can be translated to outside of range [2;+INF[
* a critical if there are no nodes, which can be translated to outside of range [1;+INF[

```
check_patroni -e https://10.20.199.3:8008 cluster_has_replica --warning 2: --critical 1:
Expand All @@ -115,6 +115,27 @@ Several options are available:
* `--cert_file`: your certificate or the concatenation of your certificate and private key
* `--key_file`: your private key (optional)

## Shell completion

We use the [click] library which supports shell completion natively.

Shell completion can be added by typing the following command or adding it to
a file spécific to your shell of choice.

* for Bash (add to `~/.bashrc`):
```
eval "$(_CHECK_PATRONI_COMPLETE=bash_source check_patroni)"
```
* for Zsh (add to `~/.zshrc`):
```
eval "$(_CHECK_PATRONI_COMPLETE=zsh_source check_patroni)"
```
* for Fish (add to `~/.config/fish/completions/check_patroni.fish`):
```
eval "$(_CHECK_PATRONI_COMPLETE=fish_source check_patroni)"
```

[click]: https://click.palletsprojects.com/en/8.0.x/shell-completion/?highlight=completion

## Cluster services

Expand Down
38 changes: 38 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Release HOW TO

## Preparatory changes

* Review the **Unreleased** section, if any, in `CHANGELOG.md` possibly adding
any missing item from closed issues, merged pull requests, or directly the
git history[^git-changes],
* Rename the **Unreleased** section according to the version to be released,
with a date,
* Bump the version in `check_patroni/__init__.py`,
* Rebuild the `README.md` (`cd docs; ./make_readme.sh`),
* Commit these changes (either on a dedicated branch, before submitting a pull
request or directly on the `master` branch) with the commit message `release
X.Y.Z`.
* Then, when changes landed in the `master` branch, create an annotated (and
possibly signed) tag, as `git tag -a [-s] -m 'release X.Y.Z' vX.Y.Z`,
and,
* Push with `--follow-tags`.

[^git-changes]: Use `git log $(git describe --tags --abbrev=0).. --format=%s
--reverse` to get commits from the previous tag.

## PyPI package

The package is generated and uploaded to pypi when a `v*` tag is created (see
`.github/workflow/publish.yml`).

Alternatively, the release can be done manually with:

```
tox -e build
tox -e upload
```

## GitHub release

Draft a new release from the release page, choosing the tag just pushed and
copy the relevant change log section as a description.
27 changes: 24 additions & 3 deletions docs/make_readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $ pip install git+https://github.com/dalibo/check_patroni.git
check_patroni works on python 3.6, we keep it that way because patroni also
supports it and there are still lots of RH 7 variants around. That being said
python 3.6 has been EOL for age and there is no support for it in the github
python 3.6 has been EOL for ages and there is no support for it in the github
CI.
## Support
Expand Down Expand Up @@ -80,8 +80,8 @@ A match is found when: `start <= VALUE <= end`.
For example, the following command will raise:
* a warning if there is less than 1 nodes, wich can be translated to outside of range [2;+INF[
* a critical if there are no nodes, wich can be translated to outside of range [1;+INF[
* a warning if there is less than 1 nodes, which can be translated to outside of range [2;+INF[
* a critical if there are no nodes, which can be translated to outside of range [1;+INF[
```
check_patroni -e https://10.20.199.3:8008 cluster_has_replica --warning 2: --critical 1:
Expand All @@ -97,6 +97,27 @@ Several options are available:
* `--cert_file`: your certificate or the concatenation of your certificate and private key
* `--key_file`: your private key (optional)
## Shell completion
We use the [click] library which supports shell completion natively.
Shell completion can be added by typing the following command or adding it to
a file spécific to your shell of choice.
* for Bash (add to `~/.bashrc`):
```
eval "$(_CHECK_PATRONI_COMPLETE=bash_source check_patroni)"
```
* for Zsh (add to `~/.zshrc`):
```
eval "$(_CHECK_PATRONI_COMPLETE=zsh_source check_patroni)"
```
* for Fish (add to `~/.config/fish/completions/check_patroni.fish`):
```
eval "$(_CHECK_PATRONI_COMPLETE=fish_source check_patroni)"
```
[click]: https://click.palletsprojects.com/en/8.0.x/shell-completion/?highlight=completion
_EOF_
readme
readme "## Cluster services"
Expand Down

0 comments on commit 82e0af8

Please sign in to comment.