Skip to content

Commit

Permalink
Merge pull request #1645 from oasisprotocol/mz/release/changeLogFragm…
Browse files Browse the repository at this point in the history
…ents

Init Change Log fragments
  • Loading branch information
buberdds authored Oct 18, 2023
2 parents 3fb5299 + d544d99 commit 27a3d1f
Show file tree
Hide file tree
Showing 9 changed files with 1,026 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .changelog/.markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# markdownlint configuration for Change Log fragments.

# For more information, see:
# https://github.com/DavidAnson/markdownlint#optionsconfig.

# Extend project's main configuration.
extends: ../.markdownlint.yml

line-length:
# Line length checking is not strict by default.
strict: true
# Change Log fragments will be listed as bullets indented by 2 spaces so they
# should be 2 characters shorter than ordinary lines.
line_length: 78

# Change Log fragments should not have a heading as the first line.
first-line-heading: false

ul-style:
# Enforce a uniform symbol for unordered lists across all Change Log
# fragments.
style: dash
8 changes: 8 additions & 0 deletions .changelog/1645.process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Add Change Log and the Change Log fragments process for assembling it

This follows the same Change Log fragments process as is used by [Oasis Core].

For more details, see [Change Log fragments].

[Oasis Core]: https://github.com/oasisprotocol/oasis-core
[Change Log fragments]: .changelog/README.md
16 changes: 16 additions & 0 deletions .changelog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Change Log Fragments

This directory collects Change Log fragments:
short files that each contain a snippet of Markdown formatted text that will
be assembled using [towncrier] to form the [Change Log] section for the next
release.

This repository follows the same Change Log fragments style as the
[Oasis Core] repository.
Please, see [its Change Log fragments documentation] for more details.

[Change Log]: ../CHANGELOG.md
[towncrier]: https://github.com/oasisprotocol/towncrier
[Oasis Core]: https://github.com/oasisprotocol/oasis-core
[its Change Log fragments documentation]:
https://github.com/oasisprotocol/oasis-core/blob/master/.changelog/README.md
39 changes: 39 additions & 0 deletions .changelog/template.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{# This a Jinja2 template for preparing a new section of the Change Log with the towncrier utility.#}
## {{ versiondata.version }} ({{ versiondata.date }})
{% for section, _ in sections.items() %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section] %}
{% if definitions[category]['showcontent'] %}
{{ "### " + definitions[category]['name'] }}

{% for text, values in sections[section][category].items() %}
{% set lines = text.splitlines() %}
{% set referenced_issues = "(" + values | join(',\n ') + ")" %}
{% if lines | length > 2 and lines[1] == "" %}
- {{ lines[0] }}
{{ referenced_issues }}

{{ lines[2:] | join('\n') }}
{% else %}
- {{ text }}
{{ referenced_issues }}
{% endif %}
{% if not loop.last %}

{% endif %}
{% endfor %}
{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
{% endfor %}
22 changes: 20 additions & 2 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,34 @@ jobs:
with:
node-version: '18.x'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install gitlint
run: |
python -m pip install gitlint
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install towncrier
run: |
python -m pip install https://github.com/oasisprotocol/towncrier/archive/oasis-master.tar.gz
- name: Check for presence of a Change Log fragment (only pull requests)
# NOTE: The pull request' base branch needs to be fetched so towncrier
# is able to compare the current branch with the base branch.
# Source: https://github.com/actions/checkout/#fetch-all-branches.
run: |
git fetch --no-tags origin "+refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}"
towncrier check --compare-with "origin/${BASE_BRANCH}"
env:
BASE_BRANCH: ${{ github.base_ref }}
if: github.event_name == 'pull_request'
- name: Lint documentation
run: |
yarn lint-docs
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Lint Change Log fragments
run: |
yarn lint-changelog
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Lint git commits
run: |
yarn lint-git
Expand Down
Loading

0 comments on commit 27a3d1f

Please sign in to comment.