Skip to content

Conversation

@michaelbeutler
Copy link
Contributor

@michaelbeutler michaelbeutler commented Sep 5, 2025

This pull request introduces significant improvements to the development workflow and the TagXLv1Decoder logic. It adds pre-commit and CI enhancements for code quality and security, introduces new YAML linting and secret detection, and extends the decoder to support additional ports and solvers for improved GNSS and WiFi payload handling.

Development workflow and CI enhancements:

  • Added .pre-commit-config.yaml with hooks for Go formatting/linting, YAML linting, and secret detection, and a VSCode task to install pre-commit hooks for consistent local development. [1] [2]
  • Enhanced CI pipeline in .github/workflows/ci.yaml to use Go 1.24, run gofmt, go vet, staticcheck, yamllint, and detect-secrets, and check for uncommitted/generated code. [1] [2] [3] [4]
  • Added .yamllint config for flexible YAML linting suited to the repo’s needs.

Decoder logic improvements:

  • Extended TagXLv1Decoder to support a new v2 solver (SolverV2) and fallback for GNSS NAV grouping ports (192, 193, 194, 195, 199), including context-aware options (DevEUI, counter, port, timestamp, moving). The decoder now prefers v2 solver when available, with fallback to v1 for backward compatibility. [1] [2] [3]
  • Added support for additional ports (193, 198, 200, 201) with appropriate payload configs and features, and improved version handling for existing ports (152, 197). [1] [2] [3] [4]

Testing and deployment:

  • Improved test readiness in cmd/http_test.go by enabling and waiting for the health endpoint, ensuring reliable test execution.
  • Minor YAML formatting updates for deployment consistency.

- Extend default rules to accommodate longer lines for URLs and specific contexts.
- Adjust indentation rules to allow for consistent 2-space indentation.
- Permit truthy values commonly found in configuration files.
- Disable document start marker requirement for all files.
- Allow empty values, which are frequent in Helm templates.
- Relax comment spacing requirements and disable comments indentation.
- Enable Helm template syntax with braces.
- Disable checks for new line at end of file and allow various line endings.
- Allow empty lines at the start of files and be permissive with trailing spaces and comma spacing.
- Introduced Port198Payload struct with versioning and movement indication.
- Updated Port197Payload to include version and moving fields.
- Enhanced decoder logic to handle new payload formats for both ports.
- Added unit tests to validate new payload structures and behaviors.
@michaelbeutler michaelbeutler self-assigned this Sep 5, 2025
@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 85.75419% with 51 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/decoder/tagxl/v1/decoder.go 77.98% 37 Missing and 11 partials ⚠️
pkg/decoder/tagxl/v1/port151.go 0.00% 2 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
pkg/decoder/tagxl/v1/port152.go 97.36% <ø> (ø)
pkg/decoder/tagxl/v1/port193.go 100.00% <100.00%> (ø)
pkg/decoder/tagxl/v1/port197.go 100.00% <100.00%> (ø)
pkg/decoder/tagxl/v1/port198.go 100.00% <100.00%> (ø)
pkg/decoder/tagxl/v1/port200.go 100.00% <100.00%> (ø)
pkg/decoder/tagxl/v1/port201.go 100.00% <100.00%> (ø)
pkg/encoder/nomadxs/v1/encoder.go 100.00% <ø> (ø)
pkg/encoder/smartlabel/v1/encoder.go 100.00% <100.00%> (ø)
pkg/encoder/tagsl/v1/encoder.go 100.00% <ø> (ø)
pkg/solver/solver_v1.go 100.00% <ø> (ø)
... and 3 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@michaelbeutler michaelbeutler linked an issue Sep 5, 2025 that may be closed by this pull request
11 tasks
Copy link
Contributor

@niko-kriznik-globtim niko-kriznik-globtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This (using structures for function parameters) is the way to go for API design.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces new decoder support for TagXL v3.2.0 payload formats and significantly enhances the CI/CD pipeline with pre-commit hooks and quality enforcement. The core focus is adding support for WiFi and GNSS ports in the TagXL decoder while establishing stricter code quality standards.

  • Added support for new WiFi and GNSS payload ports (193, 198, 200, 201) with corresponding payload structures
  • Enhanced CI/CD pipeline with Python tooling, yamllint, detect-secrets, and stricter Go checks
  • Introduced pre-commit hooks for automated code quality enforcement

Reviewed Changes

Copilot reviewed 30 out of 32 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/decoder/tagxl/v1/* Added new port payload structures and decoder logic for ports 193, 198, 200, 201
pkg/solver/loracloud/v2/* New v2 solver implementation with enhanced error handling and metrics
pkg/solver/solver_v2*.go New v2 solver interfaces and test implementations
.github/workflows/ci.yaml Enhanced CI with Python tools, yamllint, detect-secrets, and stricter Go checks
.pre-commit-config.yaml Added pre-commit hooks for code formatting, linting, and security scanning
.yamllint YAML linting configuration
.vscode/tasks.json VS Code task for automatic pre-commit hook installation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
9.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 33 out of 35 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
if len(bytes) < 5 {
return nil, common.ErrPayloadTooShort
}
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp conversion assumes big-endian byte order but this isn't explicitly documented. Consider adding a comment to clarify the expected byte order for the timestamp extraction.

Suggested change
}
}
// The first 4 bytes represent a big-endian unsigned 32-bit timestamp (seconds since epoch).

Copilot uses AI. Check for mistakes.
@michaelbeutler michaelbeutler requested a review from a team September 18, 2025 06:15
@michaelbeutler michaelbeutler marked this pull request as ready for review September 18, 2025 06:15
@michaelbeutler michaelbeutler dismissed niko-kriznik-globtim’s stale review September 19, 2025 08:08

The merge-base changed after approval.

@michaelbeutler michaelbeutler merged commit 8138649 into main Sep 19, 2025
2 of 4 checks passed
@michaelbeutler michaelbeutler deleted the feature/tagxl-v3.2.0 branch September 19, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for new Tag XL uplink payloads (timestamps + new ports)

3 participants