Add an endpoint to check for broken views
- Dominant language
- Scala
- Stars
- 301
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
**Motivation**
With the new Elasticsearch pipeline feature, pipeline definitions can become invalid if retrocompatibility is broken after a deployment.
This aims to help to detect these breaking changes in order to help to fix them
**Acceptance criteria**
* The response should be easy enough to parse so that the status check can be automated with a probe
* The details should be suficient
**API changes**
`/v1/views/elasticsearch/health`
```
{
"@context": [
"https://bluebrain.github.io/nexus/contexts/elasticsearch-metadata.json",
"https://bluebrain.github.io/nexus/contexts/metadata.json"
],
"status": "OK|KO",
"invalidPipelines": [
{
"@type": "PipeNotFound",
"view": {
"@id": "http://localhost:8080/v1/resources/myorg/myproj/_/myview",
"@type": [
"ElasticSearchView",
"View"
],
"_constrainedBy": "https://bluebrain.github.io/nexus/schemas/views.json",
"_createdAt": "2021-05-12T09:54:28.171Z",
"_createdBy": "http://localhost:8080/v1/anonymous",
"_deprecated": false,
"_incoming": "http://localhost:8080/v1/views/myorg/myproj/myview/incoming",
"_outgoing": "http://localhost:8080/v1/views/myorg/myproj/myview/outgoing",
"_project": "http://localhost:8080/v1/projects/myorg/myproj",
"_rev": 1,
"_self": "http://localhost:8080/v1/views/myorg/myproj/myview",
"_updatedAt": "2021-05-12T09:54:28.171Z",
"_updatedBy": "http://localhost:8080/v1/anonymous",
"_uuid": "7e737b83-30a0-4ea3-b6c9-cd1ed481d743"
},
"reason": "Pipe `xxx` can't be found. ",
"originalPayload": {
...
}
},
{
"@type": "InvalidPipeContext",
"view": {
"@id": "http://localhost:8080/v1/resources/myorg/myproj2/_/myview",
"@type": [
"ElasticSearchView",
"View"
],
"_constrainedBy": "https://bluebrain.github.io/nexus/schemas/views.json",
"_createdAt": "2021-05-12T09:54:28.171Z",
"_createdBy": "http://localhost:8080/v1/anonymous",
"_deprecated": false,
"_incoming": "http://localhost:8080/v1/views/myorg/myproj/myview/incoming",
"_outgoing": "http://localhost:8080/v1/views/myorg/myproj/myview/outgoing",
"_project": "http://localhost:8080/v1/projects/myorg/myproj2",
"_rev": 1,
"_self": "http://localhost:8080/v1/views/myorg/myproj2/myview",
"_updatedAt": "2021-05-12T09:54:28.171Z",
"_updatedBy": "http://localhost:8080/v1/anonymous",
"_uuid": "7e737b83-30a0-4ea3-b6c9-cd1ed481d743"
},
"reason": "Context for pipe `Delete` is invalid.",
"details": "Property `field` is mandatory.",
"originalPayload": {
...
}
}
]
}
```
**Not in scope**
1. Create the probe
Contributor guide
Research direction
Start by locating the code that serves `/v1/views/elasticsearch/health` and the existing Elasticsearch view or pipeline validation entry points. Implement the JSON response with an automated status, invalid pipeline details, view metadata, reasons, and original payloads; creating the probe is explicitly out of scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, scala
- Domain
- api, backend, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100