[COMMS-934] Adjust WorkPackageAtTimestampRepresenter with target_versions - #24642
Merged
akabiru merged 9 commits intoAug 7, 2026
Conversation
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
akabiru
marked this pull request as ready for review
August 7, 2026 09:58
Historic work packages now load target_versions from the journal snapshots, and baseline change detection derives version changes from the target version sets instead of the deprecated version_id mirror.
The attributesByTimestamp entries now include the targetVersions links when the target version set changed between the compared timestamps.
When the only requested timestamp is historic, the work package renders with its attributes of that time; the target_versions association now follows along instead of exposing the current join rows.
Version snapshots have no foreign key so they outlive deleted versions; resolving those rows yielded nils that crashed the association loading.
The nil-vs-empty-hash sentinel conflated class capability with per-record emptiness; the guard now runs once per load instead of per record.
Change detection was only tested in the additive direction; add removal of a secondary version, removal of all versions, and the empty-set targetVersions render.
The rename in at_timestamp put the method on dirty-rubocop's radar; the attribute hash assembly moves to its own helper.
The primary-version notion is only inferred during the migration period; describe scenarios via the single-value version field instead.
akabiru
force-pushed
the
implementation/comms-934-adjust-workpackageattimerepresenter-with-target_verisons
branch
from
August 7, 2026 10:04
fac1a39 to
eb7e12a
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
brunopagno
approved these changes
Aug 7, 2026
brunopagno
left a comment
Contributor
There was a problem hiding this comment.
I did not test locally, but the the code looks great. Not a big change. Great job keeping it concise. 🎉
Comment on lines
+122
to
+134
| def historic_attributes(journal, timestamp) | ||
| attributes = journal.data.attributes.merge( | ||
| "id" => id, | ||
| "created_at" => created_at, | ||
| "updated_at" => journal.updated_at, | ||
| "timestamp" => timestamp, | ||
| "journal_id" => journal.id | ||
| ) | ||
| self.class.column_names_missing_in_journal.each do |missing_column_name| | ||
| attributes[missing_column_name] = nil | ||
| end | ||
| attributes | ||
| end |
akabiru
deleted the
implementation/comms-934-adjust-workpackageattimerepresenter-with-target_verisons
branch
August 7, 2026 14:34
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
https://community.openproject.org/wp/COMMS-934
Introduce targetVersions to WorkPackageAtTimestampRepresenter which is primarily used for the Baseline comparison feature. It only adds a multi-value
targetVersionsnode and retains the backwards compatible single-valueversionsas per agreed convention to avoid breaking existing consumers.