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

Postgres version check - only raise in production #16197

Merged
merged 2 commits into from
Oct 13, 2017
Merged

Postgres version check - only raise in production #16197

merged 2 commits into from
Oct 13, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Oct 13, 2017

The feature (#16171) is meant to protect users from using a wrong version of external DB.

But it also breaks devel setups for anybody using PG9.6+.

Thus, changing to only raise in production.
Development mode will warn to stderr (not sure about loggers in initializers), but not raise an exception.

Cc @chrisarcand, @carbonin, @Fryguy

@miq-bot add_label core, fine/no

The feature is meant to protect users from using a wrong version of external DB.

But it also breaks devel setups for anybody using PG9.6+.

Thus, changing to only raise in production.
Development mode will warn to stderr (not sure about loggers in initializers), but not raise an exception.
@himdel
Copy link
Contributor Author

himdel commented Oct 13, 2017

One thing to note - this won't actually show the message when starting the server (when via rails s), but only after it tries to connect - and will do so multiple times.

I didn't want to hide it completely for devel mode, but if preferred..

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe the message should say "PR's welcome!". Honestly, if it's desirable to run on newer versions, people who want to run there can try to get things working there like we do on ruby versions.

@jrafanie
Copy link
Member

As an aside, I feel like vmdb_database gets in the way for all postgreql upgrades. I don't know who uses it, if anyone, and it is also the slowest primordial seed.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

LGTM

@carbonin
Copy link
Member

I wonder if we should continue to raise for old versions, but log for new ones in development?

I would much rather someone discover issues with newer versions that we should fix vs. hitting issues with old versions that we don't care about.

Thoughts?

@jrafanie
Copy link
Member

@carbonin that makes sense... I forgot about the original intent of preventing really old versions from being used. I'm good if @himdel split up the conditional

@himdel
Copy link
Contributor Author

himdel commented Oct 13, 2017

Good idea, doing that.. :)

(And adding a 9.4+ required vs 9.6+ not yet supported to differentiate the messages.)

Raising only in production makes sense for too new DBs but less so for too old DBs.

Split.
@miq-bot
Copy link
Member

miq-bot commented Oct 13, 2017

Some comments on commits https://github.com/himdel/manageiq/compare/034fcdfc200476d56f1b6b02eaa9322511b39ccc~...1266bb59a043b748c35cce3429f550bcce9dc79f

config/initializers/postgres_required_versions.rb

  • ⚠️ - 13 - Detected puts. Remove all debugging statements.

@miq-bot
Copy link
Member

miq-bot commented Oct 13, 2017

Checked commits https://github.com/himdel/manageiq/compare/034fcdfc200476d56f1b6b02eaa9322511b39ccc~...1266bb59a043b748c35cce3429f550bcce9dc79f with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 2 offenses detected

config/initializers/postgres_required_versions.rb

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

:shipit:

@jrafanie
Copy link
Member

❗️ - Line 5, Col 29 - Style/NumericLiterals - Separate every 3 digits in the integer portion of a number with underscores().
❗️ - Line 9, Col 30 - Style/NumericLiterals - Separate every 3 digits in the integer portion of a number with underscores(
).

It's ok bot, these are PG version numbers and that's the format PG people know. Move along. Nothing to see here.

@carbonin carbonin assigned carbonin and unassigned gtanzillo Oct 13, 2017
@carbonin carbonin merged commit 7112a99 into ManageIQ:master Oct 13, 2017
@himdel himdel deleted the relax-postgres branch October 13, 2017 14:43
@carbonin carbonin added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants