odba 1.2.0 → 1.2.1
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/workflows/devenv.yml +14 -10
- data/.github/workflows/ruby.yml +1 -2
- data/.gitignore +4 -0
- data/History.md +20 -0
- data/devenv.nix +15 -2
- data/devenv.yaml +8 -0
- data/lib/odba/version.rb +1 -1
- data/test/test_cache.rb +9 -0
- data/test/test_drbwrapper.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea8626e332e7e9650d0221804e2cc6b6767e0fdedbabb507faaa2ad104b4199e
|
|
4
|
+
data.tar.gz: '06848ad3f7def177deec9c62385e1b63c56fcbf3e6d161f3a73e60a70a0c92a9'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d55bb2c6b46d92bd89da28489544b8fc68e8c4fd16a94f3deefef5970376fa2a607c9c9c811506c6f66147f02fcc9981148baf89acd54ae528c51c2b0a7dda6
|
|
7
|
+
data.tar.gz: 2337e2c7910c89653bdb6ddb90150aa38794096f1c5110bd94ae0f4bd54f84006d6ae8cf4bb08bc467e1d0c78d5d28cbfd5e7788611cf75bb83739432d8f3a75
|
|
@@ -7,24 +7,28 @@ on:
|
|
|
7
7
|
jobs:
|
|
8
8
|
tests:
|
|
9
9
|
strategy:
|
|
10
|
+
# without this a failure on one OS cancels the other, hiding its result
|
|
11
|
+
fail-fast: false
|
|
10
12
|
matrix:
|
|
11
|
-
|
|
13
|
+
# macos-latest dropped: it costs ~8 minutes per run for a library that
|
|
14
|
+
# is deployed on Linux, and its Nix/devenv setup is the fragile part -
|
|
15
|
+
# not odba itself. Re-add it here if that ever becomes worth the wait.
|
|
16
|
+
os: [ubuntu-latest]
|
|
12
17
|
runs-on: ${{ matrix.os }}
|
|
13
18
|
|
|
14
19
|
steps:
|
|
15
20
|
- uses: actions/checkout@v4
|
|
16
|
-
- uses: cachix/install-nix-action@
|
|
17
|
-
- uses: cachix/cachix-action@
|
|
21
|
+
- uses: cachix/install-nix-action@v31
|
|
22
|
+
- uses: cachix/cachix-action@v16
|
|
18
23
|
with:
|
|
19
24
|
name: devenv
|
|
20
25
|
- name: Install devenv.sh
|
|
21
26
|
run: nix profile install nixpkgs#devenv
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
# devenv test builds the shell, runs any pre-commit hooks, brings the
|
|
29
|
+
# postgres service up and then runs enterTest, which waits for the server
|
|
30
|
+
# and runs test/example.rb against it. A separate step re-running
|
|
31
|
+
# example.rb duplicated that work and raced initdb a second time without
|
|
32
|
+
# waiting, which is what kept macOS red.
|
|
33
|
+
- name: Build the devenv shell and run test/example.rb against a real postgres
|
|
24
34
|
run: devenv test
|
|
25
|
-
|
|
26
|
-
- name: Run the example.rb which uses a real database
|
|
27
|
-
shell: devenv shell bash -- -e {0}
|
|
28
|
-
run: |
|
|
29
|
-
devenv up --detach
|
|
30
|
-
devenv shell bundle exec ruby test/example.rb
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -25,9 +25,8 @@ jobs:
|
|
|
25
25
|
matrix:
|
|
26
26
|
os: [ ubuntu]
|
|
27
27
|
ruby: [3.2, 3.3, 3.4]
|
|
28
|
-
continue-on-error: ${{ matrix.ruby.to_s == '3.3' || matrix.ruby.to_s == '3.4' }}
|
|
29
28
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
29
|
+
- uses: actions/checkout@v4
|
|
31
30
|
- uses: ruby/setup-ruby@v1
|
|
32
31
|
with:
|
|
33
32
|
ruby-version: ${{ matrix.ruby }}
|
data/.gitignore
CHANGED
data/History.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 1.2.1 / 21.08.2026
|
|
2
|
+
|
|
3
|
+
No library changes: lib/ is identical to 1.2.0. This release only ships a test
|
|
4
|
+
suite and CI that pass.
|
|
5
|
+
|
|
6
|
+
* Cleared CacheEntry's @@id_table between cache tests. Its ObjectSpace
|
|
7
|
+
finalizer calls ODBA.cache.invalidate, so objects left by earlier tests were
|
|
8
|
+
collected at unpredictable moments and deleted ids the running test had just
|
|
9
|
+
stored - the long standing flakiness in test_clean, test_clean__prefetched
|
|
10
|
+
and test_transaction
|
|
11
|
+
* Fixed test_to_obj for drb >= 2.2, which resolves only ids to_id handed out
|
|
12
|
+
rather than looking them up with ObjectSpace._id2ref
|
|
13
|
+
* Bumped install-nix-action to v31: v26 cannot provision Nix build users on
|
|
14
|
+
current macOS images
|
|
15
|
+
* Stopped starting the processes twice in enterTest and waited for postgres
|
|
16
|
+
before running test/example.rb
|
|
17
|
+
* Declared the git-hooks input that current devenv no longer injects implicitly
|
|
18
|
+
* Dropped a continue-on-error that used matrix.ruby.to_s, which GitHub Actions
|
|
19
|
+
expressions do not support, so it silently never applied
|
|
20
|
+
|
|
1
21
|
## 1.2.0 / 21.08.2026
|
|
2
22
|
|
|
3
23
|
* Reconnect when the database connection was lost. ydbd-pg reports a lost
|
data/devenv.nix
CHANGED
|
@@ -47,7 +47,20 @@
|
|
|
47
47
|
languages.ruby.version = "3.4";
|
|
48
48
|
# See full reference at https://devenv.sh/reference/options/
|
|
49
49
|
enterTest = ''
|
|
50
|
-
devenv up
|
|
51
|
-
|
|
50
|
+
# No `devenv up` here: `devenv test` already starts the processes before
|
|
51
|
+
# running enterTest, so starting them again aborts the whole run with
|
|
52
|
+
# "Processes already running with PID ...".
|
|
53
|
+
#
|
|
54
|
+
# Those processes come up in parallel with this script. On slower runners
|
|
55
|
+
# initdb is still creating template0 when we arrive and the first connect
|
|
56
|
+
# is refused, so wait for postgres to accept connections. The bare
|
|
57
|
+
# pg_isready afterwards turns "never came up" into a clear error rather
|
|
58
|
+
# than a confusing PG::ConnectionBad from the test.
|
|
59
|
+
for _ in $(seq 1 60); do
|
|
60
|
+
if pg_isready --host 127.0.0.1 --port 5432 > /dev/null 2>&1; then break; fi
|
|
61
|
+
sleep 1
|
|
62
|
+
done
|
|
63
|
+
pg_isready --host 127.0.0.1 --port 5432
|
|
64
|
+
bundle exec ruby test/example.rb
|
|
52
65
|
'';
|
|
53
66
|
}
|
data/devenv.yaml
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
inputs:
|
|
2
2
|
nixpkgs:
|
|
3
3
|
url: github:NixOS/nixpkgs/nixos-24.11
|
|
4
|
+
# Declared explicitly because devenv no longer injects it implicitly: its
|
|
5
|
+
# git-hooks module throws "git-hooks or pre-commit-hooks input required".
|
|
6
|
+
# This mirrors what devenv.lock already records, so the lock stays valid.
|
|
7
|
+
git-hooks:
|
|
8
|
+
url: github:cachix/git-hooks.nix
|
|
9
|
+
inputs:
|
|
10
|
+
nixpkgs:
|
|
11
|
+
follows: nixpkgs
|
|
4
12
|
nixpkgs-ruby:
|
|
5
13
|
url: github:bobvanderlinden/nixpkgs-ruby
|
|
6
14
|
inputs:
|
data/lib/odba/version.rb
CHANGED
data/test/test_cache.rb
CHANGED
|
@@ -33,6 +33,15 @@ module ODBA
|
|
|
33
33
|
@cache.fetched = {}
|
|
34
34
|
@cache.prefetched = {}
|
|
35
35
|
@cache.indices = {}
|
|
36
|
+
## CacheEntry registers an ObjectSpace finalizer that calls
|
|
37
|
+
## ODBA.cache.invalidate, which deletes the odba_id from the shared
|
|
38
|
+
## singleton cache. Objects left behind by earlier tests are collected at
|
|
39
|
+
## unpredictable moments, so without dropping their finalizer bookkeeping
|
|
40
|
+
## a stray GC run deletes the very ids this test just stored. That is the
|
|
41
|
+
## long standing flakiness in test_clean, test_clean__prefetched and
|
|
42
|
+
## test_transaction: they failed on some Ruby versions and not others,
|
|
43
|
+
## and a different test failed on each run of identical code.
|
|
44
|
+
ODBA::CacheEntry.class_variable_set(:@@id_table, {})
|
|
36
45
|
end
|
|
37
46
|
|
|
38
47
|
def teardown
|
data/test/test_drbwrapper.rb
CHANGED
|
@@ -78,7 +78,13 @@ module ODBA
|
|
|
78
78
|
def test_to_obj
|
|
79
79
|
ODBA.cache.should_receive(:store)
|
|
80
80
|
o = Object.new
|
|
81
|
-
|
|
81
|
+
## drb >= 2.2 resolves only those ids it handed out itself: DRbIdConv
|
|
82
|
+
## keeps a DRbObjectSpace WeakMap that to_id populates, and to_obj raises
|
|
83
|
+
## RangeError for anything absent from it. Older drb looked the id up
|
|
84
|
+
## with ObjectSpace._id2ref, which resolved any live object. Register the
|
|
85
|
+
## object first, as real DRb traffic does - an id only reaches to_obj
|
|
86
|
+
## after to_id produced it.
|
|
87
|
+
assert_equal(o, @idconv.to_obj(@idconv.to_id(o)))
|
|
82
88
|
o.extend(ODBA::Persistable)
|
|
83
89
|
o.instance_variable_set(:@odba_id, 4)
|
|
84
90
|
o.odba_isolated_store
|