Skip to content
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

Add tag latest when fetching dependencies #3879

Merged
merged 7 commits into from
May 16, 2023

Conversation

imsdu
Copy link
Contributor

@imsdu imsdu commented May 12, 2023

Fixes #3849

shinyhappydan
shinyhappydan previously approved these changes May 12, 2023
Copy link
Contributor

@shinyhappydan shinyhappydan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like this could have a test

Comment on lines 62 to 64
val saveLatestStates = List(state1, state2, state3, state5).traverse(stateStore.unsafeSave(_))
val saveTaggedStates = List(state2, state3).traverse(stateStore.unsafeSave(_, UserTag.unsafe("my-tag")))
(saveLatestStates >> saveTaggedStates).transact(xas.write)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really tell what this test is doing, is this affecting the other tests somehow?

Copy link
Contributor Author

@imsdu imsdu May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is populating the database with:

  • latest states that should be returned in some of the tests
  • tagged states that should never been returned in this context

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem I see is that it's unclear from reading the test how those tagged states would affect anything. It would be better if there was a test that was clearly saying that the tagged versions should not appear (or whatever the assertion should be)

shinyhappydan
shinyhappydan previously approved these changes May 15, 2023
Comment on lines 62 to 64
val saveLatestStates = List(state1, state2, state3, state5).traverse(stateStore.unsafeSave(_))
val saveTaggedStates = List(state2, state3).traverse(stateStore.unsafeSave(_, UserTag.unsafe("my-tag")))
(saveLatestStates >> saveTaggedStates).transact(xas.write)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem I see is that it's unclear from reading the test how those tagged states would affect anything. It would be better if there was a test that was clearly saying that the tagged versions should not appear (or whatever the assertion should be)

@@ -109,7 +113,7 @@ class EntityDependencyStoreSuite extends BioSuite with Doobie.Fixture {
)
}

test("Fetch values for direct dependencies of id1") {
test("Fetch latest state values for direct dependencies of id1") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't check that the latest state is returned, as both the states appear the same in the result (so you could be returning the tagged version rather than latest)

To communicate the intent of the test better, it would be nice to express "I want the latest version of state 2, and I don't want the other version of state 2"

@imsdu imsdu merged commit 47117e8 into BlueBrain:master May 16, 2023
@imsdu imsdu deleted the 3849-fix-recursive-query branch May 16, 2023 08:20
olivergrabinski pushed a commit to olivergrabinski/nexus that referenced this pull request May 19, 2023
* Add tag latest when fetching dependencies
---------

Co-authored-by: Simon Dumas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The recursive query for aggregate views can be slow
3 participants