Skip to content

Commit 581ed00

Browse files
authored
Merge branch 'master' into evaluate-segmentation-in-infer-neurons-task
2 parents 870b589 + 6c0a472 commit 581ed00

File tree

240 files changed

+3570
-3019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+3570
-3019
lines changed

CHANGELOG.unreleased.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
1616

1717
### Changed
1818
- Reading image files on datastore filesystem is now done asynchronously. [#8126](https://github.com/scalableminds/webknossos/pull/8126)
19+
- Datasets can now be renamed and can have duplicate names. [#8075](https://github.com/scalableminds/webknossos/pull/8075)
1920
- Improved error messages for starting jobs on datasets from other organizations. [#8181](https://github.com/scalableminds/webknossos/pull/8181)
21+
- Terms of Service for Webknossos are now accepted at registration, not afterward. [#8193](https://github.com/scalableminds/webknossos/pull/8193)
2022
- Removed bounding box size restriction for inferral jobs for super users. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
23+
- Improved logging for errors when loading datasets and problems arise during a conversion step. [#8202](https://github.com/scalableminds/webknossos/pull/8202)
2124

2225
### Fixed
2326
- Fix performance bottleneck when deleting a lot of trees at once. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
2427
- Fix a bug where changing the color of a segment via the menu in the segments tab would update the segment color of the previous segment, on which the context menu was opened. [#8225](https://github.com/scalableminds/webknossos/pull/8225)
2528
- Fix a bug when importing an NML with groups when only groups but no trees exist in an annotation. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
2629
- Fix a bug where trying to delete a non-existing node (via the API, for example) would delete the whole active tree. [#8176](https://github.com/scalableminds/webknossos/pull/8176)
30+
- Fix a bug where dataset uploads would fail if the organization directory on disk is missing. [#8230](https://github.com/scalableminds/webknossos/pull/8230)
2731

2832
### Removed
33+
- Removed support for HTTP API versions 3 and 4. [#8075](https://github.com/scalableminds/webknossos/pull/8075)
2934
- Removed Google Analytics integration. [#8201](https://github.com/scalableminds/webknossos/pull/8201)
3035

3136
### Breaking Changes

Contributing Guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ in the following sections:
9797
The [webknossos repository](https://github.com/scalableminds/webknossos) is structured in frontend and backend parts with different tooling.
9898

9999
* **Frontend Tooling** We enforce coding styles and require all unit and integration tests to pass:
100-
* `yarn pretty`: Code formatting with prettier
101-
* `yarn lint`: Code linting with eslint
100+
* `yarn fix-frontend`: Code formatting and linting with biome
101+
* `yarn typecheck`: Code type checking with Typescript
102102
* `yarn test`: Unit tests with ava
103103
* `yarn test-e2e`: End-to-end, integration tests
104104

MIGRATIONS.unreleased.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md).
99
[Commits](https://github.com/scalableminds/webknossos/compare/24.11.1...HEAD)
1010

1111
- The config option `googleAnalytics.trackingId` is no longer used and can be removed. [#8201](https://github.com/scalableminds/webknossos/pull/8201)
12+
- Removed support for HTTP API versions 3 and 4. [#8075](https://github.com/scalableminds/webknossos/pull/8075)
1213

1314
### Postgres Evolutions:
15+
- [124-decouple-dataset-directory-from-name](conf/evolutions/124-decouple-dataset-directory-from-name)

app/controllers/AiModelController.scala

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import play.api.libs.json.{Json, OFormat}
1212
import play.api.mvc.{Action, AnyContent, PlayBodyParsers}
1313
import play.silhouette.api.Silhouette
1414
import security.WkEnv
15-
import utils.ObjectId
15+
import com.scalableminds.util.objectid.ObjectId
1616

1717
import javax.inject.Inject
1818
import scala.concurrent.ExecutionContext
@@ -42,7 +42,7 @@ object RunTrainingParameters {
4242

4343
case class RunInferenceParameters(annotationId: Option[ObjectId],
4444
aiModelId: ObjectId,
45-
datasetName: String,
45+
datasetDirectoryName: String,
4646
organizationId: String,
4747
colorLayerName: String,
4848
boundingBox: String,
@@ -147,7 +147,7 @@ class AiModelController @Inject()(
147147
jobCommand = JobCommand.train_model
148148
commandArgs = Json.obj(
149149
"training_annotations" -> Json.toJson(trainingAnnotations),
150-
"organization_name" -> organization._id,
150+
"organization_id" -> organization._id,
151151
"model_id" -> modelId,
152152
"custom_workflow_provided_by_user" -> request.body.workflowYaml
153153
)
@@ -180,21 +180,19 @@ class AiModelController @Inject()(
180180
"organization.notFound",
181181
request.body.organizationId)
182182
_ <- bool2Fox(request.identity._organization == organization._id) ?~> "job.runInference.notAllowed.organization" ~> FORBIDDEN
183-
dataset <- datasetDAO.findOneByNameAndOrganization(request.body.datasetName, organization._id) ?~> Messages(
184-
"dataset.notFound",
185-
request.body.datasetName)
183+
dataset <- datasetDAO.findOneByDirectoryNameAndOrganization(request.body.datasetDirectoryName, organization._id)
186184
dataStore <- dataStoreDAO.findOneByName(dataset._dataStore) ?~> "dataStore.notFound"
187185
_ <- aiModelDAO.findOne(request.body.aiModelId) ?~> "aiModel.notFound"
188186
_ <- datasetService.assertValidDatasetName(request.body.newDatasetName)
189-
_ <- datasetService.assertNewDatasetName(request.body.newDatasetName, organization._id)
190187
jobCommand = JobCommand.infer_with_model
191188
boundingBox <- BoundingBox.fromLiteral(request.body.boundingBox).toFox
192189
commandArgs = Json.obj(
193-
"organization_name" -> organization._id,
190+
"organization_id" -> organization._id,
194191
"dataset_name" -> dataset.name,
195192
"color_layer_name" -> request.body.colorLayerName,
196193
"bounding_box" -> boundingBox.toLiteral,
197194
"model_id" -> request.body.aiModelId,
195+
"dataset_directory_name" -> request.body.datasetDirectoryName,
198196
"new_dataset_name" -> request.body.newDatasetName,
199197
"custom_workflow_provided_by_user" -> request.body.workflowYaml
200198
)

app/controllers/AnnotationController.scala

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.apache.pekko.util.Timeout
44
import play.silhouette.api.Silhouette
55
import com.scalableminds.util.accesscontext.{DBAccessContext, GlobalAccessContext}
66
import com.scalableminds.util.geometry.BoundingBox
7+
import com.scalableminds.util.objectid.ObjectId
78
import com.scalableminds.util.time.Instant
89
import com.scalableminds.util.tools.{Fox, FoxImplicits}
910
import com.scalableminds.webknossos.datastore.models.annotation.AnnotationLayerType.AnnotationLayerType
@@ -34,7 +35,7 @@ import play.api.libs.json._
3435
import play.api.mvc.{Action, AnyContent, PlayBodyParsers}
3536
import security.{URLSharing, UserAwareRequestLogging, WkEnv}
3637
import telemetry.SlackNotificationService
37-
import utils.{ObjectId, WkConf}
38+
import utils.WkConf
3839

3940
import javax.inject.Inject
4041
import scala.concurrent.ExecutionContext
@@ -242,15 +243,11 @@ class AnnotationController @Inject()(
242243
} yield result
243244
}
244245

245-
def createExplorational(organizationId: String, datasetName: String): Action[List[AnnotationLayerParameters]] =
246+
def createExplorational(datasetId: String): Action[List[AnnotationLayerParameters]] =
246247
sil.SecuredAction.async(validateJson[List[AnnotationLayerParameters]]) { implicit request =>
247248
for {
248-
organization <- organizationDAO.findOne(organizationId)(GlobalAccessContext) ?~> Messages(
249-
"organization.notFound",
250-
organizationId) ~> NOT_FOUND
251-
dataset <- datasetDAO.findOneByNameAndOrganization(datasetName, organization._id) ?~> Messages(
252-
"dataset.notFound",
253-
datasetName) ~> NOT_FOUND
249+
datasetIdValidated <- ObjectId.fromString(datasetId)
250+
dataset <- datasetDAO.findOne(datasetIdValidated) ?~> Messages("dataset.notFound", datasetIdValidated) ~> NOT_FOUND
254251
annotation <- annotationService.createExplorationalFor(
255252
request.identity,
256253
dataset._id,
@@ -262,19 +259,12 @@ class AnnotationController @Inject()(
262259
} yield JsonOk(json)
263260
}
264261

265-
def getSandbox(organization: String,
266-
datasetName: String,
267-
typ: String,
268-
sharingToken: Option[String]): Action[AnyContent] =
262+
def getSandbox(datasetId: String, typ: String, sharingToken: Option[String]): Action[AnyContent] =
269263
sil.UserAwareAction.async { implicit request =>
270264
val ctx = URLSharing.fallbackTokenAccessContext(sharingToken) // users with dataset sharing token may also get a sandbox annotation
271265
for {
272-
organization <- organizationDAO.findOne(organization)(GlobalAccessContext) ?~> Messages(
273-
"organization.notFound",
274-
organization) ~> NOT_FOUND
275-
dataset <- datasetDAO.findOneByNameAndOrganization(datasetName, organization._id)(ctx) ?~> Messages(
276-
"dataset.notFound",
277-
datasetName) ~> NOT_FOUND
266+
datasetIdValidated <- ObjectId.fromString(datasetId)
267+
dataset <- datasetDAO.findOne(datasetIdValidated)(ctx) ?~> Messages("dataset.notFound", datasetIdValidated) ~> NOT_FOUND
278268
tracingType <- TracingType.fromString(typ).toFox
279269
_ <- bool2Fox(tracingType == TracingType.skeleton) ?~> "annotation.sandbox.skeletonOnly"
280270
annotation = Annotation(

0 commit comments

Comments
 (0)