Skip to content

fix(tagxl): classify supported configuration actions - #210

Merged
michaelbeutler merged 3 commits into
feat/tagxl-mixed-configuration-matchfrom
feat/tagxl-configuration-actions
Sep 16, 2026
Merged

michaelbeutler merged 3 commits into
feat/tagxl-mixed-configuration-matchfrom
feat/tagxl-configuration-actions

Conversation

@niko-kriznik-globtim

@niko-kriznik-globtim niko-kriznik-globtim commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Accept Tag XL 0x800x84 and Smart Label v2 0x810x84 in sent fPort-151 payloads.
  • Add AnalyzeConfiguration so the API can tell observable setter/getter requirements from action-only payloads.
  • Keep CompareConfigurationFor and BuildCurrentConfigurationRequest on observable requirements only; action-only still returns the existing no-requirement error.
  • Export Tag S/L sent validators for campaign launch checks.

Closes #209

Tagged as v1.6.0-rc2 for the API follow-up. Do not move v1.6.0-rc1.

Investigation notes

  • Parent PR #208 already added dialect-aware getters/setters and pure-getter verification. It still rejected every action TLV as unsupported.
  • The issue proposed a fourth comparison result. That is unnecessary: sent analysis is the right layer, and getter-only payloads remain observable.
  • Wipe-all 0x84 is accepted even though current firmware has no handler. Campaigns can queue it for delivery; the decoder does not claim the device will run it.
  • Smart Label 0x80 stays rejected. Reset-count verification was not implemented: it does not cover other actions and needs firmware/hardware confirmation.

Dependencies

No protos, common, or Pulse changes.

Test plan

  • gofmt / golangci-lint on changed packages
  • go test ./pkg/decoder/tagxl/v1/ ./pkg/decoder/tagsl/v1/
  • go test ./...
  • CI lint + test matrix on 32b6800
  • Tagged v1.6.0-rc2

Accept Tag XL 0x80-0x83 and Smart Label v2 0x81-0x83 in sent payloads, expose AnalyzeConfiguration for observable vs action-only campaigns, and keep compare/readback on setter and getter requirements only.
Export port-128 and port-134 sent validators so campaign launch can reject malformed Tag S/L payloads without comparing an observed report.
@niko-kriznik-globtim

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 8a77c25e-7113-4172-89e3-328e2a51e534

📥 Commits

Reviewing files that changed from the base of the PR and between 3e4eed8 and 32b6800.

📒 Files selected for processing (3)
  • pkg/decoder/tagxl/v1/configuration_dialect.go
  • pkg/decoder/tagxl/v1/configuration_match_test.go
  • pkg/decoder/tagxl/v1/port151.go

Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The change adds TagSL configuration validators and extends TagXL parsing to recognize supported action commands. TagXL analysis now distinguishes observable requirements from actions while comparison and request building retain setter requirements.

Changes

TagSL validation

Layer / File(s) Summary
TagSL payload validators
pkg/decoder/tagsl/v1/configuration_match.go, pkg/decoder/tagsl/v1/configuration_match_test.go
Adds port-128 and port-8 validators for hex decoding, exact payload length, decoder validation, and invalid payload tests.

TagXL action configuration

Layer / File(s) Summary
Action tags and dialect rules
pkg/decoder/tagxl/v1/port151.go, pkg/decoder/tagxl/v1/configuration_dialect.go
Defines action tag constants and configures supported action argument counts for TagXL and SmartLabel V2.
Action-aware parsing and analysis
pkg/decoder/tagxl/v1/configuration_match.go
Parses supported actions with length and duplicate checks, adds AnalyzeConfiguration, accepts action-only payloads for validation, and rejects them when comparison or request building needs comparable requirements.
Action and analysis coverage
pkg/decoder/tagxl/v1/configuration_match_test.go
Tests supported and unsupported actions, mixed payloads, action-only payloads, dialect restrictions, command limits, response sizing, comparison, and request building.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 32b68

The change supports the declared action payloads and preserves the intended validation and comparison behavior, with no confirmed merge-blocking risk.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue #209 requires a distinct not-verifiable result for a valid action-only payload. The PR accepts and analyzes action-only payloads, validates action length and duplicates, ignores actions for obse… Add a distinct ConfigurationNotVerifiable result, or an equivalent result, for valid action-only comparison payloads. Keep malformed, unknown, duplicate, and unsupported commands as errors. Add or update tests for that result.
Out of Scope Changes check ⚠️ Warning The added pkg/decoder/tagsl/v1 ValidateConfiguration and ValidateBleConfiguration APIs and tests validate Tag S/L port-128 and port-134 payloads. Directly linked issue #209 concerns Tag XL confi… Remove the Tag S/L validator changes from this pull request, or link them to a directly applicable issue and submit them separately.
Docstring Coverage ⚠️ Warning Docstring coverage is 34.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: classifying supported Tag XL configuration actions. It matches the main implementation changes and is concise.
Full details: Linked Issues check

Explanation

Issue #209 requires a distinct not-verifiable result for a valid action-only payload. The PR accepts and analyzes action-only payloads, validates action length and duplicates, ignores actions for observable requirements, supports mixed setter/action comparisons, preserves unknown-tag and duplicate rejection, and supports Tag XL 0x84. However, CompareConfiguration still returns errConfigurationNoSetter for action-only payloads. This does not meet the issue's required comparison outcome. The PR also retains Smart Label 0x80 rejection, as required.

Full details: Out of Scope Changes check

Explanation

The added pkg/decoder/tagsl/v1 ValidateConfiguration and ValidateBleConfiguration APIs and tests validate Tag S/L port-128 and port-134 payloads. Directly linked issue #209 concerns Tag XL configuration comparison and Tag XL action TLVs. The summary provides no coding requirement in #209 that requires Tag S/L validators. These changes are unrelated to the linked issue scope.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tagxl-configuration-actions

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 93.33333% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/decoder/tagxl/v1/configuration_dialect.go 50.00% 1 Missing and 1 partial ⚠️
pkg/decoder/tagxl/v1/configuration_match.go 95.00% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
pkg/decoder/tagsl/v1/configuration_match.go 93.75% <100.00%> (+1.25%) ⬆️
pkg/decoder/tagxl/v1/port151.go 90.84% <ø> (ø)
pkg/decoder/tagxl/v1/configuration_dialect.go 89.28% <50.00%> (-3.17%) ⬇️
pkg/decoder/tagxl/v1/configuration_match.go 90.52% <95.00%> (+2.15%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Allow 0x84 on Tag XL and Smart Label v2 so campaigns can queue the declared wipe-all command before firmware implements it.
@niko-kriznik-globtim

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@niko-kriznik-globtim
niko-kriznik-globtim marked this pull request as ready for review September 16, 2026 10:59
@niko-kriznik-globtim

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@niko-kriznik-globtim

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@michaelbeutler
michaelbeutler merged commit d1cb0b3 into feat/tagxl-mixed-configuration-match Sep 16, 2026
9 checks passed
@michaelbeutler
michaelbeutler deleted the feat/tagxl-configuration-actions branch September 16, 2026 13:30
michaelbeutler pushed a commit that referenced this pull request Sep 17, 2026
Land the #210 squash on main. The original PR was merged into the
already-merged parent branch, so action analysis never reached main.
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.

3 participants