From af0615abd15a5ca9f23f5881b6e016cac1a36f77 Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Sat, 29 Apr 2023 13:55:51 -0300 Subject: [PATCH 1/5] Permit configuration to use aliases (#455) --- lib/pghero.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pghero.rb b/lib/pghero.rb index d2f4ba0e0..e1f8bf445 100644 --- a/lib/pghero.rb +++ b/lib/pghero.rb @@ -121,7 +121,7 @@ def file_config config_file_exists = File.exist?(path) - config = YAML.safe_load(ERB.new(File.read(path)).result) if config_file_exists + config = YAML.safe_load(ERB.new(File.read(path)).result, aliases: true) if config_file_exists config ||= {} @file_config = From 7a0e6bcb8a71e2c119df2dee7389c69e024019d6 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 29 Apr 2023 10:05:47 -0700 Subject: [PATCH 2/5] Updated changelog [skip ci] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2daba879b..15c744849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.3.4 (unreleased) + +- Fixed support for aliases in config file + ## 3.3.3 (2023-04-18) - Fixed error with system stats for Azure Database From 44c29d88121fac0b0c8d2570a0c339c572bfa499 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 30 May 2023 11:26:35 -0700 Subject: [PATCH 3/5] Fixed error with Rails 7.1 - fixes #456 and fixes #461 --- lib/pghero.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pghero.rb b/lib/pghero.rb index e1f8bf445..40affdbeb 100644 --- a/lib/pghero.rb +++ b/lib/pghero.rb @@ -151,7 +151,7 @@ def default_config if databases.empty? databases["primary"] = { - "url" => ENV["PGHERO_DATABASE_URL"] || connection_config(ActiveRecord::Base) + "url" => ENV["PGHERO_DATABASE_URL"] || default_connection_config } end @@ -168,6 +168,11 @@ def default_config } end + # private + def default_connection_config + connection_config(ActiveRecord::Base) if ActiveRecord::VERSION::STRING.to_f < 7.1 + end + # ensure we only have one copy of databases # so there's only one connection pool per database def databases From 2a9033a9752f4cfca5c24a3f742d207d5305eab1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 4 Jul 2023 09:00:37 -0400 Subject: [PATCH 4/5] Added Postgres 16 to CI --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a43182c90..9c5cdc8ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,10 +9,10 @@ jobs: include: - ruby: 3.2 gemfile: gemfiles/activerecord71.gemfile - postgres: 15 + postgres: 16 - ruby: 3.1 gemfile: Gemfile - postgres: 14 + postgres: 15 - ruby: "3.0" gemfile: gemfiles/activerecord61.gemfile postgres: 12 From 9a96bf733bf61f800373616f359d5276050c2f82 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 5 Sep 2023 14:15:16 -0700 Subject: [PATCH 5/5] Version bump to 3.3.4 [skip ci] --- CHANGELOG.md | 2 +- lib/pghero/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c744849..02398055d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.3.4 (unreleased) +## 3.3.4 (2023-09-05) - Fixed support for aliases in config file diff --git a/lib/pghero/version.rb b/lib/pghero/version.rb index 6a476f46d..b23d29be7 100644 --- a/lib/pghero/version.rb +++ b/lib/pghero/version.rb @@ -1,3 +1,3 @@ module PgHero - VERSION = "3.3.3" + VERSION = "3.3.4" end