Skip to content

Commit

Permalink
Add rejections on tag deletion in routes so it gets retried
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Dumas committed Aug 7, 2023
1 parent a31dc9f commit d6b7663
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ final class ResourcesRoutes(
.deleteTag(id, ref, schemaOpt, tag, rev)
.tapEval(index(ref, _, mode))
.map(_.void)
.rejectOn[ResourceNotFound]
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ final class SchemasRoutes(
ref,
Write
)) { (tag, rev) =>
emit(schemas.deleteTag(id, ref, tag, rev).tapEval(index(ref, _, mode)).map(_.void))
emit(
schemas
.deleteTag(id, ref, tag, rev)
.tapEval(index(ref, _, mode))
.map(_.void)
.rejectOn[SchemaNotFound]
)
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ final class FilesRoutes(
ref,
Write
)) { (tag, rev) =>
emit(files.deleteTag(id, ref, tag, rev).tapEval(index(ref, _, mode)))
emit(files.deleteTag(id, ref, tag, rev).tapEval(index(ref, _, mode)).rejectOn[FileNotFound])
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,13 @@ class ResourcesSpec extends BaseSpec with EitherValuable with CirceEq {
filterMetadataKeys(json) should equalIgnoreArrayOrder(expected)
}
}

"delete a tag" in {
deltaClient
.delete[Json](s"/resources/$id1/_/test-resource:1/tags/v1.0.1?rev=6", Rick) { (_, response) =>
response.status shouldEqual StatusCodes.OK
}
}
}

"check consistency of responses" in {
Expand Down

0 comments on commit d6b7663

Please sign in to comment.