Skip to content

Commit

Permalink
automataCI: fixed changelog assembling bug
Browse files Browse the repository at this point in the history
There were some bugs where the changelogs where assembled wrongly
in multiple data entries. Hence, let's do this.

This patch fixes changelog assembling bug in automataCI/ directory.

Co-authored-by: Galyna, Cory <[email protected]>
Co-authored-by: (Holloway) Chew, Kean Ho <[email protected]>
Signed-off-by: (Holloway) Chew, Kean Ho <[email protected]>
  • Loading branch information
hollowaykeanho and corygalyna committed Sep 18, 2023
1 parent b6af513 commit c8439b1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 16 deletions.
28 changes: 20 additions & 8 deletions automataCI/services/compilers/changelog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,36 @@ function CHANGELOG-Assemble-DEB {
$null = FS-Remove-Silently "${__target}.gz"
$null = FS-Make-Housing-Directory "${__target}"

$__initiated = ""
foreach ($__line in (Get-Content "${__directory}\latest")) {
$__process = FS-Append-File "${__target}" "${__line}"
if ($__process -ne 0) {
return 1
}

$__initiated = "true"
}

foreach ($__tag in (git tag --sort version:refname)) {
if (-not (Test-Path "${__directory}\${__tag}")) {
foreach ($__tag in (Invoke-Expression "git tag --sort -version:refname")) {
if (-not (Test-Path "${__directory}\$($__tag -replace ".*v")")) {
continue
}

foreach ($__line in (Get-Content "${__directory}\${__tag}")) {
$__process = FS-Append-File "${__target}" "`n${__line}"
if (-not [string]::IsNullOrEmpty($__initiated)) {
$__process = FS-Append-File "${__target}" "`n"
if ($__process -ne 0) {
return 1
}
}

foreach ($__line in (Get-Content "${__directory}\$($__tag -replace ".*v")")) {
$__process = FS-Append-File "${__target}" "${__line}"
if ($__process -ne 0) {
return 1
}

$__initiated = "true"
}
}

# gunzip
Expand Down Expand Up @@ -95,13 +107,13 @@ function CHANGELOG-Assemble-MD {
}
}

foreach ($__tag in (git tag --sort version:refname)) {
if (-not (Test-Path "${__directory}\${__tag}")) {
foreach ($__tag in (Invoke-Expression "git tag --sort -version:refname")) {
if (-not (Test-Path "${__directory}\$($__tag -replace ".*v")")) {
continue
}

$null = FS-Append-File "${__target}" "`n`n##${__tag}`n"
foreach ($__line in (Get-Content "${__directory}\${__tag}")) {
$null = FS-Append-File "${__target}" "`n`n## ${__tag}`n"
foreach ($__line in (Get-Content "${__directory}\$($__tag -replace ".*v")")) {
$__process = FS-Append-File "${__target}" "* ${__line}"
if ($__process -ne 0) {
return 1
Expand Down
23 changes: 16 additions & 7 deletions automataCI/services/compilers/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,34 @@ CHANGELOG::assemble_deb() {
FS::remove_silently "${__target}.gz"
FS::make_housing_directory "$__target"

__initiated=""
old_IFS="$IFS"
while IFS="" read -r __line || [ -n "$__line" ]; do
FS::append_file "$__target" "$__line\n"
if [ $? -ne 0 ]; then
return 1
fi

__initiated="true"
done < "${__directory}/latest"

for __tag in "$(git tag --sort version:refname)"; do
if [ ! -f "${__directory}/${__tag}" ]; then
for __tag in $(git tag --sort -version:refname); do
if [ ! -f "${__directory}/${__tag##*v}" ]; then
continue
fi

if [ ! -z "$__initiated" ]; then
FS::append_file "$__target" "\n\n"
fi

while IFS="" read -r __line || [ -n "$__line" ]; do
FS::append_file "$__target" "\n$__line\n"
FS::append_file "$__target" "$__line\n"
if [ $? -ne 0 ]; then
return 1
fi
done < "${__directory}/${__tag}"

__initiated="true"
done < "${__directory}/${__tag##*v}"
done
IFS="$old_IFS"
unset old_IFS __line __tag
Expand Down Expand Up @@ -100,8 +109,8 @@ CHANGELOG::assemble_md() {
fi
done < "${__directory}/latest"

for __tag in "$(git tag --sort version:refname)"; do
if [ ! -f "${__directory}/${__tag}" ]; then
for __tag in $(git tag --sort -version:refname); do
if [ ! -f "${__directory}/${__tag##*v}" ]; then
continue
fi

Expand All @@ -111,7 +120,7 @@ CHANGELOG::assemble_md() {
if [ $? -ne 0 ]; then
return 1
fi
done < "${__directory}/${__tag}"
done < "${__directory}/${__tag##*v}"
done
IFS="$old_IFS"
unset old_IFS __line __tag
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions resources/changelog/data/latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
automataCI: fixed changelog assembling bug
automataCI: added static repo compulsory notice file
automataCI: documented updates SOP and Upstream SOP
automataCI: added changelog entries seal function for Release job
root: added stop recipe for srcPYTHON
automataCI: added notice type to OS::print_status
root: set v1.4.1 development
File renamed without changes.
9 changes: 8 additions & 1 deletion resources/changelog/deb/latest
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
automataci (1.4.1) stable; urgency=low

* automataCI: fixed changelog assembling bug
* automataCI: added static repo compulsory notice file
* automataCI: documented updates SOP and Upstream SOP
* automataCI: added changelog entries seal function for Release job
* root: added stop recipe for srcPYTHON
* automataCI: added notice type to OS::print_status
* root: set v1.4.1 development

-- Your Legal Full Name Here <[email protected]> Mon, 18 Sep 2023 08:58:34 +0800
-- Your Legal Full Name Here <[email protected]> Mon, 18 Sep 2023 16:21:44 +0800

0 comments on commit c8439b1

Please sign in to comment.