Skip to content

Commit 2a2f1e6

Browse files
committed
Add support for 'moveable_tags' configuration option
This update introduces a new 'moveable_tags' field in the configuration model, with appropriate defaults. Test fixture files have been updated to reflect this change. This allows better handling of tags that can be relocated during versioning operations.
1 parent dd1efa5 commit 2a2f1e6

File tree

8 files changed

+552
-0
lines changed

8 files changed

+552
-0
lines changed

docs/assets/moving-tags.drawio

+166
Large diffs are not rendered by default.

docs/assets/moving-tags.pdf

20 KB
Binary file not shown.

docs/assets/moving-tags.svg

+1
Loading
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Moveable version tags
2+
3+
While controversial, [several platforms](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) recommend providing moving "release bindings."
4+
These release bindings are tags that represent the latest revision of a version component.
5+
For example, a tag of `v1` is similar to specifying a dependency of `>=1.0.0 <2.0.0`.
6+
A tag of `v1.1` is similar to specifying a dependency of `>=1.1.0 <1.2.0`.
7+
8+
Bump My Version's stance is to provide unique, immutable release tags when tagging is enabled as its default behavior.
9+
"Moving" tags are an optional choice and will work in addition to the default behavior.
10+
11+
## How they work
12+
13+
- The `moving_tags` configuration is a list of serialization strings.
14+
- All strings are serialized
15+
- Each string is forcibly tagged (as a lightweight, non-annotated tag) and forcibly pushed to origin.
16+
17+
18+
## Configuration
19+
20+
```toml
21+
moving_tags = [
22+
"latest",
23+
"v{major}.{minor}.{patch}",
24+
"v{major}.{minor}",
25+
"v{major}"
26+
]
27+
```
28+
29+
## Example
30+
31+
![](../assets/moving-tags.svg)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{{ log.debug("Rendering attributes section") }}
2+
3+
{% import "language.html" as lang with context %}
4+
5+
{% if config.docstring_section_style == "table" %}
6+
{% block table_style scoped %}
7+
<p><strong>{{ section.title or lang.t("Attributes:") }}</strong></p>
8+
<table>
9+
<thead>
10+
<tr>
11+
<th>{{ lang.t("Name") }}</th>
12+
<th>{{ lang.t("Type") }}</th>
13+
<th>{{ lang.t("Description") }}</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
{% for attribute in section.value %}
18+
<tr>
19+
<td><code><span data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</span></code></td>
20+
<td>
21+
{% if attribute.annotation %}
22+
{% with expression = attribute.annotation %}
23+
<code>{% include "expression.html" with context %}</code>
24+
{% endwith %}
25+
{% endif %}
26+
</td>
27+
<td>
28+
<div class="doc-md-description">
29+
{{ attribute.description|convert_markdown(heading_level, html_id) }}
30+
</div>
31+
</td>
32+
</tr>
33+
{% endfor %}
34+
</tbody>
35+
</table>
36+
{% endblock table_style %}
37+
{% elif config.docstring_section_style == "list" %}
38+
{% block list_style scoped %}
39+
<p>{{ section.title or lang.t("Attributes:") }}</p>
40+
<ul>
41+
{% for attribute in section.value %}
42+
<li class="field-body">
43+
<b><code><span data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</span></code></b>
44+
{% if attribute.annotation %}
45+
{% with expression = attribute.annotation %}
46+
(<code>{% include "expression.html" with context %}</code>)
47+
{% endwith %}
48+
{% endif %}
49+
50+
<div class="doc-md-description">
51+
{{ attribute.description|convert_markdown(heading_level, html_id) }}
52+
</div>
53+
</li>
54+
{% endfor %}
55+
</ul>
56+
{% endblock list_style %}
57+
{% elif config.docstring_section_style == "spacy" %}
58+
{% block spacy_style scoped %}
59+
<table>
60+
<thead>
61+
<tr>
62+
<th><b>{{ (section.title or lang.t("ATTRIBUTE")).rstrip(":").upper() }}</b></th>
63+
<th><b>{{ lang.t("DESCRIPTION") }}</b></th>
64+
</tr>
65+
</thead>
66+
<tbody>
67+
{% for attribute in section.value %}
68+
<tr>
69+
<td><code><span data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</span></code></td>
70+
<td class="doc-attribute-details">
71+
<div class="doc-md-description">
72+
{{ attribute.description|convert_markdown(heading_level, html_id) }}
73+
</div>
74+
<p>
75+
{% if attribute.annotation %}
76+
<span class="doc-attribute-annotation">
77+
<b>TYPE:</b>
78+
{% with expression = attribute.annotation %}
79+
<code>{% include "expression.html" with context %}</code>
80+
{% endwith %}
81+
</span>
82+
{% endif %}
83+
</p>
84+
</td>
85+
</tr>
86+
{% endfor %}
87+
</tbody>
88+
</table>
89+
{% endblock spacy_style %}
90+
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{{ log.debug("Rendering parameters section") }}
2+
3+
{% import "language.html" as lang with context %}
4+
5+
{% if config.docstring_section_style == "table" %}
6+
{% block table_style scoped %}
7+
<p><strong>{{ section.title or lang.t("Parameters:") }}</strong></p>
8+
<table>
9+
<thead>
10+
<tr>
11+
<th>{{ lang.t("Name") }}</th>
12+
<th>{{ lang.t("Type") }}</th>
13+
<th>{{ lang.t("Description") }}</th>
14+
<th>{{ lang.t("Default") }}</th>
15+
</tr>
16+
</thead>
17+
<tbody>
18+
{% for parameter in section.value %}
19+
<tr>
20+
<td><code>{{ parameter.name }}</code></td>
21+
<td>
22+
{% if parameter.annotation %}
23+
{% with expression = parameter.annotation %}
24+
<code>{% include "expression.html" with context %}</code>
25+
{% endwith %}
26+
{% endif %}
27+
</td>
28+
<td>
29+
<div class="doc-md-description">
30+
{{ parameter.description|convert_markdown(heading_level, html_id) }}
31+
</div>
32+
</td>
33+
<td>
34+
{% if parameter.default %}
35+
{% with expression = parameter.default %}
36+
<code>{% include "expression.html" with context %}</code>
37+
{% endwith %}
38+
{% else %}
39+
<em>{{ lang.t("required") }}</em>
40+
{% endif %}
41+
</td>
42+
</tr>
43+
{% endfor %}
44+
</tbody>
45+
</table>
46+
{% endblock table_style %}
47+
{% elif config.docstring_section_style == "list" %}
48+
{% block list_style scoped %}
49+
<p class="doc-section-head">{{ section.title or lang.t("Parameters:") }}</p>
50+
<ul>
51+
{% for parameter in section.value %}
52+
<li class="field-body">
53+
<b><code>{{ parameter.name }}</code></b>
54+
{% if parameter.annotation %}
55+
{% with expression = parameter.annotation %}
56+
(<code>{% include "expression.html" with context %}</code>
57+
{%- if parameter.default %}, {{ lang.t("default:") }}
58+
{% with expression = parameter.default %}
59+
<code>{% include "expression.html" with context %}</code>
60+
{% endwith %}
61+
{% endif %})
62+
{% endwith %}
63+
{% endif %}
64+
65+
<div class="doc-md-description">
66+
{{ parameter.description|convert_markdown(heading_level, html_id) }}
67+
</div>
68+
</li>
69+
{% endfor %}
70+
</ul>
71+
{% endblock list_style %}
72+
{% elif config.docstring_section_style == "spacy" %}
73+
{% block spacy_style scoped %}
74+
<p class="doc-section-head">{{ section.title or lang.t("Parameters:") }}</p>
75+
<dl class="doc-field-list">
76+
{% for parameter in section.value %}
77+
<dt class="doc-field-term"><code>{{ parameter.name }}</code></dt>
78+
<dd class="doc-field-def">
79+
<div class="doc-md-description">
80+
{{ parameter.description|convert_markdown(heading_level, html_id) }}
81+
</div>
82+
{% if parameter.annotation %}<p class="doc-param-annotation">
83+
<span class="doc-param-key">{{ lang.t("TYPE:") }}</span>
84+
{% with expression = parameter.annotation %}
85+
<code>{% include "expression.html" with context %}</code>
86+
{% endwith %}
87+
</p>{% endif %}
88+
{% if parameter.default %}<p class="doc-param-default">
89+
<span class="doc-param-key">{{ lang.t("DEFAULT:") }}</span>
90+
{% with expression = parameter.default %}
91+
<code>{% include "expression.html" with context %}</code>
92+
{% endwith %}
93+
</p>{% endif %}
94+
</dd>
95+
{% endfor %}
96+
</dl>
97+
{% endblock spacy_style %}
98+
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{ log.debug("Rendering raises section") }}
2+
3+
{% import "language.html" as lang with context %}
4+
5+
{% if config.docstring_section_style == "table" %}
6+
{% block table_style scoped %}
7+
<p><strong>{{ section.title or lang.t("Raises:") }}</strong></p>
8+
<table>
9+
<thead>
10+
<tr>
11+
<th>{{ lang.t("Type") }}</th>
12+
<th>{{ lang.t("Description") }}</th>
13+
</tr>
14+
</thead>
15+
<tbody>
16+
{% for raises in section.value %}
17+
<tr>
18+
<td>
19+
{% if raises.annotation %}
20+
{% with expression = raises.annotation %}
21+
<code>{% include "expression.html" with context %}</code>
22+
{% endwith %}
23+
{% endif %}
24+
</td>
25+
<td>
26+
<div class="doc-md-description">
27+
{{ raises.description|convert_markdown(heading_level, html_id) }}
28+
</div>
29+
</td>
30+
</tr>
31+
{% endfor %}
32+
</tbody>
33+
</table>
34+
{% endblock table_style %}
35+
{% elif config.docstring_section_style == "list" %}
36+
{% block list_style scoped %}
37+
<p>{{ lang.t(section.title) or lang.t("Raises:") }}</p>
38+
<ul>
39+
{% for raises in section.value %}
40+
<li class="field-body">
41+
{% if raises.annotation %}
42+
{% with expression = raises.annotation %}
43+
<code>{% include "expression.html" with context %}</code>
44+
{% endwith %}
45+
46+
{% endif %}
47+
<div class="doc-md-description">
48+
{{ raises.description|convert_markdown(heading_level, html_id) }}
49+
</div>
50+
</li>
51+
{% endfor %}
52+
</ul>
53+
{% endblock list_style %}
54+
{% elif config.docstring_section_style == "spacy" %}
55+
{% block spacy_style scoped %}
56+
<p class="doc-section-head">{{ (section.title or lang.t("Raises:")) }}</p>
57+
<dl class="doc-field-list">
58+
{% for raises in section.value %}
59+
<dt class="doc-field-term doc-raises-annotation">
60+
{% with expression = raises.annotation %}
61+
<code>{% include "expression.html" with context %}</code>
62+
{% endwith %}
63+
</dt>
64+
<dd class="doc-field-def doc-raises-details">
65+
<div class="doc-md-description">
66+
{{ raises.description|convert_markdown(heading_level, html_id) }}
67+
</div>
68+
</dd>
69+
{% endfor %}
70+
</dl>
71+
{% endblock spacy_style %}
72+
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{{ log.debug("Rendering returns section") }}
2+
3+
{% import "language.html" as lang with context %}
4+
5+
{% if config.docstring_section_style == "table" %}
6+
{% block table_style scoped %}
7+
{% set name_column = section.value|selectattr("name")|any %}
8+
<p><strong>{{ section.title or lang.t("Returns:") }}</strong></p>
9+
<table>
10+
<thead>
11+
<tr>
12+
{% if name_column %}<th>{{ lang.t("Name") }}</th>{% endif %}
13+
<th>{{ lang.t("Type") }}</th>
14+
<th>{{ lang.t("Description") }}</th>
15+
</tr>
16+
</thead>
17+
<tbody>
18+
{% for returns in section.value %}
19+
<tr>
20+
{% if name_column %}<td>{% if returns.name %}<code>{{ returns.name }}</code>{% endif %}</td>{% endif %}
21+
<td>
22+
{% if returns.annotation %}
23+
{% with expression = returns.annotation %}
24+
<code>{% include "expression.html" with context %}</code>
25+
{% endwith %}
26+
{% endif %}
27+
</td>
28+
<td>
29+
<div class="doc-md-description">
30+
{{ returns.description|convert_markdown(heading_level, html_id) }}
31+
</div>
32+
</td>
33+
</tr>
34+
{% endfor %}
35+
</tbody>
36+
</table>
37+
{% endblock table_style %}
38+
{% elif config.docstring_section_style == "list" %}
39+
{% block list_style scoped %}
40+
<p>{{ section.title or lang.t("Returns:") }}</p>
41+
<ul>
42+
{% for returns in section.value %}
43+
<li class="field-body">
44+
{% if returns.name %}<b><code>{{ returns.name }}</code></b>{% endif %}
45+
{% if returns.annotation %}
46+
{% with expression = returns.annotation %}
47+
{% if returns.name %} ({% endif %}
48+
<code>{% include "expression.html" with context %}</code>
49+
{% if returns.name %}){% endif %}
50+
{% endwith %}
51+
{% endif %}
52+
53+
<div class="doc-md-description">
54+
{{ returns.description|convert_markdown(heading_level, html_id) }}
55+
</div>
56+
</li>
57+
{% endfor %}
58+
</ul>
59+
{% endblock list_style %}
60+
{% elif config.docstring_section_style == "spacy" %}
61+
{% block spacy_style scoped %}
62+
<p class="doc-section-head">{{ (section.title or lang.t("Returns:")) }}</p>
63+
<dl class="doc-field-list">
64+
{% for returns in section.value %}
65+
<dt class="doc-field-term">
66+
{% if returns.name %}
67+
<code>{{ returns.name }}</code>
68+
{% elif returns.annotation %}
69+
<span class="doc-returns-annotation">
70+
{% with expression = returns.annotation %}
71+
<code>{% include "expression.html" with context %}</code>
72+
{% endwith %}
73+
</span>
74+
{% endif %}
75+
</dt>
76+
<dd class="doc-field-def doc-returns-details">
77+
<div class="doc-md-description">
78+
{{ returns.description|convert_markdown(heading_level, html_id) }}
79+
</div>
80+
{% if returns.name and returns.annotation %}
81+
<p>
82+
<span class="doc-returns-annotation">
83+
<span class="doc-param-key">{{ lang.t("TYPE:") }}</span>
84+
{% with expression = returns.annotation %}
85+
<code>{% include "expression.html" with context %}</code>
86+
{% endwith %}
87+
</span>
88+
</p>
89+
{% endif %}
90+
</dd>
91+
{% endfor %}
92+
</dl>
93+
{% endblock spacy_style %}
94+
{% endif %}

0 commit comments

Comments
 (0)