Skip to content
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

integrate spandex ecto #1602

Merged
merged 14 commits into from
Jun 29, 2020
Merged

integrate spandex ecto #1602

merged 14 commits into from
Jun 29, 2020

Conversation

# See the License for the specific language governing permissions and
# limitations under the License.

defmodule OMG.WatcherInfo.DB.TraceableRepo do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a workaround for spandex-project/spandex_ecto#22. I tried using span and trace decorators. They don't record traces from queries

Copy link
Contributor

Choose a reason for hiding this comment

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

even though this works, great job @ayrat555! I think it's super intrusive to our elixir-omg Repo. well... you had to wrap the whole Repo module to make this work.

what if we fork spandex_ecto and bake in the solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I talked with @achiurizo a couple of days ago. He suggested the same. I'll look into it

Copy link
Contributor

Choose a reason for hiding this comment

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

wonderful!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@InoMurko pr is ready for review

@@ -101,11 +104,12 @@ defmodule OMG.WatcherInfo.DB.TxOutput do
address
|> query_get_utxos()
|> from(limit: ^limit, offset: ^offset)
|> Repo.all()
|> DB.Repo.all()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're trying to avoid namespacing outside the module header

Suggested change
|> DB.Repo.all()
|> Repo.all()

@ayrat555 ayrat555 merged commit b23471a into master Jun 29, 2020
@ayrat555 ayrat555 deleted the ayrat555/integrate-spandex-ecto branch June 29, 2020 15:35
Comment on lines 138 to 139
Repo.all(query)
|> Enum.map(fn {currency, amount} ->
Copy link
Contributor

Choose a reason for hiding this comment

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

this was a good oppurtunity to avoid a single pipe
query
|> Repo.all()
|> Enum.map(fn {currency, amount} ->
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@InoMurko yes, I thought about it. But I decided now to include additional changes. Also, there is a credo check for this stuff.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, we can't use it because we have too many of them :D

so we do this:
https://github.com/omgnetwork/elixir-omg/blob/master/.circleci/config.yml#L181-L192

@unnawut unnawut added the chore Technical work that does not affect service behaviour label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Technical work that does not affect service behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants