Skip to content

TravisCI -> GH Actions #648

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

Merged
merged 19 commits into from
Mar 14, 2023
Merged

TravisCI -> GH Actions #648

merged 19 commits into from
Mar 14, 2023

Conversation

markets
Copy link
Collaborator

@markets markets commented Jun 18, 2021

Closes #646

  • Make tests pass
  • Migrate code coverage report
  • Settings clean up

NOTES

  • CI postgres needs to define host and password DB settings.
  • collation and ctype doesn't work on CI, I kept them for current staging/pro infra.
  • The original hstore column (for categories translations) should be migrated to jsonb (as we are relying on https://github.com/cfabianski/json_translate). In the future (after this PR reaches production) we can remove this extension. This fixes the error:
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  operator does not exist: hstore @> jsonb
LINE 1: ... one FROM "categories" WHERE ("name_translations" @> '{"es":...

@markets markets force-pushed the gh_actions branch 7 times, most recently from 38fb9ae to f36138c Compare June 18, 2021 18:51
@markets
Copy link
Collaborator Author

markets commented Jun 18, 2021

@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 markets force-pushed the gh_actions branch 4 times, most recently from e48ad8b to bc850cc Compare June 18, 2021 19:28
@sauloperez
Copy link
Collaborator

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

@markets markets force-pushed the gh_actions branch 2 times, most recently from 92ce258 to 3eca24a Compare June 19, 2021 11:51
@markets
Copy link
Collaborator Author

markets commented Jun 19, 2021

@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.

@sauloperez
Copy link
Collaborator

sauloperez commented Jun 21, 2021

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.

@markets markets force-pushed the gh_actions branch 3 times, most recently from f50b516 to 51925dd Compare June 21, 2021 17:36
@markets
Copy link
Collaborator Author

markets commented Jun 21, 2021

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
Copy link
Collaborator Author

markets commented Jun 22, 2021

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?

@sauloperez
Copy link
Collaborator

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.

@markets
Copy link
Collaborator Author

markets commented Jul 13, 2021

UPDATE I tried forcing the hstore installation (7d11937), but no luck :(
Anyway, I think this shouldn't be necessary 🤔 since we are loading the structure.sql file, which includes this line:

CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;

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

@markets
Copy link
Collaborator Author

markets commented Mar 13, 2023

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

@markets markets marked this pull request as ready for review March 13, 2023 21:06
@markets
Copy link
Collaborator Author

markets commented Mar 13, 2023

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

Copy link
Collaborator

@franpb14 franpb14 left a comment

Choose a reason for hiding this comment

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

Everything is working fine after the migrate. Tests & server working 🎉 🥳

@markets markets merged commit afafeaf into develop Mar 14, 2023
@markets markets deleted the gh_actions branch March 14, 2023 21:11
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.

Migrate from TravisCI to GitHub Actions
3 participants