Skip to content

Move TagoTiP to a standalone top-level client - #69

Open
RicardoStoklosa wants to merge 1 commit into
mainfrom
feat/tagotip-standalone-v2
Open

Move TagoTiP to a standalone top-level client#69
RicardoStoklosa wants to merge 1 commit into
mainfrom
feat/tagotip-standalone-v2

Conversation

@RicardoStoklosa

Copy link
Copy Markdown
Member

Summary

Move TagoTiP out of Services into a standalone top-level client. It is constructed directly with a Service Authorization token and exported at the package top level (from tagoio_sdk import TagoTiP); tagotip.cmd({serial, protocol, body}) wraps POST /tip/cmd. Services defaults its token to the analysis token, so TagoTiP must not live under it. This supersedes the services.tagotip shape merged in #67 and matches tago-io/sdk-js#185.

Why

#67 attached TagoTiP to Services, which injects the analysis token by default. TagoTiP needs a Service Authorization token supplied at construction, so it belongs as its own top-level client.

Test plan

  • Unit test in tests/TagoTiP/test_tagotip.py (asserts request body, response, and token header)
  • uv run pytest tests/ passes (210 tests)
  • uv run ruff check clean on the new module and test
  • Import smoke: TagoTiP exported at top level, Services no longer exposes tagotip
  • Manual: ran TagoTiP({"token": "<service-auth>"}).cmd({"serial": "mqtt1", "protocol": "mqtt", "body": "reboot-now"}) against the production API, response Command sent

Breaking changes

services.tagotip.cmd(...) (from #67, unreleased) is removed. Use TagoTiP({"token": "<service-authorization-token>"}).cmd(...) instead.

Risk (CIA)

Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low
Reshapes an unreleased API added in #67; no released behavior touched.

Replace the Services.tagotip service (added in #67) with a standalone TagoTiP client constructed directly with a Service Authorization token and exported at the package top level. Services defaults its token to the analysis token, so TagoTiP must not live under it. Matches tago-io/sdk-js#185.

@FabianoEger FabianoEger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Block
Standalone client is the right shape; 5.1.5 already shipped services.tagotip and the description calls #67 unreleased.

Description alignment

Gaps

  • PR description > Migration: Breaking changes names the replacement in one line; there is no Migration section with the before/after call.

Stale

  • PR description > Breaking changes: says #67, unreleased. tagoio-sdk==5.1.5 is on PyPI (2026-08-18) and the v5.1.5 release notes list #67.
  • PR description > Risk (CIA): "no released behavior touched" is false; 5.1.5 includes self.tagotip.

Rewrite the PR description with /tagoio:pr-and-issue-descriptions.

In this PR

TagoTiP as a top-level client matches the Service Authorization token. 5.1.5 already published the Services member.

Blockers

  • PR description > Breaking changes: drop "unreleased"; 5.1.5 shipped services.tagotip.
  • PR description > Risk (CIA): drop "no released behavior touched".

Questions

  • pyproject.toml:7: 5.1.6 is a patch. Confirm a same-day correction of 5.1.5, or bump to a major.

Improvements

  • tests/TagoTiP/test_tagotip.py:6: consider asserting Services no longer exposes tagotip.
  • docs/source/TagoTiP/index.rst:13: prefer eu-w1 over ue-w1 on this new page.

Praise

  • The test checks the token header, not only the JSON body.

Risk (CIA)

Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low.
Confirmed. 5.1.5 is same-day; values stay Low once the description names the published removal.

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.

2 participants