activestorage-multi_node_disk 0.1.0 → 0.1.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ab5ed3cac5873413b1c2ff121a8bbe5b551a1ef13b243ad2f1562c1c0bb2187
|
|
4
|
+
data.tar.gz: e54afda800d09ffc008af042e81c54dc168bc355e887406ef0a3f94a0e541c9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0c584a2ac8073bf73d766073018dc9e229f54b1d3c35989ad8dae0e0a94bd85d98628dbeb7c25390f058725a27f1c9680c3813ed5ac648908c200ac6e20dc3d
|
|
7
|
+
data.tar.gz: 9bdc7dc391b4695b3135c49dde92394295be0c97096263636bb30310309709f46a34ad96482b33b6dc331c11948289a2ee335e61ccf42db268d8dd9e45aac670
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ minor version may change public APIs; each entry says how.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.1] - 2026-11-10
|
|
11
|
+
|
|
12
|
+
### Security
|
|
13
|
+
|
|
14
|
+
- Development dependencies take their patched releases: Rails 8.1.4.1
|
|
15
|
+
(including Active Storage, for GHSA-f3w6-w445-fwh9), Rack 3.2.8, Nokogiri
|
|
16
|
+
1.19.7, Loofah 2.25.3, Crass 1.0.8, rails-html-sanitizer 1.7.2, Addressable
|
|
17
|
+
2.9.2, sqlite3 2.10.2 and Trilogy 2.13.3. The gem's runtime requirement
|
|
18
|
+
(`activestorage >= 8.1, < 9`) is unchanged; hosts should update Rails
|
|
19
|
+
themselves.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Development uses Ruby 4.0.9 and Bundler 4.0.24. CI pins
|
|
24
|
+
`ruby/setup-ruby` v1.338.0 and its PostgreSQL 17 and MySQL 8.0 service
|
|
25
|
+
images by digest.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- The audit migration from `install --audit` now finishes a run that stopped
|
|
30
|
+
part way: each statement has its own guard (`table_exists?`,
|
|
31
|
+
`index_exists?`), so a table left without its index gets the index, and on
|
|
32
|
+
Oracle an empty table left without its sequence is dropped and recreated.
|
|
33
|
+
Hosts that already ran the migration need not change anything.
|
|
34
|
+
|
|
10
35
|
## [0.1.0] - 2026-10-20
|
|
11
36
|
|
|
12
37
|
The first release.
|
|
@@ -39,5 +64,6 @@ The first release.
|
|
|
39
64
|
- `ActiveStorage::MultiNodeDisk::TestHelper`: fake nodes answered by the real
|
|
40
65
|
endpoint in process.
|
|
41
66
|
|
|
42
|
-
[Unreleased]: https://github.com/clearstackio/activestorage-multi_node_disk/compare/v0.1.
|
|
67
|
+
[Unreleased]: https://github.com/clearstackio/activestorage-multi_node_disk/compare/v0.1.1...HEAD
|
|
68
|
+
[0.1.1]: https://github.com/clearstackio/activestorage-multi_node_disk/compare/v0.1.0...v0.1.1
|
|
43
69
|
[0.1.0]: https://github.com/clearstackio/activestorage-multi_node_disk/releases/tag/v0.1.0
|
data/CONTRIBUTING.md
CHANGED
|
@@ -10,7 +10,7 @@ notice.
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
Tools are pinned in `mise.toml` (Ruby 4.0.
|
|
13
|
+
Tools are pinned in `mise.toml` (Ruby 4.0.9; the gem supports 3.3+).
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
16
|
bin/setup # mise install, bundle install, rake
|
|
@@ -75,7 +75,7 @@ publisher on rubygems.org (Profile → Trusted publishers): gem
|
|
|
75
75
|
run `bundle install` so `Gemfile.lock` follows.
|
|
76
76
|
2. Move the `[Unreleased]` entries in `CHANGELOG.md` under the new version
|
|
77
77
|
and date, and update the compare links at the bottom.
|
|
78
|
-
3. Commit, then tag and push: `git tag
|
|
78
|
+
3. Commit, then tag and push: `git tag vX.Y.Z && git push origin master vX.Y.Z`.
|
|
79
79
|
|
|
80
80
|
The workflow checks the tag matches `VERSION`, runs `rake`, then builds,
|
|
81
81
|
pushes and attests the gem.
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
# The :table audit sink (activestorage-multi_node_disk): one row per entry,
|
|
2
2
|
# the whole entry in payload. Runs on PostgreSQL (jsonb), MySQL 8 (json),
|
|
3
3
|
# Oracle (CLOB) and SQLite (text); the model reads it with
|
|
4
|
-
# `attribute :payload, :json`. Safe to run again
|
|
4
|
+
# `attribute :payload, :json`. Safe to run again (each statement has its
|
|
5
|
+
# own guard: a run stopped after CREATE TABLE must still add the index);
|
|
6
|
+
# reversible.
|
|
5
7
|
class CreateActiveStorageMultiNodeDiskAudits < ActiveRecord::Migration<%= migration_version %>
|
|
6
8
|
TABLE = :<%= table_name %>
|
|
7
9
|
INDEX = "<%= index_name %>"
|
|
8
10
|
|
|
9
11
|
def up
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
drop_table TABLE if table_without_sequence?(TABLE)
|
|
13
|
+
unless table_exists?(TABLE)
|
|
14
|
+
create_table TABLE do |t|
|
|
15
|
+
t.column :payload, payload_type, null: false
|
|
16
|
+
t.datetime :created_at, null: false
|
|
17
|
+
end
|
|
15
18
|
end
|
|
16
|
-
add_index TABLE, :created_at, name: INDEX
|
|
19
|
+
add_index TABLE, :created_at, name: INDEX unless index_exists?(TABLE, :created_at, name: INDEX)
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
def down
|
|
@@ -22,6 +25,17 @@ class CreateActiveStorageMultiNodeDiskAudits < ActiveRecord::Migration<%= migrat
|
|
|
22
25
|
|
|
23
26
|
private
|
|
24
27
|
|
|
28
|
+
# Oracle creates the table, then its sequence, in two statements; a run
|
|
29
|
+
# stopped between them left an empty table nothing can insert into
|
|
30
|
+
# (ORA-02289). Raw SQL, Oracle only: Rails has no sequence probe. It reads
|
|
31
|
+
# the session's current schema, as table_exists? does (`schema:` setting).
|
|
32
|
+
def table_without_sequence?(table)
|
|
33
|
+
connection.adapter_name.match?(/oracle/i) && table_exists?(table) &&
|
|
34
|
+
select_value("SELECT COUNT(*) FROM all_sequences WHERE sequence_owner = SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') " \
|
|
35
|
+
"AND sequence_name = #{quote(default_sequence_name(table.to_s, nil).upcase)}").to_i.zero? &&
|
|
36
|
+
select_value("SELECT COUNT(*) FROM #{table}").to_i.zero?
|
|
37
|
+
end
|
|
38
|
+
|
|
25
39
|
# JSON where the database has a JSON type; a CLOB (text) elsewhere.
|
|
26
40
|
def payload_type
|
|
27
41
|
case connection.adapter_name
|