From cae03c6d7e974a1d711021ec0a5d5213ed765294 Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 20 Jun 2021 22:13:57 +1000 Subject: [PATCH 1/3] Initial changelog Also simple process/script to manage entries in PR's without merge conflicts: 1. Unreleased entries area stored as text files in ".changelogs/" 2. On release these are concatenated together and put in CHANGELOG.md Script basically just add line of text to a "YYYY-MM-DD-branch.txt" formatted file --- CHANGELOG.md | 20 ++++++++++++++ scripts/changelog.py | 64 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 CHANGELOG.md create mode 100755 scripts/changelog.py diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..3f4b0775c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +## [Unreleased] + +Note: unreleased change log entries are kept in `.changelogs/` directory in repo root, and can be added with `./script/changelog.py add "Added thing for reason" + +## 0.3.0 - 2021-01-11 +- Flexible named reports +- Updates to the TaskChampion crate API +- Usability improvements + +## 0.2.0 - 2020-11-30 + +This release is the first "MVP" version of this tool. It can do basic task operations, and supports a synchronization. Major missing features are captured in issues, but briefly: + + better command-line API, similar to TaskWarrior + authentication of the replica / server protocol + encryption of replica data before transmission to the server + lots of task features (tags, annotations, dependencies, ..) + lots of CLI features (filtering, modifying, ..) diff --git a/scripts/changelog.py b/scripts/changelog.py new file mode 100755 index 000000000..5775d99c0 --- /dev/null +++ b/scripts/changelog.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +import os +import argparse +import datetime +import subprocess +from typing import List + +def ymd(): + return datetime.datetime.now().strftime("%Y-%m-%d") + +def git_current_branch() -> str : + out = subprocess.check_output(["git", "branch", "--show-current"]) + return out.strip().decode("utf-8") + +def get_dir() -> str: + here = os.path.dirname(os.path.abspath(__file__)) + return os.path.join( + here, + "../.changelogs") + +def get_changefiles() -> List[str]: + changedir = get_dir() + changefiles = [] + for f in os.listdir(changedir): + if f.endswith(".txt") and not f.startswith("."): + changefiles.append(os.path.join(changedir, f)) + + return changefiles + +def cmd_add(args): + text = args.text.strip() + if not text.startswith("- "): + text = "- %s" % text + + timestamp = ymd() + branchname = git_current_branch() + fname = os.path.join(get_dir(), "%s-%s.txt" % (timestamp, branchname)) + with open(fname, "a") as f: + f.write(text) + f.write("\n") + +def cmd_build(args): + print("## x.y.z - %s" % (ymd())) + for e in get_changefiles(): + print(open(e).read().strip()) + +def main() -> None: + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers(title='Sub commands', dest='command') + subparsers.required = True + + parser_add = subparsers.add_parser('add') + parser_add.add_argument("text") + parser_add.set_defaults(func=cmd_add) + + parser_build = subparsers.add_parser('build') + parser_build.set_defaults(func=cmd_build) + + args = parser.parse_args() + args.func(args) + + +if __name__ == "__main__": + main() From e8a4d8029b961daf6a1eefc95e8992fb27eba7c9 Mon Sep 17 00:00:00 2001 From: dbr Date: Thu, 26 Aug 2021 19:56:53 +1000 Subject: [PATCH 2/3] Update contribute+release docs regarding changelog --- .changelogs/.gitignore | 0 CONTRIBUTING.md | 24 +++++++++++++++++++----- RELEASING.md | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changelogs/.gitignore diff --git a/.changelogs/.gitignore b/.changelogs/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568878926..658c0957f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,10 @@ It also means that things are changing quickly, and lots of stuff is planned tha If you would like to work on TaskChampion, please contact the developers (via the issue tracker) before spending a lot of time working on a pull request. Doing so may save you some wasted time and frustration! +A good starting point might be one of the issues tagged with ["good first issue"][first]. + +[first]: https://github.com/taskchampion/taskchampion/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 + # Other Ways To Help The best way to help this project to grow is to help spread awareness of it. @@ -15,7 +19,6 @@ Tell your friends, post to social media, blog about it -- whatever works best! Other ideas; * Improve the documentation where it's unclear or lacking some information * Build and maintain tools that integrate with TaskChampion - * Devise a nice TaskChampion logo # Development Guide @@ -44,8 +47,19 @@ You may be able to limit the scope of what you need to understand to just one cr You can generate the documentation for the `taskchampion` crate with `cargo doc --release --open -p taskchampion`. - ## Making a Pull Request +## Making a Pull Request - We expect contributors to follow the [GitHub Flow](https://guides.github.com/introduction/flow/). - Aside from that, we have no particular requirements on pull requests. - Make your patch, double-check that it's complete (tests? docs? documentation comments?), and make a new pull request. +We expect contributors to follow the [GitHub Flow](https://guides.github.com/introduction/flow/). +Aside from that, we have no particular requirements on pull requests. +Make your patch, double-check that it's complete (tests? docs? documentation comments?), and make a new pull request. + +Any non-trivial change (particularly those that change the behaviour of the application, or change the API) should be noted in the projects changelog. +In order to manage this, changelog entries are stored as text files in the `.changelog/` directory at the repository root. + +To add a new changelog entry, you can simply run `python3 ./script/changelog.py add "Fixed thingo to increase zorbloxification [Issue #2](http://example.com)` + +This creates a file named `./changelogs/yyyy-mm-dd-branchname.txt` (timestamp, current git branch) which contains a markdown snippet. + +If you don't have a Python 3 intepreter installed, you can simply create this file manually. It should contain a list item like `- Fixed thingo [...]` + +Periodically (probably just before release), these changelog entries are concatenated combined together and added into the `CHANGELOG.md` file. diff --git a/RELEASING.md b/RELEASING.md index e58e51da7..3617abd76 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,5 +1,6 @@ # Release process +1. Ensure the changelog is updated with everything from the `.changelogs` directory. `python3 ./script/changelog.py build` will output a Markdown snippet to include in `CHANGELOG.md` then `rm .changelog/*.txt` 1. Run `git pull upstream main` 1. Run `cargo test` 1. Run `cargo clean && cargo clippy` From 8ca7f70cef5e094c034043abe447d78eaf78d942 Mon Sep 17 00:00:00 2001 From: dbr Date: Sun, 5 Sep 2021 17:02:48 +1000 Subject: [PATCH 3/3] Store changelog snippets as .md --- CONTRIBUTING.md | 2 +- scripts/changelog.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 658c0957f..2adfeba3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,7 +58,7 @@ In order to manage this, changelog entries are stored as text files in the `.cha To add a new changelog entry, you can simply run `python3 ./script/changelog.py add "Fixed thingo to increase zorbloxification [Issue #2](http://example.com)` -This creates a file named `./changelogs/yyyy-mm-dd-branchname.txt` (timestamp, current git branch) which contains a markdown snippet. +This creates a file named `./changelogs/yyyy-mm-dd-branchname.md` (timestamp, current git branch) which contains a markdown snippet. If you don't have a Python 3 intepreter installed, you can simply create this file manually. It should contain a list item like `- Fixed thingo [...]` diff --git a/scripts/changelog.py b/scripts/changelog.py index 5775d99c0..0eac4fa35 100755 --- a/scripts/changelog.py +++ b/scripts/changelog.py @@ -22,7 +22,7 @@ def get_changefiles() -> List[str]: changedir = get_dir() changefiles = [] for f in os.listdir(changedir): - if f.endswith(".txt") and not f.startswith("."): + if f.endswith(".md") and not f.startswith("."): changefiles.append(os.path.join(changedir, f)) return changefiles @@ -34,7 +34,7 @@ def cmd_add(args): timestamp = ymd() branchname = git_current_branch() - fname = os.path.join(get_dir(), "%s-%s.txt" % (timestamp, branchname)) + fname = os.path.join(get_dir(), "%s-%s.md" % (timestamp, branchname)) with open(fname, "a") as f: f.write(text) f.write("\n")