Skip to content

Commit 41d480b

Browse files
Merge branch 'release-24.5' into chore-fw-port-23-5
2 parents a21283f + 919a628 commit 41d480b

30 files changed

+338
-364
lines changed

.github/workflows/go-mod-tidy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v3
2525
- uses: actions/setup-go@v4
2626
with:
27-
go-version: v1.20.x
27+
go-version: v1.21.x
2828
- name: go-mod-tidy
2929
run: |
3030
go mod tidy

.github/workflows/golangci-lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright © 2023 SECO Mind Srl
1+
# Copyright © 2023-2024 SECO Mind Srl
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@ jobs:
2525
# Since v3, golangci-lint needs explicit go-setup
2626
- uses: actions/setup-go@v4
2727
with:
28-
go-version: v1.20.x
28+
go-version: v1.21.x
2929
# Run golint-ci
3030
- uses: golangci/golangci-lint-action@v3
3131
with:
32-
version: v1.53
32+
version: v1.59

.github/workflows/goreleaser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
17-
- name: Set up Go 1.20
17+
- name: Set up Go 1.21
1818
uses: actions/setup-go@v4
1919
with:
20-
go-version: 1.20.x
20+
go-version: 1.21.x
2121
- name: Run GoReleaser
22-
uses: goreleaser/goreleaser-action@v4
22+
uses: goreleaser/goreleaser-action@v6
2323
with:
2424
distribution: goreleaser
25-
version: latest
25+
version: v2
2626
args: release --clean
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Build and Test
1616
strategy:
1717
matrix:
18-
go: [1.19.x, 1.20.x]
18+
go: [1.21.x, 1.22.x]
1919
os: [ubuntu-22.04, macos-latest, windows-latest]
2020
runs-on: ${{ matrix.os }}
2121
steps:
@@ -40,10 +40,9 @@ jobs:
4040
- name: Test
4141
run: go test -v -race ./...
4242

43-
# Load artifacts obtained with the most recent version of Go
4443
- name: Upload build artifacts
4544
uses: actions/upload-artifact@v4
46-
if: matrix.go == '1.20.x'
45+
if: matrix.go == '1.22.x'
4746
with:
4847
path: astartectl*
4948
name: astartectl-snapshot-${{ matrix.os }}

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
golang 1.20.5
1+
golang 1.21.11

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,39 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [24.5.3] - Unreleased
8+
### Changed
9+
- `appengine device attributes list`: display attributes in a human-friendly
10+
representation instead Go's internal one. Keep consistency with aliases.
11+
12+
### Fixed
13+
- `appengine device alias list`: show aliases as a map instead of a list.
14+
Fix [#275](https://github.com/astarte-platform/astartectl/issues/275).
15+
16+
## [24.5.2] - 2024-09-20
17+
### Fixed
18+
- Allow a larger set of permissions for configuration files and folders.
19+
20+
## [24.5.1] - 2024-09-19
21+
### Changed
22+
- `cluster instance` {`deploy` | `destroy` | `show`} are deprecated and
23+
will be removed from v24.11.
24+
25+
### Fixed
26+
- Create configuration files and folders if required, instead of just crashing.
27+
- Fixed empty array sent as empty string for array payload.
28+
- Allow the management of triggers containing Mustache templates.
29+
30+
## [24.5.0] - 2024-09-03
31+
### Added
32+
- `cluster instance deploy`: add profiles for astarte v1.2.
33+
34+
### Changed
35+
- Use Go 1.21 for releases.
36+
37+
### Removed
38+
- `cluster instance deploy`: remove profiles for Astarte v0.10 and v0.11.
39+
740
## [23.5.2] - 2024-09-02
841
### Fixed
942
- `realm-management {interfaces, triggers} sync`: do not show a wrong curl

cmd/appengine/device.go

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"math"
2323
"os"
24+
"regexp"
2425
"strconv"
2526
"strings"
2627
"text/tabwriter"
@@ -1649,34 +1650,34 @@ func parseSendDataPayload(payload string, mappingType interfaces.AstarteMappingT
16491650
case interfaces.BinaryBlobArray, interfaces.BooleanArray, interfaces.DateTimeArray, interfaces.DoubleArray,
16501651
interfaces.IntegerArray, interfaces.LongIntegerArray, interfaces.StringArray:
16511652

1652-
//wait it's all string?
1653-
payload = strings.Replace(payload, "[", "", -1)
1654-
payload = strings.Replace(payload, "]", "", -1)
1655-
payload_parsed := strings.Split(payload, ",")
1656-
//always has been
1657-
1658-
jsonOut := make([]interface{}, len(payload_parsed))
1659-
for i, v := range payload_parsed {
1660-
jsonOut[i] = v
1661-
}
1662-
1663-
retArray := []interface{}{}
1664-
// Do a smarter conversion here.
1665-
for _, v := range jsonOut {
1666-
switch val := v.(type) {
1667-
case string:
1668-
p, err := parseSendDataPayload(strings.TrimSpace(val), interfaces.AstarteMappingType(strings.TrimSuffix(string(mappingType), "array")))
1653+
//check if payload is an empty array, bypass conversions and just return an empty array
1654+
// if it is not, proceed as usual
1655+
if payload == "[]" {
1656+
ret = make([]interface{}, 0)
1657+
} else {
1658+
retArray := []interface{}{}
1659+
payload = strings.TrimSpace(payload)
1660+
if pass, err := regexp.MatchString(`^\[.*\]$`, payload); !pass {
1661+
return nil, err
1662+
}
1663+
payload = regexp.MustCompile(`^\[`).ReplaceAllString(payload, "")
1664+
payload = regexp.MustCompile(`\]$`).ReplaceAllString(payload, "")
1665+
payload_parsed := strings.Split(payload, ",")
1666+
jsonOut := make([]interface{}, len(payload_parsed))
1667+
for i, v := range payload_parsed {
1668+
jsonOut[i] = v
1669+
}
1670+
// Do a smarter conversion here.
1671+
for _, v := range jsonOut {
1672+
p, err := parseSendDataPayload(strings.TrimSpace(v.(string)), interfaces.AstarteMappingType(strings.TrimSuffix(string(mappingType), "array")))
16691673
if err != nil {
16701674
return nil, err
16711675
}
16721676
retArray = append(retArray, p)
1673-
default:
1674-
retArray = append(retArray, val)
16751677
}
1678+
ret = retArray
16761679
}
1677-
ret = retArray
16781680
}
1679-
16801681
return ret, nil
16811682
}
16821683

cmd/appengine/device_aliases.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@ func aliasesListF(command *cobra.Command, args []string) error {
9292
os.Exit(1)
9393
}
9494
aliases, _ := deviceAliasesRes.Parse()
95+
aliasesMap, _ := aliases.(map[string]string)
96+
97+
for k, v := range aliasesMap {
98+
fmt.Printf("%v: %v\n", k, v)
99+
}
95100

96-
fmt.Printf("%v\n", aliases)
97101
return nil
98102
}
99103

cmd/appengine/device_attributes.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ func attributesListF(command *cobra.Command, args []string) error {
111111
os.Exit(1)
112112
}
113113
attributes, _ := attributesRes.Parse()
114+
attributesMap, _ := attributes.(map[string]string)
115+
116+
for k, v := range attributesMap {
117+
fmt.Printf("%v: %v\n", k, v)
118+
}
114119

115-
fmt.Printf("%v\n", attributes)
116120
return nil
117121
}
118122

cmd/cluster/deployment/all_profiles.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@ package deployment
1717
// GetAllBuiltinAstarteClusterProfiles returns all the bundled Cluster profiles.
1818
func GetAllBuiltinAstarteClusterProfiles() []AstarteClusterProfile {
1919
return []AstarteClusterProfile{
20-
// 0.10 profiles
21-
astarteBasicProfile010,
22-
// 0.11 profiles
23-
astarteBasicProfile011,
24-
astarteBurstProfile011,
2520
// 1.0 profiles (good for 1.0 for now)
2621
astarteBasicProfile10,
2722
astarteBurstProfile10,
2823
// 1.1 profiles
2924
astarteBasicProfile11,
3025
astarteBurstProfile11,
26+
// 1.2 profiles
27+
astarteBasicProfile12,
28+
astarteBurstProfile12,
3129
}
3230
}

0 commit comments

Comments
 (0)