Skip to content

Expose and accept version coauthor information#1928

Draft
fashxp wants to merge 7 commits into
2026.xfrom
feat/version-coauthor
Draft

Expose and accept version coauthor information#1928
fashxp wants to merge 7 commits into
2026.xfrom
feat/version-coauthor

Conversation

@fashxp

@fashxp fashxp commented Jul 2, 2026

Copy link
Copy Markdown
Member

!!! DO NOT MERGE BEFORE 2026.2 release

Summary

Exposes the new core version coauthor fields (coauthorType, coauthor) in the versions API and lets clients set them on element saves and on existing versions.

Depends on pimcore/pimcore#19235 — draft until that merges (CI installs pimcore/pimcore from Packagist and needs Pimcore\Model\Version\CoauthorContextInterface).

Changes

  • Version listing schema + VersionHydrator: optional nullable coauthorType/coauthor (NOT added to required — additive, BC-safe). First unit test for the Version module (VersionHydratorTest).
  • Save/patch payloads accept optional coauthorType/coauthor keys (same pattern as task): UpdateService/PatchService inject CoauthorContextInterface and run the save inside an active context, snapshot-and-restoring any outer context in finally. New typed constants on ElementSaveServiceInterface; OpenAPI Property declarations on the five update/patch request bodies.
  • PUT /versions/{id} accepts optional coauthorType/coauthor (like note/public); empty string clears the field.

Verification

  • Full Codeception Unit suite green (423 tests) incl. 2 new.
  • Live-verified on the enterprise demo: payload-key save stamped the version row, GET /versions/{elementType}/{id} returns the fields, PUT /versions/{id} sets and clears them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SsEa2MTm2gRPyGEdHGnnoF

@codacy-production

codacy-production Bot commented Jul 2, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 1 medium · 24 minor

Results:
25 new issues

Category Results
BestPractice 1 minor
CodeStyle 23 minor
Complexity 1 medium

View in Codacy

🟢 Metrics 63 complexity

Metric Results
Complexity 63

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@fashxp

fashxp commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

CI status confirmed: all failing checks (PHPStan matrix, Codeception matrix, Sonar analysis) fail solely on unknown class Pimcore\Model\Version\CoauthorContextInterface — CI installs pimcore/pimcore from Packagist, which does not yet contain pimcore/pimcore#19235. No failures originate from this PR's own code (local: full Unit suite green, PHPStan clean, cs-fixer clean). Re-run after the core PR merges.

fashxp and others added 2 commits July 2, 2026 11:38
Drop the redundant "(e.g. agent)" concat from the coauthorType OpenAPI
descriptions (the Property already carries example: 'agent') and shorten
the previousCoauthorContext locals to coauthorSnapshot, keeping both the
line length and PHPMD's variable-length rule happy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SsEa2MTm2gRPyGEdHGnnoF
Cover UpdateService::update() coauthor-context wiring end to end through
the public API with a real Pimcore\Model\Version\CoauthorContext: payload
keys activate the context only for the duration of the save, empty/partial
keys never activate it, an outer context is overridden during save and
restored exactly afterwards, and the context is still restored when save()
throws.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SsEa2MTm2gRPyGEdHGnnoF
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
26.1% Duplication on New Code

See analysis details on SonarQube Cloud

@fashxp fashxp added this to the 2026.3.0 milestone Jul 2, 2026
@fashxp fashxp requested a review from lukmzig July 2, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant