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.
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
Manager: Add tags property to GroupEntry objects #29672
Manager: Add tags property to GroupEntry objects #29672
Changes from 3 commits
5f21921
103c6b2
247e65c
2a2c8f2
1fd5f55
f0f2a4c
8496e3e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
WDYT about updating
API_BaseEntry
and propagating tags all the way up to the roots?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.
It would make the TS API a bit cleaner indeed. But I doubt it would make sense as there's virtually no way the intersection of all stories' tags makes sense to compute. It would likely be a waste of CPU resources to compute.
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.
As far as I understand here, you are propagating N-2 levels up the tree. The roots add a single extra level, which means one extra intersection per root, which means almost no extra computation compared to this change. For the benefit of a cleaner, more consistent API.
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.
You're right that it doesn't cost that much and would simplify API for all users. Let me give it a go and see where it takes me!
I wonder if it would make sense to just document it as an empty array for 'root' entries, as that's what we expect would happen?
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 also realise that I do indeed go down N-2, which was not intended. I wanted tag intersections computed as an intersection of direct children for obvious performance reasons.
I'll rework the code to do all tag intersection in a separate pass, starting from leaves and going back up the tree.
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 ended up having to edit a few tests, because many test mock entries did not have tags defined in their input. This was a good opportunity to realise that tags, whilst mandatory on story entries, were never initialised and assumed to exist. I added an initialisation to an empty array when creating hash stories, prior to destructuring the index story item, to ensure types will remain valid in the future. Happy to remove that if you find it unnecessary.