Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Complete Content Package notifications #10

Merged
merged 30 commits into from
Dec 6, 2017

Conversation

bogdanguranda
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-20.7%) to 63.242% when pulling 8704909 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-20.9%) to 63.04% when pulling de92043 on feature/CP-notifications into 67a549e on master.

Added tests for collectionsDiffer.
@coveralls
Copy link

Coverage Status

Coverage decreased (-17.2%) to 66.773% when pulling dffe4e6 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-17.2%) to 66.773% when pulling ca4637d on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-17.2%) to 66.773% when pulling 6c7b67b on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-17.2%) to 66.773% when pulling 623db2e on feature/CP-notifications into 67a549e on master.

return &defaultCollectionsDiffer{}
}

func (dcd *defaultCollectionsDiffer) Diff(incomingCollectionUuids []string, oldCollectionUuids []string) ([]string, map[string]bool) {
Copy link
Contributor

@MMoisa MMoisa Nov 14, 2017

Choose a reason for hiding this comment

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

Why not just return only the map from this function? The keys from the isDeleted map are the uuids of the content that was added/deleted.

@bogdanguranda bogdanguranda changed the title First implementation. No tests. Complete Content Package notifications Nov 15, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 84.699% when pulling 9c86996 on feature/CP-notifications into 67a549e on master.

contentResolverHealthURI string
relationsResolverHealthURI string
producer producer.MessageProducer
client *http.Client
}

func newHealthService(config *healthConfig) *healthService {
Copy link
Contributor

Choose a reason for hiding this comment

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

The gtg healthcheck should be done in parallel. There is an example in the methode-content-placeholder-mapper for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

"io/ioutil"
"net/http"

"github.com/Financial-Times/transactionid-utils-go"
)

type ContentResolver interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Test the flow where the httpClient can't make the call to the contentResolverApp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cannot test this, because of go not having an interface for http client.


resp, err := drr.httpClient.Do(req)
if err != nil {
return nil, fmt.Errorf("Error doing request to uri=[%v], transaction_id=[%v].", completeUri, tid)
Copy link
Contributor

Choose a reason for hiding this comment

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

This flow can be tested as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cannot test this, because of go not having an interface for http client.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 84.793% when pulling 760f625 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 84.579% when pulling 52fd461 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 84.507% when pulling 830c014 on feature/CP-notifications into 67a549e on master.

}

func oneWayDiff(firstCollection []string, secondCollection []string, markDeleted bool, mapToAdd map[string]bool) {
secondCollectionTemp := make(map[string]interface{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of map[string]interface{} this should be map[string]struct{} and secondCollectionTemp[secondColUuid] should be initialized with struct{}{}.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 84.531% when pulling 9d03314 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 84.531% when pulling f762d97 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 84.675% when pulling 2e3c6b7 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.8%) to 84.722% when pulling bcc053a on feature/CP-notifications into 67a549e on master.

README.md Outdated
1. **relations-api** connectivity check
2. **content-collection-neo4j-rw** connectivity check
3. **document-store-api** connectivity check
4. **kafka** connectivity check and topic existence check
Copy link
Contributor

Choose a reason for hiding this comment

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

The existence of the kafka topic is no longer checked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true

@@ -8,4 +8,6 @@ env:
WRITER_HEALTH_URI: http://content-collection-rw-neo4j:8080/__health
CONTENT_RESOLVER_URI: http://document-store-api:8080/content/
CONTENT_RESOLVER_HEALTH_URI: http://document-store-api:8080/__health
RELATIONS_RESOLVER_URI: http://relations-api/contentcollection/{uuid}/relations
RELATIONS_RESOLVER_HEALTH_URI: http://relations-api/__health
Copy link
Contributor

Choose a reason for hiding this comment

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

You should access the relations-api on the 8080 port, like http://relations-api:8080/..

Copy link
Contributor

@sbuliarca sbuliarca left a comment

Choose a reason for hiding this comment

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

Please fix the relations-api URL as its healthcheck is not green.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 82.743% when pulling d9350f3 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 82.743% when pulling db5df41 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 82.537% when pulling 15b4225 on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 81.94% when pulling 53b76bf on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 81.994% when pulling 8c7db3c on feature/CP-notifications into 67a549e on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 82.537% when pulling 05c9cd2 on feature/CP-notifications into 67a549e on master.

@bogdanguranda bogdanguranda merged commit f2fd762 into master Dec 6, 2017
@bogdanguranda bogdanguranda deleted the feature/CP-notifications branch December 6, 2017 10:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants