Skip to content

Commit 9e405b4

Browse files
committed
🚀 releasing version 2.10.1 @ 2022-12-21 12:47
[skip ci]
1 parent bc2aa3a commit 9e405b4

File tree

11 files changed

+100
-47
lines changed

11 files changed

+100
-47
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ This project was forked from version 1.7.4 of [mbed-tools-ci-scripts](https://gi
1717

1818
[//]: # (begin_release_notes)
1919

20+
"2.10.1" (2022-12-21)
21+
=====================
22+
23+
Bugfixes
24+
--------
25+
26+
- Dependency upgrade: scorecard-action-2.1.1 (#20221221071258)
27+
- Fixed shortcut tag rendering (#20221221110243)
28+
29+
2030
"2.10.0" (2022-12-20)
2131
=====================
2232

continuous_delivery_scripts/_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
1111
This file is autogenerated, do not modify by hand.
1212
"""
13-
__version__ = "2.10.0"
14-
COMMIT = "81da18232dcce84409b0fd8202f2f2d099503153"
13+
__version__ = "2.10.1"
14+
COMMIT = "bc2aa3a40ad89787d7851800c67521e32b031f3b"
1515
MAJOR = 2
1616
MINOR = 10
17-
PATCH = 0
17+
PATCH = 1

docs/plugins/ci.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.plugins.ci</code></h1
3838
&#34;&#34;&#34;Plugin for CI projects.&#34;&#34;&#34;
3939
import logging
4040
from pathlib import Path
41-
from typing import Optional, List
41+
from typing import Optional, Dict
4242

4343
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
4444
from continuous_delivery_scripts.utils.configuration import configuration, ConfigurationVariable
@@ -96,7 +96,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.plugins.ci</code></h1
9696
&#34;&#34;&#34;States whether the repository must be cleaned before packaging happens.&#34;&#34;&#34;
9797
return True
9898

99-
def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
99+
def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
100100
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
101101
super().tag_release(git, version, shortcuts)</code></pre>
102102
</details>
@@ -167,7 +167,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
167167
&#34;&#34;&#34;States whether the repository must be cleaned before packaging happens.&#34;&#34;&#34;
168168
return True
169169

170-
def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
170+
def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
171171
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
172172
super().tag_release(git, version, shortcuts)</code></pre>
173173
</details>

docs/plugins/golang.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.plugins.golang</code>
3939
import logging
4040
import os
4141
from pathlib import Path
42-
from typing import Optional, List
42+
from typing import Optional, List, Dict
4343
from subprocess import check_call
4444
from continuous_delivery_scripts.utils.language_specifics_base import BaseLanguage, get_language_from_file_name
4545
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
@@ -194,7 +194,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.plugins.golang</code>
194194
&#34;&#34;&#34;States whether the repository must be cleaned before packaging happens.&#34;&#34;&#34;
195195
return True
196196

197-
def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
197+
def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
198198
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
199199
super().tag_release(git, version, shortcuts)
200200
go_tag = _determine_go_module_tag(self.get_version_tag(version))
@@ -289,7 +289,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
289289
&#34;&#34;&#34;States whether the repository must be cleaned before packaging happens.&#34;&#34;&#34;
290290
return True
291291

292-
def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
292+
def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
293293
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
294294
super().tag_release(git, version, shortcuts)
295295
go_tag = _determine_go_module_tag(self.get_version_tag(version))

docs/tag_and_release.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,16 @@ <h1 class="title">Module <code>continuous_delivery_scripts.tag_and_release</code
132132
if mode == CommitType.RELEASE:
133133
_commit_release_changes(git, version, commit_message)
134134
if is_new_version:
135-
get_language_specifics().tag_release(git, version, determine_version_shortcuts(mode, version_elements))
135+
get_language_specifics().tag_release(
136+
git,
137+
version,
138+
determine_version_shortcuts(
139+
mode,
140+
configuration.get_value(ConfigurationVariable.TAG_LATEST),
141+
configuration.get_value(ConfigurationVariable.TAG_VERSION_SHORTCUTS),
142+
version_elements,
143+
),
144+
)
136145
git.force_push_tag()
137146

138147

docs/third_party_IP_report.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</head>
6666
<body>
6767
<h1>Project's 3rd party IP report</h1>
68-
<p><i>2022-12-20 20:30:52.617239</i></p>
68+
<p><i>2022-12-21 12:47:01.943188</i></p>
6969
<h2>Summary</h2>
7070
<table>
7171
<thead>

docs/third_party_IP_report.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
3rd party IP report for continuous-delivery-scripts
22

3-
2022-12-20 20:30:52.617239
3+
2022-12-21 12:47:01.943188
44

55
# Summary:
66
Licence compliance: Not compliant

docs/utils/language_specifics_base.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.utils.language_specif
4040
import logging
4141
from abc import ABC, abstractmethod
4242
from pathlib import Path
43-
from typing import Optional, List
43+
from typing import Optional, Dict
4444

4545
from continuous_delivery_scripts.spdx_report.spdx_project import SpdxProject
4646
from continuous_delivery_scripts.utils.configuration import configuration, ConfigurationVariable
@@ -107,15 +107,15 @@ <h1 class="title">Module <code>continuous_delivery_scripts.utils.language_specif
107107
&#34;&#34;&#34;States whether the repository must be cleaned before packaging happens.&#34;&#34;&#34;
108108
return False
109109

110-
def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
110+
def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
111111
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
112112
logger.info(f&#34;Tagging commit as release {version}&#34;)
113113
git.create_tag(self.get_version_tag(version), message=f&#34;release {version}&#34;)
114-
if configuration.get_value(ConfigurationVariable.TAG_LATEST):
115-
git.create_tag(&#34;latest&#34;, message=&#34;latest release&#34;)
116-
if configuration.get_value(ConfigurationVariable.TAG_VERSION_SHORTCUTS):
117-
for shortcut in shortcuts:
114+
for shortcut, version in shortcuts.items():
115+
if version:
118116
git.create_tag(self.get_version_tag(shortcut), message=f&#34;{shortcut} release&#34;)
117+
else:
118+
git.create_tag(shortcut, message=shortcut)
119119

120120
@abstractmethod
121121
def generate_code_documentation(self, output_directory: Path, module_to_document: str) -&gt; None:
@@ -221,15 +221,15 @@ <h2 class="section-title" id="header-classes">Classes</h2>
221221
&#34;&#34;&#34;States whether the repository must be cleaned before packaging happens.&#34;&#34;&#34;
222222
return False
223223

224-
def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
224+
def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
225225
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
226226
logger.info(f&#34;Tagging commit as release {version}&#34;)
227227
git.create_tag(self.get_version_tag(version), message=f&#34;release {version}&#34;)
228-
if configuration.get_value(ConfigurationVariable.TAG_LATEST):
229-
git.create_tag(&#34;latest&#34;, message=&#34;latest release&#34;)
230-
if configuration.get_value(ConfigurationVariable.TAG_VERSION_SHORTCUTS):
231-
for shortcut in shortcuts:
228+
for shortcut, version in shortcuts.items():
229+
if version:
232230
git.create_tag(self.get_version_tag(shortcut), message=f&#34;{shortcut} release&#34;)
231+
else:
232+
git.create_tag(shortcut, message=shortcut)
233233

234234
@abstractmethod
235235
def generate_code_documentation(self, output_directory: Path, module_to_document: str) -&gt; None:
@@ -451,23 +451,23 @@ <h3>Methods</h3>
451451
</details>
452452
</dd>
453453
<dt id="continuous_delivery_scripts.utils.language_specifics_base.BaseLanguage.tag_release"><code class="name flex">
454-
<span>def <span class="ident">tag_release</span></span>(<span>self, git: <a title="continuous_delivery_scripts.utils.git_helpers.GitWrapper" href="git_helpers.html#continuous_delivery_scripts.utils.git_helpers.GitWrapper">GitWrapper</a>, version: str, shortcuts: List[str]) ‑> None</span>
454+
<span>def <span class="ident">tag_release</span></span>(<span>self, git: <a title="continuous_delivery_scripts.utils.git_helpers.GitWrapper" href="git_helpers.html#continuous_delivery_scripts.utils.git_helpers.GitWrapper">GitWrapper</a>, version: str, shortcuts: Dict[str, bool]) ‑> None</span>
455455
</code></dt>
456456
<dd>
457457
<div class="desc"><p>Tags release commit.</p></div>
458458
<details class="source">
459459
<summary>
460460
<span>Expand source code</span>
461461
</summary>
462-
<pre><code class="python">def tag_release(self, git: GitWrapper, version: str, shortcuts: List[str]) -&gt; None:
462+
<pre><code class="python">def tag_release(self, git: GitWrapper, version: str, shortcuts: Dict[str, bool]) -&gt; None:
463463
&#34;&#34;&#34;Tags release commit.&#34;&#34;&#34;
464464
logger.info(f&#34;Tagging commit as release {version}&#34;)
465465
git.create_tag(self.get_version_tag(version), message=f&#34;release {version}&#34;)
466-
if configuration.get_value(ConfigurationVariable.TAG_LATEST):
467-
git.create_tag(&#34;latest&#34;, message=&#34;latest release&#34;)
468-
if configuration.get_value(ConfigurationVariable.TAG_VERSION_SHORTCUTS):
469-
for shortcut in shortcuts:
470-
git.create_tag(self.get_version_tag(shortcut), message=f&#34;{shortcut} release&#34;)</code></pre>
466+
for shortcut, version in shortcuts.items():
467+
if version:
468+
git.create_tag(self.get_version_tag(shortcut), message=f&#34;{shortcut} release&#34;)
469+
else:
470+
git.create_tag(shortcut, message=shortcut)</code></pre>
471471
</details>
472472
</dd>
473473
</dl>

docs/utils/versioning.html

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.utils.versioning</cod
4040
import logging
4141
import os
4242
from auto_version import auto_version_tool
43-
from typing import Optional, Tuple, Dict, List
43+
from typing import Optional, Tuple, Dict
4444

4545
from continuous_delivery_scripts.utils.configuration import configuration, ConfigurationVariable
4646
from continuous_delivery_scripts.utils.definitions import CommitType
@@ -120,23 +120,36 @@ <h1 class="title">Module <code>continuous_delivery_scripts.utils.versioning</cod
120120
return new_version
121121

122122

123-
def determine_version_shortcuts(commit_type: CommitType, version_elements: Dict[str, str]) -&gt; List[str]:
123+
def determine_version_shortcuts(
124+
commit_type: CommitType, tag_latest: bool, tag_shortcut: bool, version_elements: Dict[str, str]
125+
) -&gt; Dict[str, bool]:
124126
&#34;&#34;&#34;Determine the different version shortcuts i.e. major, major.minor, pre depending on the release type.
125127

126128
Args:
127129
commit_type: commit type
130+
tag_latest: whether to tag release with `Latest`
131+
tag_shortcut: whether to set additional shortcuts
128132
version_elements: version elements
133+
134+
Returns:
135+
dict: A dictionary of shortcuts and a flag specifying
136+
whether it is a version string or bespoke shortcut such as latest
129137
&#34;&#34;&#34;
130-
shortcuts = []
138+
shortcuts = {}
139+
if commit_type == CommitType.RELEASE and tag_latest:
140+
shortcuts[&#34;latest&#34;] = False
141+
if not tag_shortcut:
142+
return shortcuts
131143
major_version = version_elements.get(auto_version_tool.definitions.SemVerSigFig.major, None)
132144
if major_version:
133-
shortcuts.append(major_version)
145+
shortcuts[major_version] = True
134146
minor_version = version_elements.get(auto_version_tool.definitions.SemVerSigFig.minor, None)
135147
if minor_version and major_version:
136-
shortcuts.append(f&#34;{major_version}.{minor_version}&#34;)
148+
shortcuts[f&#34;{major_version}.{minor_version}&#34;] = True
137149
if commit_type == CommitType.BETA:
138-
shortcuts.append(auto_version_tool.config.PRERELEASE_TOKEN)
150+
shortcuts[auto_version_tool.config.PRERELEASE_TOKEN] = False
139151
if commit_type == CommitType.DEVELOPMENT:
152+
shortcuts[auto_version_tool.config.BUILD_TOKEN] = False
140153
commit_count = version_elements.get(auto_version_tool.Constants.COMMIT_COUNT_FIELD, None)
141154
if not commit_count:
142155
with LocalProjectRepository() as git:
@@ -145,7 +158,7 @@ <h1 class="title">Module <code>continuous_delivery_scripts.utils.versioning</cod
145158
if not commit_hash:
146159
with LocalProjectRepository() as git:
147160
commit_hash = git.get_commit_hash()
148-
shortcuts.append(f&#34;{auto_version_tool.config.BUILD_TOKEN}.{commit_count}+{commit_hash}&#34;)
161+
shortcuts[f&#34;{auto_version_tool.config.BUILD_TOKEN}.{commit_count}+{commit_hash}&#34;] = False
149162

150163
return shortcuts
151164

@@ -234,38 +247,61 @@ <h2 id="returns">Returns</h2>
234247
</details>
235248
</dd>
236249
<dt id="continuous_delivery_scripts.utils.versioning.determine_version_shortcuts"><code class="name flex">
237-
<span>def <span class="ident">determine_version_shortcuts</span></span>(<span>commit_type: <a title="continuous_delivery_scripts.utils.definitions.CommitType" href="definitions.html#continuous_delivery_scripts.utils.definitions.CommitType">CommitType</a>, version_elements: Dict[str, str]) ‑> List[str]</span>
250+
<span>def <span class="ident">determine_version_shortcuts</span></span>(<span>commit_type: <a title="continuous_delivery_scripts.utils.definitions.CommitType" href="definitions.html#continuous_delivery_scripts.utils.definitions.CommitType">CommitType</a>, tag_latest: bool, tag_shortcut: bool, version_elements: Dict[str, str]) ‑> Dict[str, bool]</span>
238251
</code></dt>
239252
<dd>
240253
<div class="desc"><p>Determine the different version shortcuts i.e. major, major.minor, pre depending on the release type.</p>
241254
<h2 id="args">Args</h2>
242255
<dl>
243256
<dt><strong><code>commit_type</code></strong></dt>
244257
<dd>commit type</dd>
258+
<dt><strong><code>tag_latest</code></strong></dt>
259+
<dd>whether to tag release with <code>Latest</code></dd>
260+
<dt><strong><code>tag_shortcut</code></strong></dt>
261+
<dd>whether to set additional shortcuts</dd>
245262
<dt><strong><code>version_elements</code></strong></dt>
246263
<dd>version elements</dd>
247-
</dl></div>
264+
</dl>
265+
<h2 id="returns">Returns</h2>
266+
<dl>
267+
<dt><code>dict</code></dt>
268+
<dd>A dictionary of shortcuts and a flag specifying</dd>
269+
</dl>
270+
<p>whether it is a version string or bespoke shortcut such as latest</p></div>
248271
<details class="source">
249272
<summary>
250273
<span>Expand source code</span>
251274
</summary>
252-
<pre><code class="python">def determine_version_shortcuts(commit_type: CommitType, version_elements: Dict[str, str]) -&gt; List[str]:
275+
<pre><code class="python">def determine_version_shortcuts(
276+
commit_type: CommitType, tag_latest: bool, tag_shortcut: bool, version_elements: Dict[str, str]
277+
) -&gt; Dict[str, bool]:
253278
&#34;&#34;&#34;Determine the different version shortcuts i.e. major, major.minor, pre depending on the release type.
254279

255280
Args:
256281
commit_type: commit type
282+
tag_latest: whether to tag release with `Latest`
283+
tag_shortcut: whether to set additional shortcuts
257284
version_elements: version elements
285+
286+
Returns:
287+
dict: A dictionary of shortcuts and a flag specifying
288+
whether it is a version string or bespoke shortcut such as latest
258289
&#34;&#34;&#34;
259-
shortcuts = []
290+
shortcuts = {}
291+
if commit_type == CommitType.RELEASE and tag_latest:
292+
shortcuts[&#34;latest&#34;] = False
293+
if not tag_shortcut:
294+
return shortcuts
260295
major_version = version_elements.get(auto_version_tool.definitions.SemVerSigFig.major, None)
261296
if major_version:
262-
shortcuts.append(major_version)
297+
shortcuts[major_version] = True
263298
minor_version = version_elements.get(auto_version_tool.definitions.SemVerSigFig.minor, None)
264299
if minor_version and major_version:
265-
shortcuts.append(f&#34;{major_version}.{minor_version}&#34;)
300+
shortcuts[f&#34;{major_version}.{minor_version}&#34;] = True
266301
if commit_type == CommitType.BETA:
267-
shortcuts.append(auto_version_tool.config.PRERELEASE_TOKEN)
302+
shortcuts[auto_version_tool.config.PRERELEASE_TOKEN] = False
268303
if commit_type == CommitType.DEVELOPMENT:
304+
shortcuts[auto_version_tool.config.BUILD_TOKEN] = False
269305
commit_count = version_elements.get(auto_version_tool.Constants.COMMIT_COUNT_FIELD, None)
270306
if not commit_count:
271307
with LocalProjectRepository() as git:
@@ -274,7 +310,7 @@ <h2 id="args">Args</h2>
274310
if not commit_hash:
275311
with LocalProjectRepository() as git:
276312
commit_hash = git.get_commit_hash()
277-
shortcuts.append(f&#34;{auto_version_tool.config.BUILD_TOKEN}.{commit_count}+{commit_hash}&#34;)
313+
shortcuts[f&#34;{auto_version_tool.config.BUILD_TOKEN}.{commit_count}+{commit_hash}&#34;] = False
278314

279315
return shortcuts</code></pre>
280316
</details>

news/20221221071258.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)