Align with TEA spec: missing endpoints, artifact URL fix, v0.5.1#15
Conversation
… v0.5.1
Fix get_artifact() to hit /artifact/{uuid}/latest (spec-correct path).
Add get_artifact_version() for /artifact/{uuid}/{version}.
Add list/search endpoints for components and component releases with
pagination models, CLI commands, rich formatters, and iterator helpers.
Add ComplianceDocumentType enum (20 values) and COMPLIANCE_DOCUMENT
identifier type. Add Artifact.version and Artifact.created_date fields.
Add WARN status to conformance framework with artifact_formats_required
check. Update all docs to reflect 27 conformance checks and new commands.
877 tests, 95% coverage, ruff/mypy clean.
d5d68a1 to
ef64090
Compare
There was a problem hiding this comment.
Pull request overview
This PR bumps libtea to v0.5.1 and expands the client/CLI/conformance suite to support component search/list pagination, artifact version retrieval, and a new conformance “WARN” status for non-fatal findings.
Changes:
- Add paginated component/component-release response models plus client methods & iterators for
/componentsand/componentReleases. - Update artifact retrieval to use
/artifact/{uuid}/latest, addget_artifact_version(), and add artifact version validation + model fields. - Introduce conformance
WARNstatus (including a new artifact formats warning check) and update CLI/docs/tests accordingly.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates locked version metadata for libtea to 0.5.1. |
| pyproject.toml | Bumps project version to 0.5.1. |
| src/libtea/models.py | Adds ComplianceDocumentType, artifact version/created_date, and paginated component response models. |
| src/libtea/_validation.py | Adds _validate_artifact_version() helper. |
| src/libtea/client.py | Adds component list/search APIs + iterators; changes get_artifact() to /latest; adds get_artifact_version(). |
| src/libtea/_cli_fmt.py | Adds formatters for component searches; updates conformance output to include WARN; expands pagination header typing. |
| src/libtea/cli.py | Adds search-components, search-component-releases, and get-artifact-version commands; updates get-artifact wording. |
| src/libtea/init.py | Exposes new models via the lazy-import public API. |
| src/libtea/conformance/_types.py | Adds CheckStatus.WARN and ConformanceResult.warned. |
| src/libtea/conformance/_checks.py | Adds _warn() helper and new check_artifact_formats_required check; registers it in ALL_CHECKS. |
| src/libtea/conformance/init.py | Updates example output to include warned count. |
| src/libtea/conformance/plugin.py | Treats WARN as a pytest warning (instead of pass/fail/skip only). |
| tests/unit/test_version.py | Ensures new pagination models are importable and exposed via lazy imports. |
| tests/unit/test_validation.py | Adds unit tests for _validate_artifact_version(). |
| tests/unit/test_models.py | Adds model tests for new enums and paginated component responses; extends artifact optional-field assertions. |
| tests/unit/test_conformance_types.py | Verifies ConformanceResult.warned counting. |
| tests/unit/test_conformance_runner.py | Updates total-count assertion to include warned results. |
| tests/unit/test_conformance_checks.py | Updates artifact endpoint expectations to /latest; adds tests for the new WARNing conformance check. |
| tests/client/test_iterators.py | Adds iterator tests for components and component releases; updates artifact fetch URL to /latest. |
| tests/client/test_client.py | Adds client tests for components/component-releases; adds artifact version tests; updates artifact /latest URL. |
| tests/cli/test_cli.py | Adds CLI tests for new component search + artifact version; updates artifact /latest URL. |
| tests/cli/test_cli_fmt.py | Adds formatter tests for new component search outputs; updates console width; adds (currently weak) artifact “version” formatter tests. |
| docs/FUTURE.md | Notes new artifact formats conformance check and adds a future item for component conformance checks. |
| docs/conformance.md | Updates docs for 27 checks and introduces WARN status description. |
| docs/cli.md | Documents new CLI commands and updates conformance check count / get-artifact wording. |
| CLAUDE.md | Updates documentation about conformance check count (26 → 27). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…sion rendering - Fix "one of three statuses" → "one of four statuses" in conformance.md - Change warnings.warn stacklevel from 1 to 2 in conformance plugin so warnings point at the test call site, not the plugin internals - Add version and created_date rendering to fmt_artifact panel - Fix misleading test names and assertions to actually verify version field presence/absence in the rendered output
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Add list_components, search_components, list_component_releases, search_component_releases, get_artifact_version, iter_components, and iter_component_releases to the protocol so downstream type-checking and mocking stays in sync with TeaClient.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Summary
get_artifact()URL: changed from/artifact/{uuid}(not in spec) to/artifact/{uuid}/latestget_artifact_version(): new endpoint for/artifact/{uuid}/{version}list_components(),search_components(),list_component_releases(),search_component_releases()with pagination models, CLI commands, rich formatters, and auto-paginating iteratorsComplianceDocumentTypeenum (20 values) andCOMPLIANCE_DOCUMENTidentifier type per specArtifact.versionandArtifact.created_datefields from specWARNstatus to conformance framework withcheck_artifact_formats_required(27 checks total)All 23 consumer endpoints in the TEA OpenAPI spec now have corresponding client methods.
Changes by layer
PaginatedComponentResponse,PaginatedComponentReleaseResponse,ComplianceDocumentType,Artifact.version,Artifact.created_datesearch-components,search-component-releases,get-artifact-versionfmt_search_components,fmt_search_component_releases, WARN stylingcheck_artifact_formats_requiredTest plan
ruff check .cleanruff format --check .cleanmypyclean