New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation/45801 api with subset representer #12107
Implementation/45801 api with subset representer #12107
Conversation
to decorate work packages with historic attributes and meta information. #11783
…interpreted as null #11243
…ttributes_by_timestamp` #11783 (comment)
…tionRepresenter` #11783
…ugh eager-loading wrapper #11783
… work package representer #11783
…perties only when they are present #11783
…now` is queried because this is the default case when no timestamp is given #11783
…k package matches the query filters #11783
…iven Otherwise, there are not filters to match and this field is meaningless. #11783
…ngle object and multiple objects #11783
…filters_at_timestamps` #11783
…ith the query params #11783
…nged_attributes: true` for api requests #11783
which should be plural because there can be several filters in the query. #11783
… initializer as suggested in review: #11783 (comment)
…equested at which the work package does not exist #11783
The additional properties are already marked with `uncacheable: true`. Re-enabling caching for certain scenarios is a follow-up step: fiedl#4 #11783 (comment)
as requested in review by Jens Ulferts: #11783 (comment)
…801-api-with-subset-representer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
||
it_behaves_like 'transforms' do | ||
let(:params) { { timestamps: "-1y, now" } } | ||
let(:expected) { { timestamps: [Timestamp.new("P-1Y"), Timestamp.parse("P-0Y")] } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is why you delegated the Timestamp#hash
method :) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it for the memoization where a timestamp is the hash key
I did not know that was necessary before stumbling over this. With it I can do
pry(main)> { Timestamp.now => 1}[Timestamp.now]
=> 1
Without it it would be
pry(main)> { Timestamp.now => 1}[Timestamp.now]
=> nil
… yet Those specs added in #9afa928 were accidentally deleted when merging
@fiedl I think I addressed or commented on all your remarks. Could you please take another look? |
Thanks, very nice! |
Builds on #11783 which in turn builds on #11678 and contains their commits.
The goal of this PR is to:
attributesByTimestamp
property of theWorkPackage
resource rendered according to the prototypical readout in Baseline-comparison API #11783 (https://community.openproject.org/wp/46263)_links
section.api/v3/work_packages?timestamps=2023-01-31T00:00:00Z,PT0S
) is minimized. To that end, the eager loading wrapper needs to be adapted. (https://community.openproject.org/wp/46262)