-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/publish content to search in the dataset api #645
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
base: develop
Are you sure you want to change the base?
Feature/publish content to search in the dataset api #645
Conversation
# Conflicts: # features/static_versions_put.feature
api/versions.go
Outdated
| searchContentUpdatedEvent := map[string]interface{}{ | ||
| "dataset_id": updatedVersion.DatasetID, | ||
| "uri": updatedVersion.Links.Version.HRef, | ||
| "title": updatedVersion.Edition, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be updatedVersion.EditionTitle
| "uri": updatedVersion.Links.Version.HRef, | ||
| "title": updatedVersion.Edition, | ||
| "content_type": updatedVersion.Type, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if making the above change I think the edition id still needs to be included based on the swagger spec, so you'd probably need
"edition": updatedVersion.Edition
added to the object as well
api/versions.go
Outdated
| } else { | ||
| go func() { | ||
| api.searchContentUpdatedProducer.Producer.Output() <- kafka.BytesMessage{Value: jsonBytes, Context: ctx} | ||
| log.Info(ctx, "putState endpoint: sent search content update to kafka", logData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this point it's only been queued to the channel, not actually sent. So it might be worth changing it to something like -
putState endpoint: queued search content update for kafka
What
When a version is put to published, a message needs to go on the search-content-updated kafka topic so that the search service can make the dataset available to be searched for.
Jira - https://officefornationalstatistics.atlassian.net/browse/DIS-3448?atlOrigin=eyJpIjoiYjExYTg5MjI2MmY2NDQ4MGJmY2MzODk2OGY4N2QwZDUiLCJwIjoiaiJ9
How to review
With the dataset-catalogue compose stack running, have a dataset with the state
approved.Use the put state endpoint to change this to published with:
and a body of
Check the kafka topic with (this way worked for me, I'm not sure if theres an easier way), executing into one of the kafka containers with
docker exec -it int-dataset-catalogue-kafka-3-1 /bin/bashThen check the kafka topic with:
Check that the json message is put on the topic with the expected details.
Who can review
Anyone