Skip to content

Commit 951aee4

Browse files
committed
Add framework for "proclamation"-based changelog fragments.
1 parent 41603b7 commit 951aee4

File tree

6 files changed

+168
-0
lines changed

6 files changed

+168
-0
lines changed

.proclamation.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"#": "This is a config file for proclamation, the changelog combiner: https://gitlab.com/ryanpavlik/proclamation",
3+
"projects": [
4+
{
5+
"project_name": "OpenXR SDK",
6+
"news_filename": "CHANGELOG.SDK.md",
7+
"template": "changes/template.md",
8+
"sections": {
9+
"Registry": {
10+
"directory": "changes/registry"
11+
},
12+
"SDK": {
13+
"directory": "changes/sdk"
14+
}
15+
}
16+
},
17+
{
18+
"project_name": "OpenXR Specification",
19+
"news_filename": "CHANGELOG.Docs.md",
20+
"template": "changes/template.md",
21+
"sections": {
22+
"Registry": {
23+
"directory": "changes/registry"
24+
},
25+
"Specification": {
26+
"directory": "changes/specification"
27+
}
28+
}
29+
}
30+
]
31+
}

changes/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Changelog Fragments
2+
3+
The OpenXR specification editor uses the "proclamation" package to assemble
4+
changelogs for each public release, which incorporate fragments of changelog
5+
text added by the author of a change in one of these directories.
6+
7+
If you want to preview the changelog or perform a release, you can run a command
8+
like the following to install it locally:
9+
10+
```sh
11+
pip3 install proclamation
12+
```
13+
14+
See <https://gitlab.com/ryanpavlik/proclamation> for more details on *proclamation*.
15+
16+
## Fragments
17+
18+
Each change should add a changelog fragment file, whose contents are
19+
Markdown-formatted text describing the change briefly. Reference metadata will
20+
be used to automatically add links to associated issues/merge requests/pull
21+
requests, so no need to add these in your fragment text.
22+
23+
## References
24+
25+
The changelog fragment system revolves around "references" - these are issue
26+
reports, public pull requests, or private pull requests associated with a
27+
change. Each fragment must have at least one of these, which forms the main part
28+
of the filename. If applicable, additional can be added within the file - see
29+
below for details.
30+
31+
The format of references for internal issues/MRs is:
32+
33+
```txt
34+
<ref_type>.<number>.gl
35+
```
36+
37+
where
38+
39+
- `ref_type` is "issue" or "mr"
40+
- `number` is the issue or MR number
41+
- `gl` refers to internal GitLab.
42+
43+
The format of references for public (GitHub) issues/pull requests is:
44+
45+
```txt
46+
<ref_type>.<number>.gh.<repo_name>
47+
```
48+
49+
where
50+
51+
- `ref_type` is "issue" or "pr"
52+
- `number` is the issue or PR number
53+
- `gh` refers to public GitHub
54+
- `repo_name` is the repository name: one of "OpenXR-Docs", "OpenXR-SDK-Source",
55+
etc.
56+
57+
Your changelog fragment filename is simply the "main" reference with the `.md`
58+
extension added.
59+
60+
To specify additional references in a file, prefix the contents of the changelog
61+
fragment with a block delimited above and below by `---`, with one reference on
62+
each line. (This can be seen as a very minimal subset of "YAML Front Matter", if
63+
you're familiar with that concept.) For example:
64+
65+
```md
66+
---
67+
- issue.35.gl
68+
- mr.93.gl
69+
---
70+
Your changelog fragment text goes here.
71+
```

changes/registry/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Registry Changes
2+
3+
Please create changelog fragments in this directory for changes that affect the
4+
`xr.xml` registry. These fragments will be included in both the docs and SDK
5+
changelogs.
6+
7+
See the README.md in the parent directory for information on the format and
8+
naming of changelog fragment files.

changes/sdk/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SDK Changes
2+
3+
Please create changelog fragments in this directory for changes that affect
4+
SDK code only. These fragments will only be applied to the
5+
SDK changelog.
6+
7+
See the README.md in the parent directory for information on the format and
8+
naming of changelog fragment files.

changes/specification/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Specification Changes
2+
3+
Please create changelog fragments in this directory for changes that affect
4+
specification text only. These fragments will only be applied to the
5+
specification changelog.
6+
7+
See the README.md in the parent directory for information on the format and
8+
naming of changelog fragment files.

changes/template.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{% macro format_ref(ref) -%}
2+
{%- set service = ref.service_params[0] -%}
3+
{%- if ref.ref_service == "gh" -%}
4+
{%- set project = ref.service_params[1] %}
5+
{%- set project_base = "https://github.com/KhronosGroup/" + project %}
6+
{%- set link_text %}{{ project }}/#{{ ref.number }}{% endset %}
7+
{%- if ref.item_type == "issue" -%}
8+
{%- set subdir = "issues" %}
9+
{%- else -%}
10+
{%- set subdir = "pull" %}
11+
{%- endif -%}
12+
{%- else -%}
13+
{%- set project_base = "https://gitlab.khronos.org/openxr/openxr" %}
14+
{%- if ref.item_type == "issue" -%}
15+
{%- set link_text %}internal issue {{ ref.number }}{% endset %}
16+
{%- set subdir = "issues" %}
17+
{%- else -%}
18+
{%- set link_text %}internal MR {{ ref.number }}{% endset %}
19+
{%- set subdir = "merge_requests" %}
20+
{%- endif -%}
21+
{%- endif -%}
22+
[{{ link_text }}]({{project_base}}/{{subdir}}/{{ ref.number }})
23+
{%- endmacro -%}
24+
{% macro format_refs(refs) -%}
25+
{%- if (refs | length) > 0 -%}
26+
{%- set comma = joiner(", ") -%}
27+
{% for ref in refs -%}
28+
{{comma()}}{{format_ref(ref)}}
29+
{%- endfor %}
30+
{%- endif %}
31+
{%- endmacro -%}
32+
{% block title %}## {{ project_name }} {{project_version}} ({{date}}){% endblock %}
33+
34+
{% for section in sections %}
35+
- {{ section.name }}
36+
{%- for chunk in section.chunks %}{% set rawtext %}{{ chunk.text }} ({{format_refs(chunk.refs)}}){% endset %}
37+
- {{ rawtext | wordwrap | indent }}
38+
{%- else %}
39+
- No significant changes
40+
{% endfor -%}
41+
{% endfor %}
42+

0 commit comments

Comments
 (0)