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

Write wkurl into annotation nml file #6964

Merged
merged 19 commits into from
Apr 18, 2023
Merged

Write wkurl into annotation nml file #6964

merged 19 commits into from
Apr 18, 2023

Conversation

frcroth
Copy link
Member

@frcroth frcroth commented Apr 4, 2023

URL of deployed dev instance (used for testing):

Steps to test:

  • Create an annotation
  • Upload the annotation from the dashboard -> no problem
  • In your downloaded nml file, change the org (or dataset name) and wkUrl
  • See a descriptive error

When uploading annotations from the dataset view it seems like org and dataset are not checked? Therefore wkUrl is not used there.

Issues:


  • Updated changelog
  • Removed dev-only changes like prints and application.conf edits

@frcroth frcroth requested a review from fm3 April 5, 2023 09:31
@frcroth frcroth marked this pull request as ready for review April 5, 2023 09:31
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Backend mostly LGTM :)

I left one comment on checking the url on upload. My other two refactorign-related comments I’m not certain about myself, maybe you could consider your view on them.

The front-end also has an NML export in serializeToNml in nml_helpers.ts. The wkurl should be added there too (serializeParameters). @philippotto maybe you could give a pointer on how to get the current host there? Simply from window.location? Or is there a better way?

app/models/annotation/nml/NmlParser.scala Outdated Show resolved Hide resolved
app/models/annotation/nml/NmlWriter.scala Show resolved Hide resolved
app/controllers/AnnotationIOController.scala Outdated Show resolved Hide resolved
@philippotto
Copy link
Member

@philippotto maybe you could give a pointer on how to get the current host there? Simply from window.location? Or is there a better way?

Yes, I think ${location.protocol}//${location.host} should be fine.

@frcroth frcroth changed the title Draft: Write wkurl into nml file Write wkurl into nml file Apr 12, 2023
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Backend LGTM and works as expected :) front-end export works as expected as well.
Looks like location is not available during the front-end tests, though, making the CI red. @philippotto any pointers? 😅

conf/messages Outdated Show resolved Hide resolved
@philippotto
Copy link
Member

philippotto commented Apr 12, 2023

Frontend looks good to me, too :) I hope that I fixed the CI.

@frcroth
Copy link
Member Author

frcroth commented Apr 12, 2023

snapshot needs to be recreated. Also the resulting wkUrl="//" does not look very useful. Is there just no host at time of test?

@philippotto
Copy link
Member

snapshot needs to be recreated. Also the resulting wkUrl="//" does not look very useful. Is there just no host at time of test?

I adapted the mocked location to have a protocol and a host. I also tried running yarn refresh-snapshots but get the following errrors:

e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:80:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:86:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:93:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:100:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:107:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:113:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:121:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:128:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] /home/sbt-user/webknossos/test/backend/NMLUnitTestSuite.scala:134:53: type mismatch;
e2e-tests_1                | [error]  found   : net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, Option[String])]
e2e-tests_1                | [error]  required: net.liftweb.common.Box[(Option[com.scalableminds.webknossos.datastore.SkeletonTracing.SkeletonTracing], List[models.annotation.UploadedVolumeLayer], String, String)]
e2e-tests_1                | [error]       assert(!isParseSuccessful(writeAndParseTracing(newTracing)))
e2e-tests_1                | [error]                                                     ^
e2e-tests_1                | [error] 9 errors found
e2e-tests_1                | [error] (Test / compileIncremental) Compilation failed
e2e-tests_1                | [error] Total time: 27 s, completed Apr 12, 2023 4:20:43 PM

I ran a ./clean beforehand, but this doesn't change anything. Maybe you know how to fix this?

@frcroth
Copy link
Member Author

frcroth commented Apr 16, 2023

Don't know why, but the wkUrl is not added when recreating the snapshots.

@fm3
Copy link
Member

fm3 commented Apr 17, 2023

@philippotto Do you have insights as to why that may be so? Also the frontend tests still fail 🙈 maybe you could have a look there too. No great hurry :)

@philippotto
Copy link
Member

Should be fixed now. I also took the liberty to rename the yarn commands a bit to make them clearer. There are two different snapshot kinds (from e2e tests and from unit tests) which explains why the necessary snapshots didn't update (I also fell for this).
The distinction between e2e and all (instead of unit) is not ideal, but a bit harder to change due to the folder hierarchy. I hope this increment is an improvement, nevertheless.

@fm3
Copy link
Member

fm3 commented Apr 18, 2023

Sounds good, thanks! And refreshing the unit test snapshots is just yarn start after previously removing them? 😮

@philippotto
Copy link
Member

Sounds good, thanks! And refreshing the unit test snapshots is just yarn start after previously removing them? open_mouth

Oops. Still early apparently 🙈

@fm3
Copy link
Member

fm3 commented Apr 18, 2023

No worries :) Thanks for taking care of this!

@frcroth frcroth changed the title Write wkurl into nml file Write wkurl into annotation nml file Apr 18, 2023
@frcroth frcroth merged commit 0e6e6e7 into master Apr 18, 2023
1 check passed
@frcroth frcroth deleted the wkurl-nml branch April 18, 2023 07:45
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.

Save & use wk-URL in NML
3 participants