Skip to content

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 28 May 18:09
· 15 commits to main since this release
d5f6cda

Migrating to inorbit-connector-python v3.0.0

Breaking Changes

1. ConnectorConfig renamed to ConnectorRootConfig and migrated to BaseSettings (#75)

ConnectorConfig is now ConnectorRootConfig and inherits from pydantic-settings BaseSettings instead of BaseModel. Environment variables (INORBIT_*) are resolved at instantiation time via pydantic-settings — no more manual os.getenv() or load_dotenv() workarounds.

pydantic-settings is now a required dependency (>=2.14,<3.0).

# Before (v2.x)
from inorbit_connector.models import ConnectorConfig

class MyConnectorConfig(ConnectorConfig):
    connector_config: MyConfig

# After (v3.0)
from inorbit_connector.models import ConnectorRootConfig

# Option A: parametrize directly (no subclass needed)
config = ConnectorRootConfig[MyConfig](**yaml_data)

# Option B: subclass if you need custom validators
class MyConnectorConfig(ConnectorRootConfig[MyConfig]):
    ...

2. New ConnectorSpecificConfig base class for vendor config (#75)

Per-connector settings now subclass ConnectorSpecificConfig (a BaseSettings subclass) instead of plain BaseModel. Set the CONNECTOR_TYPE class variable to get automatic env-var loading with prefix INORBIT_{CONNECTOR_TYPE}_.

# Before (v2.x)
from pydantic import BaseModel

class MyConfig(BaseModel):
    my_api_version: str

# After (v3.0)
from inorbit_connector.models import ConnectorSpecificConfig

class MyConfig(ConnectorSpecificConfig):
    CONNECTOR_TYPE = "my_connector"
    my_api_version: str
    # Reads from INORBIT_MY_CONNECTOR_MY_API_VERSION env var automatically

3. connector_type identity enforcement (#76)

ConnectorRootConfig now validates at instantiation that connector_type in the YAML matches the CONNECTOR_TYPE class variable declared in your ConnectorSpecificConfig subclass. A mismatch raises ValidationError.

connector_type is also auto-injected into every publish_robot_key_values() call, so the platform can identify which connector drives each robot.

4. Environment variables renamed — aligns with inorbit-edge v3 (#77)

The old INORBIT_API_URL was ambiguous. New naming matches inorbit-edge v3:

Old New Purpose
INORBIT_API_URL INORBIT_CONNECTION_CONFIG_URL MQTT configuration endpoint
INORBIT_REST_API_URL INORBIT_API_URL REST API endpoint

The Python field api_url on ConnectorRootConfig is renamed to connection_config_url. A new api_url field points to the REST API (defaults to https://api.inorbit.ai).

No fallback to old names — setting the old env vars has no effect.

# Before (v2.x config/.env)
INORBIT_API_URL=https://custom-config.example.com/cloud_sdk_robot_config
INORBIT_REST_API_URL=https://custom-api.example.com

# After (v3.0 config/.env)
INORBIT_CONNECTION_CONFIG_URL=https://custom-config.example.com/cloud_sdk_robot_config
INORBIT_API_URL=https://custom-api.example.com

5. account_id field removed (#77)

ConnectorRootConfig.account_id is removed. The account ID is now lazily fetched by inorbit-edge v3 via the REST API and cached.

# Before (v2.x)
config = ConnectorConfig(account_id="acct123", ...)

# After (v3.0)
config = ConnectorRootConfig(...)  # account_id resolved automatically

6. InorbitConnectorConfig removed (#69)

The deprecated single-robot config class InorbitConnectorConfig has been removed. Use ConnectorRootConfig with a fleet list instead.

# Before (v2.x)
from inorbit_connector.models import InorbitConnectorConfig
config = InorbitConnectorConfig(robot_id="r1", ...)

# After (v3.0)
from inorbit_connector.models import ConnectorRootConfig, RobotConfig
config = ConnectorRootConfig[MyConfig](
    fleet=[RobotConfig(robot_id="r1", ...)],
    ...
)

7. ConnectorConfig.log_level removed (#70)

The deprecated top-level log_level field (deprecated since v1.1.0) is removed. Use logging.log_level instead. ConnectorRootConfig now uses extra="ignore" via pydantic-settings, so stale fields in YAML won't error — but the value will be silently ignored.

# Before (v2.x)
log_level: DEBUG

# After (v3.0)
logging:
  log_level: DEBUG

8. Connector._robot_session property removed (#71)

The deprecated _robot_session property is removed. Use _get_session() instead.

# Before (v2.x)
session = self._robot_session

# After (v3.0)
session = self._get_session()

9. read_yaml() no longer accepts robot_id (#72)

The deprecated robot_id parameter on utils.read_yaml() is removed. The function now always returns the full dict.

# Before (v2.x)
data = read_yaml("config.yaml", robot_id="r1")

# After (v3.0)
data = read_yaml("config.yaml")
robot_data = data["r1"]  # index manually

10. Command re-exports removed from inorbit_connector.connector (#73)

CommandFailure, CommandResultCode, and parse_custom_command_args are no longer re-exported from inorbit_connector.connector. Import from inorbit_connector.commands instead.

# Before (v2.x)
from inorbit_connector.connector import CommandFailure, parse_custom_command_args

# After (v3.0)
from inorbit_connector.commands import CommandFailure, parse_custom_command_args

11. inorbit-edge dependency bumped to v3 (#77)

inorbit-edge is now >=3.0,<4.0. See inorbit-edge v3.0.0 migration guide for edge-sdk specific changes. Key edge-sdk breaks that may surface in connector code:

  • RobotSession no longer accepts account_id
  • INORBIT_REST_API_URL constant renamed to INORBIT_DEFAULT_API_URL

12. Credential validation at instantiation (#75)

ConnectorRootConfig now requires at least one of api_key or inorbit_robot_key. If neither is set (via init kwargs, env vars, or dotenv), a ValidationError is raised immediately instead of a confusing 403 at runtime.