teslamate icon indicating copy to clipboard operation
teslamate copied to clipboard

Development page out of date + possible additions

Open leewillis77 opened this issue 4 years ago • 3 comments

The "Development & Contributing" page at https://docs.teslamate.org/docs/development/ still refers to Postgres 10, whereas the main installation page suggests v12 is required.

Additionally it doesn't note a requirement for Grafana, or node.js which are both listed on the install page.

As someone currently working on a PR - it would be helpful if the contributing page covered:

  • How to test migrations (mix ecto.migrate ?)
  • How to refresh grafana dashboards from updated definitions (just re-run/grafana/dashboards.sh restore?)

Thanks!

leewillis77 avatar Aug 12 '21 16:08 leewillis77

I must admit I agree with Lee. When I first started building a Dev environment and writing code I ended up googling most of the software/dependencies and commands. A lot of trial and error ensued.

I develop on Windows and it took me the best part of a month to build a Windows VM which was scripted and could be consistently rebuilt from nothing to a consistent DEV environment. All the commands on the help page are for Linux and some don't work on Windows, such as /grafana/dashboards so I ended up having to write my own scripts to replace it.

Overall the gate is set very high with regarding learning and building a Dev environment and it probably puts a lot of people off.

A good example of missing instructions is having to build test scripts. The developer page states you have to run "mix test" before submitting, however it doesn't say that you may need to add extra tests to your test script to cover your code changes.

Ideally it would be good to have a tutorial of how to build for Linux and Windows and then tutorial taking you through the steps of development with all the relevant commands you will need.

Ed-M72 avatar Aug 17 '21 21:08 Ed-M72

Just to follow up on this. I managed to get everything setup I think, but I still had some issues, particularly around tests.

It seems like whenever I run mix test it insists on doing it against the main database, not the test DB. Setting MIX_ENV didn't seem to affect that, so clearly I'm doing something wrong, and I'm not sure what.

I've just noticed that the website looks like it's in the repo, so when I get chance I'll put together a PR to reorganise some of the content, and hopefully we can evolve it from there!

leewillis77 avatar Aug 19 '21 13:08 leewillis77

I'm in the initial phase of setting up a development environment. I'm actually already stuck at deciding whether to use Windows or Linux :) It seems on the previous comments that Linux would be the way to go. Would WSL2 work?

Does anyone have their own guide they want to share?

micves avatar Apr 20 '23 07:04 micves