Skip to content

feat: Unity extended values on every model, in post and term meta - #92

Merged
crazeydave merged 1 commit into
mainfrom
feat/extended-values-all-models
Nov 30, 2026
Merged

crazeydave merged 1 commit into
mainfrom
feat/extended-values-all-models

Conversation

@crazeydave

Copy link
Copy Markdown
Contributor

Implements Unity's extended values on the rest of TSML's models: needs bleedingdeacons/unity#84.

  • TsmlGroup, TsmlMeeting, TsmlPosition, TsmlLocation, TsmlIntergroupMeeting keep values in post meta; TsmlCommittee in term meta. Same format as members: unity_kv_<Key>, case kept, read and written on every call.
  • New src/ExtendedValues/: ExtendedValueMeta (format, meta_query clause, read-back rules) and the PostMetaExtendedValues / TermMetaExtendedValues traits. TsmlMember now uses the post trait; TsmlMemberFields::EXTENDED_VALUE_META_PREFIX stays as an alias.
  • Each repository's findByValue() asks for two and answers null unless exactly one carries the value. The post repositories limit with posts_per_page: their defaults set it, so get_posts() would ignore numberposts. Committees use get_terms() with number.

Order

Merge and deploy after Unity #84 (released as 2.100.1); TSML's new classes fatal against an older Unity. Releases as 2.2.0 (feat:).

Checks

  • ci-local tsml-for-unity (PHP 8.4, Docker, against the Unity branch): passed.
  • New tests/Unit/ExtendedValuesTest.php: both traits through every model, and findByValue() through every repository (found, two carriers, empty value, bad key). Existing member tests pass unchanged.

Implements Unity's KeyValueStoreInterface on TsmlGroup, TsmlMeeting,
TsmlPosition, TsmlLocation, TsmlIntergroupMeeting and TsmlCommittee, and
ValueLookup::findByValue() on their repositories.

- ExtendedValueMeta holds the storage format (`unity_kv_<Key>`, case kept),
  the meta_query clause and the read-back rules, once.
- PostMetaExtendedValues keeps the values in post meta, lifted from
  TsmlMember, which now uses it too. TermMetaExtendedValues does the same in
  term meta for committees. Both read and write on every call, so values
  stay out of the immutable snapshots and the caches.
- Each findByValue() asks for two matches and answers null unless exactly
  one carries the value. The post repositories pass posts_per_page, since
  their defaults set it and get_posts() then ignores numberposts. The
  committee repository passes number to get_terms().

TsmlMemberFields::EXTENDED_VALUE_META_PREFIX stays, now an alias of
ExtendedValueMeta::PREFIX.

Needs the Unity release that adds these contracts (2.100.1); the two ship
and deploy together.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3cf00e5f-4d01-4744-96fe-afb5dbd974f3
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@crazeydave
crazeydave merged commit a83ac34 into main Nov 30, 2026
5 checks passed
@crazeydave
crazeydave deleted the feat/extended-values-all-models branch November 30, 2026 22:41
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.

1 participant