timeoverflow icon indicating copy to clipboard operation
timeoverflow copied to clipboard

TravisCI -> GH Actions

Open markets opened this issue 4 years ago • 8 comments

Closes #646

  • [ ] Make tests pass
  • [ ] Enable code coverage report

NOTE Will squash at the end

markets avatar Jun 18 '21 18:06 markets

@sauloperez Did you see any similar error in the past? I basically copy-pasted from OFN, but apparently Rails can't connect to postgresql... I'm exposing the service at that port 🤔

Captura de pantalla 2021-06-18 a las 20 52 51

markets avatar Jun 18 '21 18:06 markets

We can try with some more --health-retries and see if that makes any difference :shrug:

sauloperez avatar Jun 19 '21 08:06 sauloperez

@sauloperez changing those 2 things (ENV var naming and the --health-retries), we got a different error 🤷

Error: Failed to initialize, postgres service is unhealthy.

markets avatar Jun 19 '21 11:06 markets

Oops, no. You are right, those ENV vars are defined by the PostgreSQL image. Nothing to do with the config/database.yml ones. And at OFN we just match the default values defined in config/database.yml without needing any extra vars.

sauloperez avatar Jun 21 '21 07:06 sauloperez

UPDATE I returned back to check an extra ENV var (I'd like to avoid infra changes/coordination) and tried a couple of tweaks more (more retries and newer PostgreSQL versions), but still no luck :(

PG::ConnectionBad: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

markets avatar Jun 21 '21 17:06 markets

UPDATE After some random back and forth, I made some progress. Now the PostgreSQL service seems to start well, but it still fails due to:

rails aborted!
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  operator does not exist: hstore @> jsonb
LINE 1: ... one FROM "categories" WHERE ("name_translations" @> '{"es":...

@sauloperez do you have any idea about this one?

markets avatar Jun 22 '21 18:06 markets

yes, that is using the hstore postgreSQL extension but it doesn't seem to be installed in CI. See: https://github.com/coopdevs/timeoverflow-provisioning/blob/c8f0d859d27b5d7f41e7f370dd6d39e36f650e95/roles/database/tasks/main.yml#L56-L61.

sauloperez avatar Jun 23 '21 13:06 sauloperez

UPDATE I tried forcing the hstore installation (https://github.com/coopdevs/timeoverflow/commit/7d11937025b199b0f2a3429db430281291d942b5), but no luck :( Anyway, I think this shouldn't be necessary 🤔 since we are loading the structure.sql file, which includes this line:

https://github.com/coopdevs/timeoverflow/blob/85dd90f689ce8831dff645d14f03a60a67181e4f/db/structure.sql#L28

@sauloperez Do you think we need something else to get the hstore extension working? Any clue 💡?

markets avatar Jul 13 '21 19:07 markets

Yay! 🎉 Build is green now! Never give up 💪🏼

markets avatar Mar 13 '23 20:03 markets

@franpb14 What do you think? Could you please review it and test it locally 🙏🏼? The most "critical" thing is the migration.

markets avatar Mar 13 '23 21:03 markets