Skip to content

Commit 00e2874

Browse files
committed
chore: update .gitignore and add CHANGELOG.md with initial content and add git-cliff config
1 parent 86ff133 commit 00e2874

4 files changed

Lines changed: 378 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.idea
2+
coverage.out
3+
coverage.html

CHANGELOG.md

Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [Unreleased]
6+
7+
### Build
8+
9+
- *(deps)* Bump golang.org/x/net from 0.37.0 to 0.38.0
10+
11+
### ⚙️ Miscellaneous
12+
13+
- Update go version
14+
- Update deps
15+
- Update deps
16+
- Update go get command
17+
- Update deps
18+
- Update deps
19+
- Update deps
20+
- Update deps
21+
- Update deps
22+
- *(deps)* Update dependency ubuntu to v24
23+
- *(deps)* Update actions/checkout action to v5
24+
- *(deps)* Update actions/setup-go action to v6
25+
- Update deps
26+
- Update deps
27+
- *(deps)* Update actions/checkout action to v6
28+
- Add dependency audit workflow for vulnerability checks and go.mod verification
29+
- Update Go version to 1.26.0 and task version to 3.48.0 in configuration files
30+
- *(deps)* Update golangci/golangci-lint-action action to v9
31+
32+
### 🐛 Bug Fixes
33+
34+
- Typo
35+
- Liter errors
36+
- Liter errors
37+
- Typo
38+
- Non-constant format string
39+
- Clean file paths and improve error messages in config loading
40+
41+
### 📚 Documentation
42+
43+
- Add CONTRIBUTING.md to guide new contributors on project participation
44+
- Update README.md with command package details and examples
45+
46+
### 🔧 Refactoring
47+
48+
- Update HeartBeat to use context for cancellation and atomic operations
49+
- Improve MQTT client implementation and error handling
50+
- Simplify staticcheck command in Taskfile.yaml for improved maintainability
51+
- Improve error handling and resource cleanup in file operations
52+
53+
### 🚀 Features
54+
55+
- Add GH Action test pipeline
56+
- Implement CLI parameter manager with support for various types
57+
- Add config package for loading environment variables and file-based configurations
58+
- Add environment package for reading environment variables with type support
59+
- Add filesystem package with FileExists function and tests
60+
- Add filter package with generic filtering functionality and tests
61+
- Add heartbeat package for interval-based function execution
62+
- Enhance logging package with structured logging and severity levels
63+
- Enhance MQTT client with TLS configuration and error handling
64+
- Add process package with helper function to get executable name
65+
- Add shutdown package for graceful application exit handling
66+
- Add strings package with PrettyPrintJson and PrettyPrintYaml functions
67+
- Add templates package for managing and rendering templates with a data structure
68+
- Add yamlconfig package for loading YAML configurations with deprecation notice
69+
- Add ResetForTesting function to enable isolated testing of shutdown hooks
70+
- Implement command execution with logging and dry-run support
71+
72+
### 🧪 Testing
73+
74+
- Refactor tests to use testify assertions for improved readability
75+
- Refactor logging tests to use testify assertions for consistency and clarity
76+
- Add additional unit tests for all modules
77+
78+
## [0.10.0] - 2024-07-11
79+
80+
### ⚙️ Miscellaneous
81+
82+
- Update deps
83+
84+
### 🔧 Refactoring
85+
86+
- Remove export of internal variables
87+
88+
### 🚀 Features
89+
90+
- Add func to get float env values
91+
- Add a basic cli manager
92+
- Update README.md
93+
94+
## [0.9.1] - 2024-07-10
95+
96+
### ⚙️ Miscellaneous
97+
98+
- Update deps
99+
- Update deps
100+
101+
### 🐛 Bug Fixes
102+
103+
- Nil error when shutdown is not properly initialized
104+
105+
## [0.9.0] - 2024-05-22
106+
107+
### ⚙️ Miscellaneous
108+
109+
- Add deprecation warning
110+
- Add staticcheck linter ignore comment
111+
- Remove unneeded "break" statement
112+
113+
### 🚀 Features
114+
115+
- Add staticcheck task
116+
- Add configuration loader (file and environment) + update README.md
117+
118+
## [0.8.1] - 2024-05-14
119+
120+
### ⚙️ Miscellaneous
121+
122+
- Change task name
123+
124+
### 🐛 Bug Fixes
125+
126+
- Attach "_" to prefix to avoid issues with non prefix strings
127+
128+
### 📚 Documentation
129+
130+
- Adjust README.md
131+
132+
### 🚀 Features
133+
134+
- Load environment variables via prefix as map
135+
- Add date and new line to log entry
136+
137+
## [0.8.0] - 2024-05-03
138+
139+
### ⚙️ Miscellaneous
140+
141+
- Replace deprecated method
142+
- Add license
143+
- Update deps
144+
- Remove refactored stuff
145+
146+
### 📚 Documentation
147+
148+
- Add the first batch of code documentation
149+
- Update go docs
150+
151+
### 🔧 Refactoring
152+
153+
- Move WithTlsCertificates to BrokerBuilder
154+
155+
### 🚀 Features
156+
157+
- Add exchangeable log writer
158+
- Add struct logger and tests
159+
- Add PrettyPrint for yaml and tests
160+
- Add manager for go-templating engine (as generic impl)
161+
- Add MQTT TLS configuration
162+
- Add BrokerBuilder to set up broker host, credentials and tls
163+
164+
### 🧪 Testing
165+
166+
- Add logger tests
167+
- Add tests for mqtt
168+
169+
## [0.7.0] - 2024-03-21
170+
171+
### ⚙️ Miscellaneous
172+
173+
- Update deps
174+
- Add go test as task
175+
- Adjust README.md
176+
177+
### 🐛 Bug Fixes
178+
179+
- *(shutdown)* Close channel when used
180+
181+
### 🚀 Features
182+
183+
- *(strings)* Add PrettyPrint function and according test
184+
- *(filter)* Add generic filter and according test
185+
- *(filesystem)* Add FileExists function and according test
186+
- *(environment)* Add function to get defined environment values and according test
187+
- *(logging)* Add "warning" level and rename "dryRun" to "extend"
188+
189+
### 🧪 Testing
190+
191+
- Add simple test
192+
193+
## [0.6.2-2] - 2024-03-14
194+
195+
### 🐛 Bug Fixes
196+
197+
- *(heartbeat)* Wrong "first time execution" logic part 2
198+
199+
## [0.6.2-1] - 2024-03-14
200+
201+
### 🐛 Bug Fixes
202+
203+
- *(heartbeat)* Wrong "first time execution" logic
204+
205+
## [0.6.2] - 2024-03-11
206+
207+
### 🐛 Bug Fixes
208+
209+
- *(heartbeat)* Deadlock when "noWait" set: when error on first loop
210+
211+
### 🚀 Features
212+
213+
- *(shutdown)* Reformat output
214+
215+
## [0.6.1-1] - 2024-03-11
216+
217+
### 🚀 Features
218+
219+
- *(logging)* Execute shutdown.Exit ob logger.Fatal call
220+
- *(shutdown)* Add Exit functions and refactor command summary output
221+
222+
## [0.6.0] - 2024-03-07
223+
224+
### 🚀 Features
225+
226+
- *(heartbeat)* Add "runForever" function
227+
- *(process)* Add "GetExecutableName" function
228+
- *(logging)* Add simple logging
229+
230+
## [0.5.1] - 2024-02-28
231+
232+
### 🔧 Refactoring
233+
234+
- *(mqtt)* Prepare for module testing
235+
- *(shutdown)* Replace native func definition with type
236+
- *(heartbeat)* Add "noWait" option to run beat without waiting for "interval" first
237+
238+
### 🚀 Features
239+
240+
- Create README.md
241+
242+
## [0.5.0] - 2024-02-26
243+
244+
### 🚀 Features
245+
246+
- *(mqtt)* Add new mqtt constructor
247+
248+
## [0.4.0] - 2024-02-26
249+
250+
### ⚙️ Miscellaneous
251+
252+
- Update dependencies
253+
- Update dependencies
254+
- Update dependencies
255+
256+
### 🚀 Features
257+
258+
- Add Taskfile with update-deps task
259+
- Run pub / sub async
260+
261+
## [0.3.0] - 2023-07-16
262+
263+
### Build
264+
265+
- *(deps)* Bump golang.org/x/net
266+
267+
### ⚙️ Miscellaneous
268+
269+
- Remove gitlab ci config file
270+
- Update dependencies
271+
- Update package name
272+
273+
### 🐛 Bug Fixes
274+
275+
- *(deps)* Update module github.com/eclipse/paho.mqtt.golang to v1.4.3
276+
277+
## [0.2.0] - 2023-03-19
278+
279+
### 🚀 Features
280+
281+
- Add yaml config loader
282+
283+
## [0.1.1] - 2022-12-16
284+
285+
### 🐛 Bug Fixes
286+
287+
- Fix imports after module refactor
288+
289+
## [0.0.1] - 2022-12-16
290+
291+
### 🚀 Features
292+
293+
- Initial commit
294+
295+
<!-- generated by git-cliff -->

Taskfile.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ tasks:
66
cmds:
77
- go get -u ./...
88

9+
tidy:
10+
desc: Run go mod tidy and verify clean state
11+
cmds:
12+
- go mod tidy
13+
914
test:
1015
desc: Run go tests
1116
cmd: go test ./... --benchmem
@@ -14,6 +19,36 @@ tasks:
1419
desc: Run go tests in verbose mode
1520
cmd: go test ./... -v --benchmem
1621

22+
test-cover:
23+
desc: Run go tests with coverage report
24+
cmds:
25+
- go test -coverprofile=coverage.out ./...
26+
- go tool cover -func=coverage.out
27+
- go tool cover -html=coverage.out -o coverage.html
28+
- echo "Coverage report written to coverage.html"
29+
1730
check:
1831
desc: Run a staticcheck (staticcheck must be installed -> https://staticcheck.dev/docs/getting-started/)
1932
cmd: staticcheck -tests=false ./...
33+
34+
lint:
35+
desc: Run golangci-lint (golangci-lint must be installed -> https://golangci-lint.run/welcome/install/)
36+
cmd: golangci-lint run ./...
37+
38+
vulncheck:
39+
desc: Check for known vulnerabilities (govulncheck must be installed -> go install golang.org/x/vuln/cmd/govulncheck@latest)
40+
cmd: govulncheck ./...
41+
42+
changelog:
43+
desc: Generate CHANGELOG.md from git history (git-cliff must be installed -> https://git-cliff.org/docs/installation)
44+
cmd: git-cliff -o CHANGELOG.md
45+
46+
ci:
47+
desc: Run all CI checks locally (test, staticcheck, golangci-lint, govulncheck, tidy)
48+
cmds:
49+
- task: tidy
50+
- task: test
51+
- task: check
52+
- task: lint
53+
- task: vulncheck
54+

cliff.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[changelog]
2+
header = """
3+
# Changelog\n
4+
All notable changes to this project will be documented in this file.\n
5+
"""
6+
body = """
7+
{% if version %}\
8+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
9+
{% else %}\
10+
## [Unreleased]
11+
{% endif %}\
12+
{% for group, commits in commits | group_by(attribute="group") %}
13+
### {{ group | striptags | trim | upper_first }}
14+
{% for commit in commits %}
15+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
16+
{% if commit.breaking %}[**breaking**] {% endif %}\
17+
{{ commit.message | upper_first }}\
18+
{% endfor %}
19+
{% endfor %}\n
20+
"""
21+
trim = true
22+
footer = """
23+
<!-- generated by git-cliff -->
24+
"""
25+
26+
[git]
27+
conventional_commits = true
28+
filter_unconventional = true
29+
split_commits = false
30+
commit_parsers = [
31+
{ message = "^feat", group = "🚀 Features" },
32+
{ message = "^fix", group = "🐛 Bug Fixes" },
33+
{ message = "^doc", group = "📚 Documentation" },
34+
{ message = "^perf", group = "⚡ Performance" },
35+
{ message = "^refactor", group = "🔧 Refactoring" },
36+
{ message = "^style", group = "🎨 Styling" },
37+
{ message = "^test", group = "🧪 Testing" },
38+
{ message = "^chore\\(release\\)", skip = true },
39+
{ message = "^chore|^ci", group = "⚙️ Miscellaneous" },
40+
{ body = ".*security", group = "🔒 Security" },
41+
]
42+
protect_breaking_commits = false
43+
filter_commits = false
44+
tag_pattern = "v[0-9].*"
45+
sort_commits = "oldest"
46+

0 commit comments

Comments
 (0)