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

Upstream v3.3.4 merged into Buildkite fork #10

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: 3.2
- ruby: 3.3
gemfile: gemfiles/activerecord71.gemfile
postgres: 16
- ruby: 3.3
gemfile: gemfiles/activerecord71.gemfile
postgres: 15
- ruby: 3.1
gemfile: Gemfile
- ruby: 3.3
gemfile: gemfiles/activerecord71.gemfile
postgres: 14
- ruby: "3.0"
gemfile: gemfiles/activerecord61.gemfile
postgres: 12
- ruby: 2.7
gemfile: gemfiles/activerecord60.gemfile
postgres: 10
- ruby: 3.3
gemfile: gemfiles/activerecord71.gemfile
postgres: 13
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.3.4 (2023-09-05)

- Fixed support for aliases in config file

## 3.3.3 (2023-04-18)

- Fixed error with system stats for Azure Database
Expand Down
9 changes: 7 additions & 2 deletions lib/pghero.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pghero/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PgHero
VERSION = "3.3.3"
VERSION = "3.3.4"
end
Loading