pg_failover 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/build-and-test.yml +47 -0
- data/.github/workflows/publish-gem.yml +39 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +8 -0
- data/catalog-info.yaml +12 -0
- data/lib/pg_failover/version.rb +5 -0
- data/lib/pg_failover.rb +1 -0
- data/pg_failover.gemspec +8 -2
- metadata +9 -8
- data/.circleci/config.yml +0 -115
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0efa830edf653f174a54566d5845b7e9676f9db509ed28bf7e61a64d009e18bf
|
|
4
|
+
data.tar.gz: 9a377708bb581cd50a3b69dea27dcc488852a437e44dd6990f40f89256894fef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0eab6bb57628e7332f853ecced8a94a14960e01288ba95781fd6758b6faf3a56c45b369ab80c916bfbae149741290b944a092e9267b5b0b84a0f2a36b7946f4
|
|
7
|
+
data.tar.gz: '083680b74eb3c59d33f91523b5ccedd014042d33c73855baf58a095c3273a99718bd7489444e1f561069d41656647769165e3af8b1c11adc412d96813fed38e0'
|
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @FundingCircle/core-services
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Build & Test
|
|
2
|
+
run-name: Build & Test - ${{ github.ref_name }}
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ master ]
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
version-check:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
if: "!contains(github.ref, 'master')"
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout commit
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Gem versioned correctly
|
|
23
|
+
shell: bash
|
|
24
|
+
run: |
|
|
25
|
+
CHANGED=$(git diff origin/master HEAD --name-only | grep 'lib/pg_failover') || exit 0
|
|
26
|
+
[[ -z "$CHANGED" ]] || (echo "$CHANGED" | grep 'version.rb') || exit 1
|
|
27
|
+
|
|
28
|
+
build-and-test:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
strategy:
|
|
31
|
+
matrix:
|
|
32
|
+
ruby-version: ['3.2', '3.3', '3.4', '4.0']
|
|
33
|
+
steps:
|
|
34
|
+
- name: Check out repository code
|
|
35
|
+
uses: actions/checkout@v5
|
|
36
|
+
|
|
37
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
38
|
+
uses: ruby/setup-ruby@v1
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
41
|
+
bundler-cache: true
|
|
42
|
+
|
|
43
|
+
- name: Run RuboCop
|
|
44
|
+
run: bundle exec rubocop
|
|
45
|
+
|
|
46
|
+
- name: Run tests
|
|
47
|
+
run: bundle exec rspec
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Deploy to RubyGems
|
|
2
|
+
run-name: ${{ github.actor }} is publishing a new version
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
release:
|
|
6
|
+
types: [published]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish-gem:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Check out repository code
|
|
16
|
+
uses: actions/checkout@v5
|
|
17
|
+
|
|
18
|
+
- name: Set up Ruby
|
|
19
|
+
uses: ruby/setup-ruby@v1
|
|
20
|
+
with:
|
|
21
|
+
ruby-version: '.ruby-version'
|
|
22
|
+
|
|
23
|
+
- name: Release tag matches gem version
|
|
24
|
+
shell: bash
|
|
25
|
+
run: |
|
|
26
|
+
VERSION=$(ruby -r ./lib/pg_failover/version -e 'print PgFailover::VERSION')
|
|
27
|
+
if [[ "${GITHUB_REF_NAME#v}" != "$VERSION" ]]; then
|
|
28
|
+
echo "Release tag $GITHUB_REF_NAME does not match gem version $VERSION"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
- name: Build gem
|
|
33
|
+
run: gem build pg_failover.gemspec
|
|
34
|
+
|
|
35
|
+
- name: Publish gem
|
|
36
|
+
env:
|
|
37
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
38
|
+
run: |
|
|
39
|
+
gem push pg_failover-*.gem
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.9
|
data/CHANGELOG.md
CHANGED
data/catalog-info.yaml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
apiVersion: backstage.io/v1alpha1
|
|
2
|
+
kind: Component
|
|
3
|
+
metadata:
|
|
4
|
+
name: pg-failover
|
|
5
|
+
description: >-
|
|
6
|
+
Ruby gem that handles PostgreSQL (e.g. AWS RDS) failover for ActiveRecord
|
|
7
|
+
and Sequel apps by checking pg_is_in_recovery on connection checkout and
|
|
8
|
+
reconnecting until it reaches the new primary.
|
|
9
|
+
spec:
|
|
10
|
+
lifecycle: stable
|
|
11
|
+
owner: group:department/product-engineering
|
|
12
|
+
type: library
|
data/lib/pg_failover.rb
CHANGED
data/pg_failover.gemspec
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
project_root = File.dirname(__FILE__)
|
|
4
|
+
lib = File.join(project_root, 'lib')
|
|
5
|
+
|
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
7
|
+
require 'pg_failover/version'
|
|
8
|
+
|
|
3
9
|
Gem::Specification.new do |spec|
|
|
4
10
|
spec.name = 'pg_failover'
|
|
5
|
-
spec.version =
|
|
11
|
+
spec.version = PgFailover::VERSION
|
|
6
12
|
spec.authors = ['Aleksandar Ivanov', 'Andy Chambers', 'Sasha Gerrand']
|
|
7
13
|
spec.email = ['engineering+pg_failover@fundingcircle.com']
|
|
8
14
|
spec.license = 'BSD-3-Clause'
|
|
@@ -30,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
|
30
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
31
37
|
spec.require_paths = ['lib']
|
|
32
38
|
|
|
33
|
-
spec.required_ruby_version = '>= 2
|
|
39
|
+
spec.required_ruby_version = '>= 3.2'
|
|
34
40
|
|
|
35
41
|
spec.add_development_dependency 'bundler'
|
|
36
42
|
spec.add_development_dependency 'rake', '~> 12.3'
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pg_failover
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aleksandar Ivanov
|
|
8
8
|
- Andy Chambers
|
|
9
9
|
- Sasha Gerrand
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: exe
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: bundler
|
|
@@ -103,7 +102,9 @@ executables: []
|
|
|
103
102
|
extensions: []
|
|
104
103
|
extra_rdoc_files: []
|
|
105
104
|
files:
|
|
106
|
-
- ".
|
|
105
|
+
- ".github/CODEOWNERS"
|
|
106
|
+
- ".github/workflows/build-and-test.yml"
|
|
107
|
+
- ".github/workflows/publish-gem.yml"
|
|
107
108
|
- ".gitignore"
|
|
108
109
|
- ".rspec"
|
|
109
110
|
- ".rubocop.yml"
|
|
@@ -116,12 +117,14 @@ files:
|
|
|
116
117
|
- Rakefile
|
|
117
118
|
- bin/console
|
|
118
119
|
- bin/setup
|
|
120
|
+
- catalog-info.yaml
|
|
119
121
|
- lib/pg_failover.rb
|
|
120
122
|
- lib/pg_failover/active_record_adapter.rb
|
|
121
123
|
- lib/pg_failover/config.rb
|
|
122
124
|
- lib/pg_failover/connection_validator.rb
|
|
123
125
|
- lib/pg_failover/sequel_adapter.rb
|
|
124
126
|
- lib/pg_failover/throttle.rb
|
|
127
|
+
- lib/pg_failover/version.rb
|
|
125
128
|
- pg_failover.gemspec
|
|
126
129
|
homepage: https://github.com/FundingCircle/pg_failover
|
|
127
130
|
licenses:
|
|
@@ -130,7 +133,6 @@ metadata:
|
|
|
130
133
|
changelog_uri: https://github.com/FundingCircle/pg_failover/blob/master/CHANGELOG.md
|
|
131
134
|
homepage_uri: https://github.com/FundingCircle/pg_failover
|
|
132
135
|
source_code_uri: https://github.com/FundingCircle/pg_failover
|
|
133
|
-
post_install_message:
|
|
134
136
|
rdoc_options: []
|
|
135
137
|
require_paths:
|
|
136
138
|
- lib
|
|
@@ -138,15 +140,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
138
140
|
requirements:
|
|
139
141
|
- - ">="
|
|
140
142
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: '2
|
|
143
|
+
version: '3.2'
|
|
142
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
145
|
requirements:
|
|
144
146
|
- - ">="
|
|
145
147
|
- !ruby/object:Gem::Version
|
|
146
148
|
version: '0'
|
|
147
149
|
requirements: []
|
|
148
|
-
rubygems_version:
|
|
149
|
-
signing_key:
|
|
150
|
+
rubygems_version: 4.0.20
|
|
150
151
|
specification_version: 4
|
|
151
152
|
summary: Handle Postgres failover events gracefully.
|
|
152
153
|
test_files: []
|
data/.circleci/config.yml
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
commands:
|
|
3
|
-
install-dependencies:
|
|
4
|
-
steps:
|
|
5
|
-
- restore_cache:
|
|
6
|
-
keys:
|
|
7
|
-
- pg_failover-{{ checksum "pg_failover.gemspec" }}-{{ checksum "Gemfile" }}
|
|
8
|
-
- run:
|
|
9
|
-
name: Install Ruby gems
|
|
10
|
-
command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
|
|
11
|
-
- save_cache:
|
|
12
|
-
key: pg_failover-{{ checksum "pg_failover.gemspec" }}-{{ checksum "Gemfile" }}
|
|
13
|
-
paths:
|
|
14
|
-
- vendor/bundle
|
|
15
|
-
|
|
16
|
-
style:
|
|
17
|
-
steps:
|
|
18
|
-
- run:
|
|
19
|
-
name: Run static code analysis
|
|
20
|
-
command: bundle exec rubocop
|
|
21
|
-
|
|
22
|
-
test:
|
|
23
|
-
steps:
|
|
24
|
-
- run:
|
|
25
|
-
name: Run unit tests
|
|
26
|
-
command: bundle exec rspec --format progress --format RspecJunitFormatter -o spec/reports/junit.xml
|
|
27
|
-
- store_test_results:
|
|
28
|
-
path: spec/reports
|
|
29
|
-
|
|
30
|
-
executors:
|
|
31
|
-
ruby:
|
|
32
|
-
docker:
|
|
33
|
-
- image: cimg/ruby:<< parameters.tag >>
|
|
34
|
-
parameters:
|
|
35
|
-
tag:
|
|
36
|
-
description: "Docker image tag"
|
|
37
|
-
default: "latest"
|
|
38
|
-
type: string
|
|
39
|
-
|
|
40
|
-
jobs:
|
|
41
|
-
build:
|
|
42
|
-
executor:
|
|
43
|
-
name: ruby
|
|
44
|
-
tag: << parameters.tag >>
|
|
45
|
-
parameters:
|
|
46
|
-
tag:
|
|
47
|
-
description: "Docker image tag"
|
|
48
|
-
default: << parameters.tag >>
|
|
49
|
-
type: string
|
|
50
|
-
steps:
|
|
51
|
-
- checkout
|
|
52
|
-
- install-dependencies
|
|
53
|
-
- style
|
|
54
|
-
- test
|
|
55
|
-
publish:
|
|
56
|
-
executor:
|
|
57
|
-
name: ruby
|
|
58
|
-
tag: "3.0"
|
|
59
|
-
steps:
|
|
60
|
-
- checkout
|
|
61
|
-
- install-dependencies
|
|
62
|
-
- run:
|
|
63
|
-
name: Build gem
|
|
64
|
-
command: bundle exec rake build
|
|
65
|
-
- run:
|
|
66
|
-
name: Configure RubyGems API key
|
|
67
|
-
command: |
|
|
68
|
-
mkdir -p ~/.gem
|
|
69
|
-
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
|
|
70
|
-
chmod 0600 ~/.gem/credentials
|
|
71
|
-
- run:
|
|
72
|
-
name: Publish gem
|
|
73
|
-
command: |
|
|
74
|
-
package="$(ls -t1 pkg/pg_failover-*.gem | head -1)"
|
|
75
|
-
gem push "$package"
|
|
76
|
-
|
|
77
|
-
workflows:
|
|
78
|
-
test-and-publish:
|
|
79
|
-
jobs:
|
|
80
|
-
- build:
|
|
81
|
-
filters:
|
|
82
|
-
tags:
|
|
83
|
-
only: /.*/
|
|
84
|
-
name: "ruby25"
|
|
85
|
-
tag: "2.5"
|
|
86
|
-
- build:
|
|
87
|
-
filters:
|
|
88
|
-
tags:
|
|
89
|
-
only: /.*/
|
|
90
|
-
name: "ruby26"
|
|
91
|
-
tag: "2.6"
|
|
92
|
-
- build:
|
|
93
|
-
filters:
|
|
94
|
-
tags:
|
|
95
|
-
only: /.*/
|
|
96
|
-
name: "ruby27"
|
|
97
|
-
tag: "2.7"
|
|
98
|
-
- build:
|
|
99
|
-
filters:
|
|
100
|
-
tags:
|
|
101
|
-
only: /.*/
|
|
102
|
-
name: "ruby30"
|
|
103
|
-
tag: "3.0"
|
|
104
|
-
- publish:
|
|
105
|
-
context: org-rubygems
|
|
106
|
-
filters:
|
|
107
|
-
branches:
|
|
108
|
-
ignore: /.*/
|
|
109
|
-
tags:
|
|
110
|
-
only: /^v\d{1,2}\.\d{1,2}\.\d{1,2}.*/
|
|
111
|
-
requires:
|
|
112
|
-
- ruby25
|
|
113
|
-
- ruby26
|
|
114
|
-
- ruby27
|
|
115
|
-
- ruby30
|