Content
View differences
Updated by Kabiru Mwenja 3 days ago
Follows ###COM-878 Follows ###COM-878
While the _WorkPackageMultipleVersions_ feature is flag-gated, only one of version / target\_versions is offered at a time (target\_versions with the feature on, the deprecated single version off). To keep legacy type form configurations rendering correctly across a flag toggle, _Type::AttributeGroups#custom\_attribute\_groups_ resolves the stored key to the currently offered one on every read (see COMMS-878, [PR #24364](https://github.com/opf/openproject/pull/24364#issuecomment-5045189459)).
This is intentional best-effort support: the stored value is flag-independent, so a type that is never re-saved keeps its original key (version) in attribute\_groups indefinitely, and the read-time shim stays on the render path for as long as the flag exists. A data migration was deliberately not done during COMMS-878 because, while both feature states are supported, any rename breaks the state it does not migrate for.
* [ ] \- Add a data migration normalizing stored version -> target\_versions in types.attribute\_groups.
* [ ]
\- Remove the read-time resolution in Type::AttributeGroups#custom\_attribute\_groups.
* [ ]
\- Remove the parallel flag gate in Type::Attributes#excluded\_version\_attribute? and any other version / target\_versions conditional offering (form config, query columns, help text).
* [ ]
\- Confirm no consumer still reads the pre-normalization key.
_**Acceptance criteria**_
\- No version (attribute) references remain in stored type configurations after the migration.
\- The compatibility shims are gone and the form config renders target\_versions unconditionally.
_**References**_
\- app/models/type/attribute\_groups.rb (custom\_attribute\_groups)
\- app/models/type/attributes.rb (excluded\_version\_attribute?)
While the _WorkPackageMultipleVersions_ feature is flag-gated, only one of version / target\_versions is offered at a time (target\_versions with the feature on, the deprecated single version off). To keep legacy type form configurations rendering correctly across a flag toggle, _Type::AttributeGroups#custom\_attribute\_groups_ resolves the stored key to the currently offered one on every read (see COMMS-878, [PR #24364](https://github.com/opf/openproject/pull/24364#issuecomment-5045189459)).
This is intentional best-effort support: the stored value is flag-independent, so a type that is never re-saved keeps its original key (version) in attribute\_groups indefinitely, and the read-time shim stays on the render path for as long as the flag exists. A data migration was deliberately not done during COMMS-878 because, while both feature states are supported, any rename breaks the state it does not migrate for.
* [ ]
* [ ]
\-
* [ ]
\-
* [ ]
\-
_**Acceptance criteria**_
\- No version (attribute) references remain in stored type configurations after the migration.
\- The compatibility shims are gone and the form config renders target\_versions unconditionally.
_**References**_
\- app/models/type/attribute\_groups.rb (custom\_attribute\_groups)
\- app/models/type/attributes.rb (excluded\_version\_attribute?)