Skip to content

Conversation

@mvelimir
Copy link
Member

@mvelimir mvelimir commented Feb 7, 2023

No description provided.

@drmarjanovic drmarjanovic requested a review from mijicd February 10, 2023 08:34
for {
_ <- ZIO.logInfo(s"Deleting index '$Index'...")
_ <- ElasticRequest.deleteIndex(Index).execute
_ <- ZIO.serviceWithZIO[ElasticExecutor](_.execute(ElasticRequest.deleteIndex(Index)))
Copy link
Collaborator

@mijicd mijicd Feb 10, 2023

Choose a reason for hiding this comment

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

This one is not bad, though it might need to adjust types to make it fully type-safe and maximize ergonomics.

@mvelimir mvelimir force-pushed the module-pattern-2.0-1 branch from 9098283 to e21e5b6 Compare February 22, 2023 14:29
@mvelimir mvelimir marked this pull request as ready for review February 22, 2023 14:35
drmarjanovic
drmarjanovic previously approved these changes Feb 22, 2023
routing <- routingOf(organization)
req = ElasticRequest.getById[GitHubRepo](Index, DocumentId(id)).routing(routing)
res <- executor.execute(req)
res <- elasticsearch.execute(req)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we inline the requests?

for {
docId <- ElasticRequest.create[CustomerDocument](index, customer).execute
res <- ElasticRequest.getById[CustomerDocument](index, docId).execute
docId <- Elasticsearch.execute(ElasticRequest.create[CustomerDocument](index, customer))
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is the spec for the Executor itself, I would use it directly here.


assertZIO(addStubMapping *> ElasticRequest.bulk(ElasticRequest.create(index, repo)).refreshTrue.execute)(
assertZIO(
addStubMapping *> Elasticsearch.execute(ElasticRequest.bulk(ElasticRequest.create(index, repo)).refreshTrue)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rely directly on the layer that is being tested by the spec.

drmarjanovic
drmarjanovic previously approved these changes Feb 22, 2023
dbulaja98
dbulaja98 previously approved these changes Feb 23, 2023
@mvelimir mvelimir dismissed stale reviews from dbulaja98 and drmarjanovic via c107f17 February 23, 2023 12:45
@mvelimir mvelimir force-pushed the module-pattern-2.0-1 branch from db2abbb to c107f17 Compare February 23, 2023 12:45
@drmarjanovic drmarjanovic changed the title Use module pattern 2.0 (remove execute method on requests) Use module pattern (remove execute method on requests) Feb 23, 2023
@drmarjanovic drmarjanovic merged commit c9110a1 into main Feb 23, 2023
@drmarjanovic drmarjanovic deleted the module-pattern-2.0-1 branch February 23, 2023 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants