forest_admin_agent 1.23.2 → 1.24.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 135550abc6aca99db50298be6e08e1c323d19ac7dcf6df0989a2880188d2ffbf
|
|
4
|
+
data.tar.gz: 3470c3b166b4adb784b957f324e4ad7464d5d7e1c9a847af911a8ac6653589d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2c70d626d7dfee543a32b16514f254ccf87d811fb4ccf240d2cd14f72c5a183688a955b55dbb955fbd6de35cb7bf20228b9d39c63184a100882d18f881b5b0c
|
|
7
|
+
data.tar.gz: 9463af8407e8a6cac77401a1e47ac45c27a560e36b6a9c933de6adbf748857b710246d00c62498aaf08ac35eb8146e6021bef712e96810bb19818a1bf26f7895
|
|
@@ -11,6 +11,7 @@ module ForestAdminAgent
|
|
|
11
11
|
include ForestAdminDatasourceCustomizer::DSL::DatasourceHelpers
|
|
12
12
|
|
|
13
13
|
attr_reader :customizer, :container, :has_env_secret
|
|
14
|
+
attr_accessor :schema_only_mode
|
|
14
15
|
|
|
15
16
|
def setup(options)
|
|
16
17
|
@options = options
|
|
@@ -55,7 +56,22 @@ module ForestAdminAgent
|
|
|
55
56
|
# Reset route cache to ensure routes are computed with all customizations
|
|
56
57
|
ForestAdminAgent::Http::Router.reset_cached_routes!
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
if @schema_only_mode
|
|
60
|
+
generate_schema_only
|
|
61
|
+
else
|
|
62
|
+
send_schema
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def generate_schema_only
|
|
67
|
+
datasource = @container.resolve(:datasource)
|
|
68
|
+
schema = build_schema(datasource)
|
|
69
|
+
schema_path = Facades::Container.cache(:schema_path)
|
|
70
|
+
|
|
71
|
+
write_schema_file(schema_path, schema)
|
|
72
|
+
@logger.log('Info', "[ForestAdmin] Schema generated successfully at #{schema_path}")
|
|
73
|
+
|
|
74
|
+
schema
|
|
59
75
|
end
|
|
60
76
|
|
|
61
77
|
def reload!
|
|
@@ -161,9 +177,7 @@ module ForestAdminAgent
|
|
|
161
177
|
should_send = do_server_want_schema(api_map[:meta][:schemaFileHash])
|
|
162
178
|
|
|
163
179
|
if should_send || force
|
|
164
|
-
|
|
165
|
-
client.post('/forest/apimaps', api_map.to_json)
|
|
166
|
-
ForestAdminAgent::Facades::Container.logger.log('Info', 'schema was updated, sending new version')
|
|
180
|
+
send_schema_to_server(api_map)
|
|
167
181
|
else
|
|
168
182
|
@container.resolve(:logger)
|
|
169
183
|
ForestAdminAgent::Facades::Container.logger.log('Info', 'Schema was not updated since last run')
|
|
@@ -241,6 +255,25 @@ module ForestAdminAgent
|
|
|
241
255
|
@logger.log('Info',
|
|
242
256
|
"[ForestAdmin] Running in #{environment} mode")
|
|
243
257
|
end
|
|
258
|
+
|
|
259
|
+
def send_schema_to_server(api_map)
|
|
260
|
+
ForestAdminAgent::Facades::Container.logger.log('Info', 'schema was updated, sending new version')
|
|
261
|
+
client = ForestAdminAgent::Http::ForestAdminApiRequester.new
|
|
262
|
+
client.post('/forest/apimaps', api_map.to_json)
|
|
263
|
+
rescue Faraday::Error => e
|
|
264
|
+
status = e.response[:status] if e.response
|
|
265
|
+
if status
|
|
266
|
+
ForestAdminAgent::Facades::Container.logger.log(
|
|
267
|
+
'Error',
|
|
268
|
+
"Failed to send schema: invalid request (HTTP #{status})"
|
|
269
|
+
)
|
|
270
|
+
else
|
|
271
|
+
ForestAdminAgent::Facades::Container.logger.log(
|
|
272
|
+
'Error',
|
|
273
|
+
'Failed to send schema: cannot reach ForestAdmin server'
|
|
274
|
+
)
|
|
275
|
+
end
|
|
276
|
+
end
|
|
244
277
|
end
|
|
245
278
|
end
|
|
246
279
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.24.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthieu
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-02-
|
|
12
|
+
date: 2026-02-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|