Skip to content

Align with TEA spec v0.4.0#11

Merged
vpetersson merged 6 commits intosbomify:masterfrom
aurangzaib048:feat/tea-spec-0.4.0
Mar 10, 2026
Merged

Align with TEA spec v0.4.0#11
vpetersson merged 6 commits intosbomify:masterfrom
aurangzaib048:feat/tea-spec-0.4.0

Conversation

@aurangzaib048
Copy link
Copy Markdown
Collaborator

Summary

  • Update TEA_SPEC_VERSION from 0.3.0-beta.2 to 0.4.0
  • Add Artifact.distribution_ids (array of UUIDs, replaces distribution_types in spec v0.4.0; both kept for backward compat with older servers)
  • Add ReleaseDistribution.distribution_id (required in v0.4.0, optional here for pre-0.4.0 backward compat)
  • Document CLE event ordering requirement (descending by id per spec)
  • Update all version references across docs, tests, and CLAUDE.md
  • Add 5 tests for new v0.4.0 fields and backward compatibility

Backward compatibility

  • Version negotiation in discovery auto-downgrades to older servers (SemVer match)
  • Old model fields (distribution_types, distribution_type) retained alongside new ones
  • New fields are optional so pre-0.4.0 server responses still parse cleanly
  • Auth error failover (401/403) already correctly handled — no change needed

Test plan

  • All 823 tests pass
  • mypy strict passes
  • ruff lint + format clean
  • New fields parse from JSON correctly
  • Old servers without new fields still work (backward compat tests)

- Update TEA_SPEC_VERSION from 0.3.0-beta.2 to 0.4.0
- Add Artifact.distribution_ids (replaces distribution_types in spec v0.4.0,
  both kept for backward compatibility with older servers)
- Add ReleaseDistribution.distribution_id (required in v0.4.0, optional here
  for backward compatibility with pre-0.4.0 servers)
- Document CLE event ordering requirement (descending by id per spec)
- Update all version references across docs, tests, and CLAUDE.md
- Add 5 tests for new v0.4.0 fields and backward compatibility
Copilot AI review requested due to automatic review settings March 9, 2026 13:04
Copy link
Copy Markdown

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

Updates libtea to align its default behavior and documentation with TEA spec v0.4.0, while adding model fields and tests to preserve backward compatibility with pre-v0.4.0 servers.

Changes:

  • Bump default TEA_SPEC_VERSION to 0.4.0 and update version references across docs/tests.
  • Add v0.4.0 model fields: Artifact.distribution_ids and ReleaseDistribution.distribution_id (keeping legacy fields for backward compatibility).
  • Add tests covering parsing of the new fields and compatibility with older server payloads.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
uv.lock Updates locked editable package version metadata.
tests/client/test_discovery.py Updates discovery/version negotiation tests to use 0.4.0.
tests/client/test_client.py Adds tests for new v0.4.0 model fields and backward compatibility.
tests/cli/test_cli_fmt.py Updates CLI formatting test fixture version strings.
tests/cli/test_cli.py Updates CLI discovery tests to use 0.4.0 URLs.
src/libtea/models.py Adds new v0.4.0 fields and updates related docstrings.
src/libtea/client.py Bumps TEA_SPEC_VERSION default to 0.4.0.
docs/cli.md Updates CLI documentation to reference v0.4.0.
README.md Updates README version references/examples to v0.4.0.
CLAUDE.md Updates project overview TEA version reference to v0.4.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/client/test_discovery.py Outdated
Comment thread tests/client/test_discovery.py Outdated
Comment thread tests/client/test_discovery.py Outdated
Comment thread src/libtea/models.py
Comment thread src/libtea/models.py
Comment thread src/libtea/models.py
Comment thread tests/client/test_client.py Outdated
…RE.md

Update _cli_fmt.py to prefer distribution_id over distribution_type and
distribution_ids over distribution_types in all four rendering paths
(model-based and dict-based). Add tests for empty distributionIds array,
old+new field coexistence, and formatter v0.4.0 field display. Track
deprecation warnings and conformance checks in FUTURE.md.
… UUID fixtures

- Rename test_semver_matches_with_prerelease → test_semver_exact_match and
  add test_semver_prerelease_exact_match for true prerelease matching
- Rename test_prerelease_compatibility → test_release_client_downgrades_to_prerelease_server
  and test_prerelease_same_minor → test_release_client_compatible_with_older_prerelease_server
- Add test_prerelease_client_downgrades_to_prerelease_server for prerelease-to-prerelease
- Clarify ReleaseDistribution and Artifact docstrings to explicitly state
  fields are kept optional in the model for backward compatibility
- Replace placeholder IDs ("abc", "id-1", "d-1") with UUID-shaped strings
  in TestSpecV040Fields
Copilot AI review requested due to automatic review settings March 9, 2026 13:23
Copy link
Copy Markdown

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 11 out of 12 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libtea/_cli_fmt.py Outdated
Comment thread src/libtea/_cli_fmt.py Outdated
Comment thread src/libtea/_cli_fmt.py
…t table header

- Use `is not None` checks instead of `or` for distribution_ids/distributionIds
  fallback so an explicitly empty v0.4.0 list does not fall through to legacy
  distribution_types (empty tuple is falsy in Python)
- Change inspect distributions table header from "Type" to "ID / Type" to
  match the model-based _distributions_table
- Add test_artifacts_table_empty_distribution_ids_no_fallback to verify
  empty distribution_ids does not fall back to legacy field
Verify backward compatibility across all three server scenarios:
- Pre-v0.4.0 server (distributionType only) — existing test
- v0.4.0 server (distributionId/distributionIds) — new
- Transitional server (both old and new fields) — new
Copilot AI review requested due to automatic review settings March 9, 2026 13:34
Copy link
Copy Markdown

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 12 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/integration/test_integration.py
Comment thread docs/FUTURE.md Outdated
- Fix 11.0.6 → 11.0.7 version mismatch in TOMCAT_RELEASE and
  TOMCAT_RELEASE_V040 fixture PURLs and URLs (release is 11.0.7)
- Improve FUTURE.md Publisher API serialization note: use by_alias=True,
  explicitly exclude deprecated fields, gate by negotiated spec version
Copy link
Copy Markdown

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 12 out of 13 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.

@vpetersson vpetersson merged commit c671631 into sbomify:master Mar 10, 2026
13 checks passed
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