CUB-Libraries-CTA / counter-data-loader

Loads COUNTER database from JR1 report spreadsheets
1 stars 2 forks source link

Setup Local Development Environment (3) #47

Closed ericnienhouse closed 1 year ago

ericnienhouse commented 2 years ago

Problem: Debugging current workflow is difficult.

Estimate: 3

Acceptance Criteria:

Setup PyCharm IDE on local development machine Enable IDE debugging Connect to GitHub repository (developer/feature branch, not main) Setup Database Tools (SequelPro) Configure DB tools. Synchronize files with AWS instance. Pull code, run and set breakpoint to confirm debugging is working. Ideally: update code, write to repo, pull round trip.

bonnland commented 2 years ago

Today I got Sequel Pro to connect with the mySQL server running on my local laptop.

I had to re-install the SQL server to use legacy password encryption because Sequel Pro is not yet compatible with the stronger encryption scheme. I don't see the weaker encryption as an issue because it's a purely local development server.

bonnland commented 2 years ago

I'm now in the process of restoring a dump of the counter5 production database on my local laptop.

It's taking some time, but it's something I should only need to do once, and I believe there is some advantage to seeing which tables are small or large in a production environment.

NOTE: It took about 10 minutes to run the production DB restore.

bonnland commented 2 years ago

I was able to set up a PyCharm debug configuration, set a breakpoint, and step through the code today.

There is something mysterious happening in the DB connection. The DB config.py has my username set to one value ("brb3303"), and the connection error reports a username with a different value ("brbo3303"). The second value is my laptop user name. The codebase does not seem to have this second username value anywhere, so I'm still hoping to figure out where it originates from.

bonnland commented 2 years ago

At this point, I'm past having the strange username problem. It probably originated from me not fully understanding the mySql permissions model. I got around the problem by explicitly setting the username in every SQL-related command that the code generates and runs.