[#74418] Normalize Formattable custom fields on read - #19
Open
myabc wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the work package inspect JSON payload construction to normalize Formattable custom field values from {format, raw, html} objects into their raw markdown string, aligning the read shape with the existing raw-text write contract (similar to how description is already flattened).
Changes:
- Normalize Formattable custom field values to raw strings when building
WorkPackageDetails.Fields. - Add targeted inspect tests covering Formattable normalization, pass-through behavior for non-Formattable dict fields, already-string values, and empty custom field maps.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| components/resources/work_packages/details.go | Adds schema-driven normalization so Formattable custom fields are flattened to raw markdown strings in the inspect payload. |
| components/resources/work_packages/details_test.go | Adds regression tests ensuring normalization happens only for Formattable fields and does not affect other field shapes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Formattable custom field values in inspect payloads collapse to their raw markdown text, so reads round-trip cleanly with the raw-text write contract. https://community.openproject.org/wp/CLI-15
myabc
force-pushed
the
feature/CLI-15-formattable-read
branch
from
July 27, 2026 07:37
7ddbd1b to
bfae423
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was authored by an agent on behalf of @myabc.
Ticket
https://community.openproject.org/wp/CLI-15
What are you trying to accomplish?
Inspect payloads currently return Formattable custom field values as
{format, raw, html}objects, which does not round-trip against the raw-text write contract used elsewhere (e.g. description).What approach did you choose and why?
Normalize Formattable custom field values to their raw markdown string when building the work package details payload, using the schema to identify which fields are Formattable. This mirrors how
descriptionis already flattened to raw text.This PR is stacked on #18 and should merge after it.