Skip to content

Commit 54993e8

Browse files
mirkoCrobumirkoCrobu
authored andcommitted
feat: merge conflicts
2 parents edfb9c0 + accb539 commit 54993e8

File tree

189 files changed

+7314
-1252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+7314
-1252
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.github/CODEOWNERS @bcmi-labs/team_tooling
2+
* @bcmi-labs/team_tooling

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- uses: golangci/golangci-lint-action@v8
4040
with:
41-
version: v2.1.6
41+
version: v2.4.0
4242
args: --timeout 300s
4343

4444
- name: Check go mod
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release releaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "releaser-*" # Trigger on all tags
7+
8+
env:
9+
GO_VERSION: "1.25.0"
10+
PROJECT_NAME: "releaser"
11+
GITHUB_TOKEN: ${{ secrets.ARDUINOBOT_TOKEN }}
12+
GITHUB_USERNAME: ArduinoBot
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- name: Extract version
19+
shell: bash
20+
run: |
21+
TAG_NAME="${GITHUB_REF##*/}"
22+
VERSION="${TAG_NAME#releaser-}" # Remove 'releaser-' prefix
23+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
24+
echo "RELEASE_NAME=${{ env.PROJECT_NAME }}-${VERSION}-linux-amd64" >> $GITHUB_ENV
25+
env:
26+
GITHUB_REF: ${{ github.ref }}
27+
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Configure Git for private repo cloning
34+
run: |
35+
git config --global url."https://${{ env.GITHUB_USERNAME }}:${{ env.GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
36+
37+
- name: Set up Go
38+
uses: actions/setup-go@v5
39+
with:
40+
go-version: ${{ env.GO_VERSION }}
41+
42+
- name: Build Binary
43+
env:
44+
GOARCH: ${{ matrix.arch }}
45+
GOOS: ${{ matrix.os }}
46+
run: |
47+
mkdir -p build/
48+
go build -v -ldflags "-X 'main.version=${{ env.VERSION }}'" \
49+
-o ./build/ \
50+
./cmd/${{ env.PROJECT_NAME }}
51+
52+
- name: Prepare Build Artifacts
53+
run: |
54+
tar -czf ./build/${{ env.RELEASE_NAME }}.tar.gz -C ./build ${{ env.PROJECT_NAME }}
55+
56+
- name: Upload artifacts index
57+
uses: ncipollo/release-action@v1
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
draft: false
61+
prerelease: true
62+
artifacts: build/${{ env.RELEASE_NAME }}.tar.gz

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
tags:
66
- "*" # Trigger on all tags
77
- "!remoteocd-*" # Exclude remoteocd tags
8+
- "!releaser-*" # Exclude releaser tags
89

910
env:
1011
GO_VERSION: "1.24"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ build/
3434
/arduino-app-cli
3535
/apps
3636
# temporary staging directories
37-
/debian/arduino-app-cli/home/
37+
/debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/examples

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ linters:
1616
- unconvert
1717
- unparam
1818
- forbidigo
19+
- gochecknoinits
1920
settings:
2021
forbidigo:
2122
forbid:

.licenses/arduino-router/NOTICE

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,102 @@ SOFTWARE.
2929

3030
Released under the [MIT license](LICENSE).
3131

32+
*****
33+
github.com/djherbis/buffer@v1.2.0
34+
35+
The MIT License (MIT)
36+
37+
Copyright (c) 2015 Dustin H
38+
39+
Permission is hereby granted, free of charge, to any person obtaining a copy of
40+
this software and associated documentation files (the "Software"), to deal in
41+
the Software without restriction, including without limitation the rights to
42+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
43+
the Software, and to permit persons to whom the Software is furnished to do so,
44+
subject to the following conditions:
45+
46+
The above copyright notice and this permission notice shall be included in all
47+
copies or substantial portions of the Software.
48+
49+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
51+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
52+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
53+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
54+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55+
56+
*****
57+
github.com/djherbis/buffer/limio@v1.2.0
58+
59+
The MIT License (MIT)
60+
61+
Copyright (c) 2015 Dustin H
62+
63+
Permission is hereby granted, free of charge, to any person obtaining a copy of
64+
this software and associated documentation files (the "Software"), to deal in
65+
the Software without restriction, including without limitation the rights to
66+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
67+
the Software, and to permit persons to whom the Software is furnished to do so,
68+
subject to the following conditions:
69+
70+
The above copyright notice and this permission notice shall be included in all
71+
copies or substantial portions of the Software.
72+
73+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
74+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
75+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
76+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
77+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
78+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
79+
80+
*****
81+
github.com/djherbis/buffer/wrapio@v1.2.0
82+
83+
The MIT License (MIT)
84+
85+
Copyright (c) 2015 Dustin H
86+
87+
Permission is hereby granted, free of charge, to any person obtaining a copy of
88+
this software and associated documentation files (the "Software"), to deal in
89+
the Software without restriction, including without limitation the rights to
90+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
91+
the Software, and to permit persons to whom the Software is furnished to do so,
92+
subject to the following conditions:
93+
94+
The above copyright notice and this permission notice shall be included in all
95+
copies or substantial portions of the Software.
96+
97+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
99+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
100+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
101+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
102+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
103+
104+
*****
105+
github.com/djherbis/nio/v3@v3.0.1
106+
107+
The MIT License (MIT)
108+
109+
Copyright (c) 2015 Dustin H
110+
111+
Permission is hereby granted, free of charge, to any person obtaining a copy of
112+
this software and associated documentation files (the "Software"), to deal in
113+
the Software without restriction, including without limitation the rights to
114+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
115+
the Software, and to permit persons to whom the Software is furnished to do so,
116+
subject to the following conditions:
117+
118+
The above copyright notice and this permission notice shall be included in all
119+
copies or substantial portions of the Software.
120+
121+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
122+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
123+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
124+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
125+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
126+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
127+
32128
*****
33129
github.com/spf13/cobra@v1.9.1
34130

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ NOTE: currently the mac-os is not supported since the `github.com/arduino/arduin
246246
- `task wails:release -- 6.0.7` to create a new release `6.0.7`
247247
- Open the Wails app and click on "Update" button.
248248

249-
### Orchestrator configurations
249+
## Orchestrator configurations
250250

251251
The orchestrator will write apps in `~/ArduinoApps` folder, and examples in `~/.config/arduino-app-cli/examples`.
252252
To override the path provide the following flags:
253253

254254
- `ARDUINO_APP_CLI__APPS_DIR`
255-
- `ARDUINO_APP_CLI__DATA_DIR`
255+
- `ARDUINO_APP_CLI__CONFIG_DIR`
256256

257257
### App folder and persistent data
258258

Taskfile.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ includes:
88
dotenv: [".env.local", ".env"]
99

1010
vars:
11-
GOLANGCI_LINT_VERSION: v2.1.6
11+
GOLANGCI_LINT_VERSION: v2.4.0
1212
GOIMPORTS_VERSION: v0.29.0
1313
DPRINT_VERSION: 0.48.0
14-
RUNNER_VERSION: "0.1.16"
1514
EXAMPLE_VERSION: "0.1.18"
1615
VERSION: # if version is not passed we hack the semver by encoding the commit as pre-release
1716
sh: echo "${VERSION:-0.0.0-$(git rev-parse --short HEAD)}"
@@ -107,13 +106,13 @@ tasks:
107106
set -e
108107
echo "Runner version set as: {{ .EXAMPLE_VERSION }}"
109108
TMP_PATH="$(mktemp -d)"
110-
DEST_PATH="debian/arduino-app-cli/home/arduino/.config/arduino-app-cli/"
109+
DEST_PATH="debian/arduino-app-cli/home/arduino/.local/share/arduino-app-cli/"
111110
echo "Cloning bcmi-labs/app-bricks-example into temporary directory ${TMP_PATH}..."
112111
git clone --depth 1 --branch "{{ .EXAMPLE_VERSION }}" https://github.com/bcmi-labs/app-bricks-example "${TMP_PATH}"
113-
rm -rf "${DEST_PATH}"
112+
rm -rf "${DEST_PATH}/examples"
114113
mkdir -p "${DEST_PATH}"
115114
mv "${TMP_PATH}/examples" "${DEST_PATH}"
116-
rm -rf "${TMP_PATH}"
115+
rm -rf "${TMP_PATH}/examples"
117116
echo "Examples successfully cloned."
118117
silent: false
119118

@@ -327,28 +326,6 @@ tasks:
327326
cp build/remoteocd.exe ~/AppData/Local/Arduino15/packages/arduino/tools/remoteocd/0.0.1/remoteocd.exe
328327
platforms: [windows]
329328
330-
generate:bricks-and-models-index:
331-
desc: This generates the models and bricks index.
332-
cmds:
333-
- |
334-
tmpdir="${TMPDIR:-/tmp}"
335-
semver_tag={{.RUNNER_VERSION}}
336-
DST_DIR=internal/orchestrator/assets/static/"${semver_tag}"
337-
if [ -d "$DST_DIR" ]; then
338-
exit 0
339-
fi
340-
gh release download -R bcmi-labs/app-bricks-py "release/${semver_tag}" -p '*.whl' -D "$tmpdir" --clobber
341-
342-
ZIP_NAME="$tmpdir"/arduino_app_bricks-"${semver_tag}"-py3-none-any.whl
343-
OUTPUT_DIR="${tmpdir}/${semver_tag}"
344-
unzip -o "$ZIP_NAME" -d "$OUTPUT_DIR"
345-
rm -rf "internal/orchestrator/assets/static"
346-
mkdir -p "internal/orchestrator/assets/static"
347-
mv "$OUTPUT_DIR"/arduino/app_bricks/static "$DST_DIR"
348-
rm -r "$OUTPUT_DIR" "$ZIP_NAME"
349-
# Bumps the default pinned latest base python image tag
350-
sed -i "s#RunnerVersion = \".*#RunnerVersion = \"${semver_tag}\"#" cmd/arduino-app-cli/internal/servicelocator/servicelocator.go
351-
352329
update-deb-copyright:
353330
desc: Extract project and dependency licenses into asd copyright
354331
cmds:

cmd/arduino-app-cli/app/app.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,32 @@ import (
55

66
"github.com/spf13/cobra"
77

8-
"github.com/bcmi-labs/orchestrator/internal/orchestrator"
8+
"github.com/bcmi-labs/orchestrator/cmd/arduino-app-cli/internal/servicelocator"
99
"github.com/bcmi-labs/orchestrator/internal/orchestrator/app"
10+
"github.com/bcmi-labs/orchestrator/internal/orchestrator/config"
1011
)
1112

12-
func NewAppCmd() *cobra.Command {
13+
func NewAppCmd(cfg config.Configuration) *cobra.Command {
1314
appCmd := &cobra.Command{
1415
Use: "app",
1516
Short: "Manage Arduino Apps",
1617
Long: "A CLI tool to manage Arduino Apps, including starting, stopping, logging, and provisioning.",
1718
}
1819

19-
appCmd.AddCommand(newCreateCmd())
20-
appCmd.AddCommand(newStartCmd())
21-
appCmd.AddCommand(newStopCmd())
22-
appCmd.AddCommand(newRestartCmd())
23-
appCmd.AddCommand(newLogsCmd())
24-
appCmd.AddCommand(newListCmd())
20+
appCmd.AddCommand(newCreateCmd(cfg))
21+
appCmd.AddCommand(newStartCmd(cfg))
22+
appCmd.AddCommand(newStopCmd(cfg))
23+
appCmd.AddCommand(newRestartCmd(cfg))
24+
appCmd.AddCommand(newLogsCmd(cfg))
25+
appCmd.AddCommand(newListCmd(cfg))
2526
appCmd.AddCommand(newPsCmd())
26-
appCmd.AddCommand(newMonitorCmd())
27+
appCmd.AddCommand(newMonitorCmd(cfg))
2728

2829
return appCmd
2930
}
3031

3132
func Load(idOrPath string) (app.ArduinoApp, error) {
32-
id, err := orchestrator.ParseID(idOrPath)
33+
id, err := servicelocator.GetAppIDProvider().ParseID(idOrPath)
3334
if err != nil {
3435
return app.ArduinoApp{}, fmt.Errorf("invalid app path: %s", idOrPath)
3536
}

0 commit comments

Comments
 (0)