diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 34d7b40a88..501aa6784a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,6 +5,6 @@ - [ ] Changes has been tested on an Android device or Android emulator with API 21 - [ ] UI change has been tested on both light and dark themes - [ ] Pull request is based on the develop branch -- [ ] Pull request updates [CHANGES.md](https://github.com/vector-im/element-android/blob/develop/CHANGES.md) +- [ ] Pull request includes a new file under ./newsfragment. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog - [ ] Pull request includes screenshots or videos if containing UI changes - [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.md#sign-off) diff --git a/CHANGES.md b/CHANGES.md index a28b84410e..97beae1dbe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1379,36 +1379,3 @@ Changes in RiotX 0.1.0 (2019-07-11) First release! Mode details here: https://medium.com/@RiotChat/introducing-the-riotx-beta-for-android-b17952e8f771 - - -======================================================= -+ TEMPLATE WHEN PREPARING A NEW RELEASE + -======================================================= - - -Changes in Element 1.1.X (2021-XX-XX) -=================================================== - -Features ✨: - - - -Improvements 🙌: - - - -Bugfix 🐛: - - - -Translations 🗣: - - - -SDK API changes ⚠️: - - - -Build 🧱: - - - -Test: - - - -Other changes: - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd32991051..4b61777d3f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,9 +51,21 @@ If an issue does not exist yet, it may be relevant to open a new issue and let u This project is full Kotlin. Please do not write Java classes. -### CHANGES.md +### Changelog -Please add a line to the top of the file `CHANGES.md` describing your change. +Please create at least one file under ./newsfragment containing details about your change. Towncrier will be used when preparing the release. + +Towncrier says to use the PR number for the filename, but the issue number is also fine. + +Supported filename extensions are: + +- ``.feature``: Signifying a new feature in Element Android or in the Matrix SDK. +- ``.bugfix``: Signifying a bug fix. +- ``.doc``: Signifying a documentation improvement. +- ``.removal``: Signifying a deprecation or removal of public API. Can be used to notifying about API change in the Matrix SDK +- ``.misc``: A ticket has been closed, but it is not of interest to users. Note that in this case, the content of the file will not be output, but just the issue/PR number. + +See https://github.com/twisted/towncrier#news-fragments if you need more details. ### Code quality diff --git a/newsfragment/3293.misc b/newsfragment/3293.misc new file mode 100644 index 0000000000..66de1440e7 --- /dev/null +++ b/newsfragment/3293.misc @@ -0,0 +1 @@ +Setup towncrier tool \ No newline at end of file diff --git a/tools/towncrier/template.md b/tools/towncrier/template.md new file mode 100644 index 0000000000..fd160682b5 --- /dev/null +++ b/tools/towncrier/template.md @@ -0,0 +1,47 @@ +{% if top_line %} +{{ top_line }} +{{ top_underline * ((top_line)|length)}} +{% elif versiondata.name %} +{{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }}) +{{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}} +{% else %} +{{ versiondata.version }} ({{ versiondata.date }}) +{{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}} +{% endif %} +{% for section, _ in sections.items() %} +{% set underline = underlines[0] %}{% if section %}{{section}} +{{ underline * section|length }}{% set underline = underlines[1] %} +{% endif %} + +{% if sections[section] %} +{% for category, val in definitions.items() if category in sections[section]%} +{% if definitions[category]['name'] == "Features" %} +Features ✨: +{% elif definitions[category]['name'] == "Bugfixes" %} +Bugfixes 🐛: +{% elif definitions[category]['name'] == "Deprecations and Removals" %} +SDK API changes ⚠️: +{% elif definitions[category]['name'] == "Improved Documentation" %} +Improved Documentation 📚: +{% elif definitions[category]['name'] == "Misc" %} +Other changes: +{% else %} +{{ definitions[category]['name'] }} +{% endif %} +{% if definitions[category]['showcontent'] %} +{% for text, values in sections[section][category].items() %} + - {{ text }} ({{ values|join(', ') }}) +{% endfor %} +{% else %} + - {{ sections[section][category]['']|join(', ') }} +{% endif %} +{% if sections[section][category]|length == 0 %} +No significant changes. +{% else %} +{% endif %} + +{% endfor %} +{% else %} +No significant changes. +{% endif %} +{% endfor %} diff --git a/tools/travis/check_pr.sh b/tools/travis/check_pr.sh index 4c0d9611f0..b797244e55 100755 --- a/tools/travis/check_pr.sh +++ b/tools/travis/check_pr.sh @@ -23,7 +23,7 @@ branch=${TRAVIS_BRANCH} # If not on develop, exit, else we cannot get the list of modified files # It is ok to check only when on develop branch if [[ "${branch}" -eq 'develop' ]]; then - echo "Check that the file 'CHANGES.md' has been modified" + echo "Check that a file has been added to /newsfragment" else echo "Not on develop branch" exit 0 @@ -37,9 +37,9 @@ listOfModifiedFiles=`git diff --name-only HEAD ${branch}` # echo ${listOfModifiedFiles} -if [[ ${listOfModifiedFiles} = *"CHANGES.md"* ]]; then - echo "CHANGES.md has been modified!" +if [[ ${listOfModifiedFiles} = *"newsfragment"* ]]; then + echo "A file has been added to /newsfragment!" else - echo "❌ Please add a line describing your change in CHANGES.md" + echo "❌ Please add a file describing your changes in /newsfragment. See https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog" exit 1 fi diff --git a/towncrier.toml b/towncrier.toml new file mode 100644 index 0000000000..09a927b77f --- /dev/null +++ b/towncrier.toml @@ -0,0 +1,7 @@ +[tool.towncrier] +directory = "newsfragment" +filename = "CHANGES.md" +name = "Changes in Element" +# Note: there is a bug, if I use title_format, the title is printed twice +# title_format = "Changes in Element {version} ({project_date})" +template="tools/towncrier/template.md"