startback 1.2.4 → 2.0.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.
data/CHANGELOG.md ADDED
@@ -0,0 +1,815 @@
1
+ ## 2.0.0 - 2026-09-29
2
+
3
+ Major dependency upgrade. Sinatra 4 (hence Rack 3) is now required, and the
4
+ ranges of the other dependencies are widened so that their latest major
5
+ release is picked by default while applications remain free to pin an older
6
+ one in their own Gemfile.
7
+
8
+ **Startback's own API is unchanged.** Every class, require path, constructor
9
+ argument and public method behaves as in 1.2.x. The major bump is about the
10
+ dependency floor, and about what that floor asks of the applications built on
11
+ top -- which is most of what follows.
12
+
13
+ **See [UPGRADING.md](UPGRADING.md) for the migration guide**: what you will
14
+ see, why, and what to do about it. The short version is that a typical API
15
+ service needs two changes, setting `RACK_ENV` and lowercasing the response
16
+ triples it builds by hand.
17
+
18
+ ### BREAKING: Sinatra 4 and Rack 3 are now required
19
+
20
+ Startback's own middlewares now rely on `Rack::Headers`, which only exists in
21
+ Rack 3. There is no way to stay on Sinatra 3 with this release.
22
+
23
+ * **Response headers must be lowercase.** The Rack 3 SPEC states that header
24
+ keys "must not contain uppercase ASCII characters". Any place where your
25
+ application builds a response triple by hand, e.g.
26
+ `[200, {"Content-Type" => "application/json"}, [body]]`, must now use
27
+ `"content-type"`. Nothing crashes if you don't, but a Rack 3 middleware
28
+ looking the header up in lowercase will not find it and will happily add its
29
+ own, so the response goes out with the header twice. This is exactly the bug
30
+ that `AutoCaching` and `CorsHeaders` had, and that this release fixes.
31
+
32
+ * **Response bodies must respond to `each` or `call`.** A bare String is no
33
+ longer a valid body: `[404, {}, "NotFound"]` must become
34
+ `[404, {}, ["NotFound"]]`.
35
+
36
+ * Rack 2-only middlewares in your stack (anything using the removed
37
+ `Rack::Utils::HeaderHash`, or `Rack::File`) will break. This is the usual
38
+ Rack 2 to 3 migration and is not specific to Startback.
39
+
40
+ * **`Rack::Protection::HostAuthorization` is enabled by Sinatra 4.** In the
41
+ `development` environment — which is the one used whenever neither `RACK_ENV`
42
+ nor `APP_ENV` is set — only `localhost`, `*.localhost`, `*.test` and IP
43
+ literals are accepted as `Host`. Anything else gets a `403 Host not
44
+ permitted` before reaching any route. In every other environment the check is
45
+ disabled, so *production deployments are not affected*. What is affected:
46
+
47
+ - local development behind a custom hostname or a docker-compose service name;
48
+ - test suites, since `Rack::Test` issues requests against `example.org`.
49
+
50
+ Set `RACK_ENV` (`test` in test suites, as Startback's own specs now do), or
51
+ configure the permitted hosts explicitly:
52
+
53
+ class MyApi < Startback::Web::Api
54
+ set :host_authorization, { permitted_hosts: [".my-app.internal"] }
55
+ end
56
+
57
+ ### BREAKING: Ruby >= 3.2 is now required
58
+
59
+ Declared through `required_ruby_version`, because that is what bunny 3,
60
+ finitio 1.0, http 6, json 3 and nokogiri 1.19 all require. Ruby 3.1 reached
61
+ end of life in March 2025 and was never part of the test matrix.
62
+
63
+ ### BREAKING: `JSON.fast_generate` is gone
64
+
65
+ Removed by json 3. Startback used it in `Security::RateLimiter` and
66
+ `Caching::EntityCache#encode_key`, both of which now use `JSON.generate`. The
67
+ generated keys are identical, so caches and rate limit counters are not
68
+ invalidated. Applications calling `JSON.fast_generate` themselves must do the
69
+ same substitution.
70
+
71
+ ### BREAKING: rack-robustness 2 is now required
72
+
73
+ `Web::Shield` and `Web::CatchAll` subclass it. 2.0.0 requires Rack 3, and
74
+ emits lowercase header names everywhere -- including the last resort
75
+ response, the one returned when error handling itself fails, which is a raw
76
+ Rack triple and so never went through `Rack::Response` normalization. That
77
+ was the only genuinely Rack 3 non-compliant response Startback produced.
78
+
79
+ It also normalizes the header names given to its DSL, fixing a silent bug
80
+ where `g.headers('content-type' => ...)` lost to the `'Content-Type'`
81
+ default. Startback spells it `content_type` and never hit that one, but
82
+ applications configuring their own `Shield` subclass in lowercase did.
83
+
84
+ ### Dependencies whose major version is now the default
85
+
86
+ Startback does not use most of these itself: they are shipped as a convenience,
87
+ and their ranges have been widened rather than moved, so `< 4.0` style
88
+ constraints in your own Gemfile keep working. A plain `bundle update` will
89
+ however resolve to the newest of each, and each has its own breaking changes:
90
+
91
+ * **puma 6 -> 8** (`>= 6.0.2, < 9.0`). Puma 7 renamed every lifecycle hook
92
+ (`on_worker_boot` -> `before_worker_boot`, and so on), made `preload_app!`
93
+ the default in clustered mode, and lowercased its response headers. Puma 8
94
+ changed the default production bind from `0.0.0.0` to `::` when an IPv6
95
+ interface is available, which matters for container port publishing.
96
+
97
+ * **jwt 2 -> 3** (`>= 2.1, < 4.0`). This one has teeth: RSA keys must now be at
98
+ least 2048 bits, base64 decoding follows RFC 4648 strictly, the payload
99
+ cannot be read before the signature is verified, `HS512256` is dropped, and
100
+ custom algorithms must include `JWT::JWA::SigningAlgorithm`. Since 3.3, code
101
+ that rescues `JWT::DecodeError`, `JWT::IncorrectAlgorithm` or `ArgumentError`
102
+ *around `JWT.encode`* must rescue `JWT::EncodeError` instead. Applications
103
+ doing anything non-trivial with JWT should read its `UPGRADING.md` and pin
104
+ `jwt` themselves if they are not ready.
105
+
106
+ * **bunny 2 -> 3** (`>= 2.14, < 4.0`). Used by `Event::Bus::Bunny::Async`.
107
+ Versioned delivery tags are removed, passive declarations are no longer
108
+ replayed by topology recovery, and the `openssl` gem >= 3.3 is now required,
109
+ which means a native build in slim images.
110
+
111
+ * **finitio 0.12 -> 1.0** (`>= 0.12, < 2.0`). Two changes affect `.fio`
112
+ schemas: the `Fixnum` and `Bignum` aliases are removed (use `Integer`), and
113
+ the `FalseClass` alias is fixed — it used to be an alias of `.TrueClass`, so
114
+ it accepted `true` and rejected `false`. A schema that worked around that bug
115
+ now means the opposite of what it did.
116
+
117
+ * **http 5 -> 6** (`>= 5.0, < 7.0`) and **nokogiri**, **tzinfo**, **i18n**,
118
+ **mustache**: unchanged ranges or widened, never loaded by Startback itself.
119
+
120
+ ### Other changes
121
+
122
+ * `Web::HealthCheck` now returns a lowercase `content-type` header, as do
123
+ `Jobs::Support::JobResult::Embedded` and `::Redirect` in `startback-jobs`.
124
+ HTTP header names are case-insensitive and every client normalizes them, so
125
+ this only matters if you assert on the raw Rack triple.
126
+
127
+ * Development dependency on `webspicy` is dropped from `startback.gemspec`:
128
+ Startback's own specs never used it. `rack-test`, which used to arrive
129
+ transitively through it, is now an explicit development dependency.
130
+
131
+ * `benchmark`, `json`, `logger` and `ostruct` are now explicit runtime
132
+ dependencies. They are required by `lib/startback.rb` and stop being default
133
+ gems in Ruby 3.5.
134
+
135
+ * The example application and both contrib gems moved to webspicy 1.0, whose
136
+ own ranges are what makes finitio 1.0, http 6 and rack-robustness 2.0
137
+ reachable at all here: every 0.27.x release capped the three of them. On the
138
+ way through 0.27 they also started validating unstructured response bodies
139
+ against `output_schema` instead of skipping them.
140
+
141
+ ### Known gaps
142
+
143
+ * The Bunny event bus has no automated coverage — the test matrix has no
144
+ RabbitMQ — so bunny 3 is upgraded but unverified by the suite. Likewise,
145
+ `http`, `jwt`, `puma`, `nokogiri`, `tzinfo`, `i18n` and `mustache` are never
146
+ loaded by Startback, so the suite says nothing about their new majors.
147
+
148
+ * Applications testing with webspicy must move to its 1.x line. Every 0.27.x
149
+ release requires `finitio < 0.13`, `http < 6.0` and `rack-robustness < 2.0`,
150
+ which conflicts with what Startback now asks for: bundler fails to resolve
151
+ rather than quietly holding a version back.
152
+
153
+ ## 1.2.4 - 2026-09-01
154
+
155
+ * Allow bmg 0.24.0
156
+
157
+ ## 1.2.3 - 2026-03-31
158
+
159
+ * Fix redactor when handling invalid string encoding.
160
+
161
+ ## 1.2.2 - 2026-02-03
162
+
163
+ * Add `emits_on_commit` event hook to avoid race conditions between sender and
164
+ receiver against the database.
165
+
166
+ ## 1.2.1 - 2025-09-03
167
+
168
+ * Add :fail strategy and dynamic options to Startback::Security::RateLimiter
169
+
170
+ ## 1.2.0 - 2025-09-03
171
+
172
+ * BREAKING change: only ruby 3.3 is kept in build & test matrix.
173
+
174
+ * Don't debug caller on WARN message about default logger.
175
+
176
+ * Exposed `logger_for` publicly in Robustness module, in addition to `log`.
177
+
178
+ * Added SpyLogger that helps integration tests wanting to lightly observe
179
+ call flows.
180
+
181
+ * Added Startback::Security::RateLimiter to help limiting operation executions
182
+ as a security measure.
183
+
184
+ * Added Env#test?, in addition to production? and development?
185
+
186
+ ## 1.1.0 - 2025-02-09
187
+
188
+ * Added ruby 3.3 to the build & release matrix
189
+ * Ruby dependencies upgraded in a backward compatibility way.
190
+
191
+ ## 1.0.3 - 2024-06-27
192
+
193
+ * Allow usage of Bmg 0.23.x, that makes no broken API.
194
+
195
+ ## 1.0.2 - 2024-04-24
196
+
197
+ * The Bus abstraction now exposes a `connected?` method, implemented by the
198
+ various implementations.
199
+
200
+ ## 1.0.1 - 2023-10-25
201
+
202
+ * Tracer and LogFormatter now both use the Redactor, that correctly redacts
203
+ credentials in URLs.
204
+
205
+ ## 1.0 - 2023-06-23
206
+
207
+ This gem is used in production for several years, so we bump it to 1.x to use
208
+ better semantics versioning schemes. See README for the definition of the public
209
+ API.
210
+
211
+ * BREAKING: the `base` `api` and `engine` gems have been removed.
212
+
213
+ The main `startback` gems provides what base/api/engine already provided (they
214
+ were actually the same), while `-web` became a contrib, like `-jobs`.
215
+
216
+ * BREAKING: Only `api` and `web` docker images are kept, while `web` will be
217
+ discontinued in the future. You can use the api image for engine, as it was
218
+ the same.
219
+
220
+ * BREAKING: the images no longer have the startback gem installed. You have to
221
+ install it yourself as part of your own `bundle`.
222
+
223
+ * BREAKING: the `engine` default CMD is no longer provided by default.
224
+ For reference, we used `bundle exec puma -t 1:1 -w 0 -p 3000 config.engine.ru`
225
+ that you probably want to add to your own docker image. We recommand using
226
+ a `puma.rb` file instead, and rely on the default command of the `api` image.
227
+
228
+ * Upgraded dependencies, notably http (5.x), tzinfo (2.x) and webspicy (0.26.x).
229
+ This may force clients to upgrade them as well.
230
+
231
+ ## 0.19.4 - 2023-06-22
232
+
233
+ * Fix a bug in EntityCache error handling: do not hide primary key resolution
234
+ issues.
235
+
236
+ ## 0.19.3 - 2023-06-22
237
+
238
+ * Fix backward compatibility bug when using entity_cache without loading the
239
+ entire caching module.
240
+
241
+ ## 0.19.2 - 2023-06-22
242
+
243
+ * Improved Caching::EntityCache with more observability and error handling.
244
+
245
+ A Prometheus listener is now provided and can be installed via options passed at
246
+ cache construction (or via subclass overriding). An option also allows not raising
247
+ errors when the cache fails, and loading the entity instead. One is supposed to at
248
+ least log or monitor those errors.
249
+
250
+ ## 0.19.1 - 2023-06-01
251
+
252
+ * Startback::Support::Env exposes the development?, staging? & production? helpers
253
+
254
+ ## 0.19.0 - 2023-05-26
255
+
256
+ * BREAKING: drop support for ruby < 2.7
257
+ * Upgraded webspicy to 0.24.x
258
+ * Upgraded finitio to 0.12.x
259
+
260
+ ## 0.18.2 - 2023-05-19
261
+
262
+ * Ensure all tracing spans are propagated properly even upon catch.
263
+
264
+ ## 0.18.1 - 2023-05-19
265
+
266
+ * [startback-jobs] BREAKING: the context may no longer be provided as input to the CreateJob operation (`opContext`). The operation itself dumps the current context. Fork it if required before calling the operation.
267
+
268
+ ## 0.18.0 - 2023-05-19
269
+
270
+ * BREAKING: Audit::Trailer is removed and replaced by Audit::Tracer, inspired by open telemetry.
271
+ The following changes are necessary:
272
+
273
+ 1. Replace `around_run(Audit::Trailer.new)` by `around_run(Audit::OperationTracer.new)`
274
+ 2. (optional) Make sure an instance of `Tracer` is available on the context
275
+ 3. (optional) Make sure you add an instance of `TraceLogger` as listener on that tracer
276
+ 4. (optional) Use the Audit::Middleware to reattach to existing traces provided by api callers
277
+ through the X-Span-Id and X-Trace-Id HTTP headers.
278
+
279
+ * [startback-websocket] BREAKING: contribution is discontinued and removed. Please use Pusher instead.
280
+
281
+ * [startback-jobs] BREAKING: Bmg minimal dependency is now 0.21.0, to get a startback-jobs bug fix.
282
+
283
+ The keys of the jobs created by 0.17.x are not the same as those created by 0.18.x. Finding a job
284
+ by id may fail even if the job exists.
285
+
286
+ * [startback-jobs] BREAKING: the context may no longer be provided as input to the CreateJob operation (`opContext`). The operation itself dumps the current context. Fork it if required before calling the operation.
287
+
288
+ * The data logs are now pretty printed by default in development mode.
289
+
290
+ * Sensitive data sanitization (now called "redacting") now hides emails and adresses. The redactor
291
+ no longer remove hash entries, but replaces the values by a '---redacted---' string.
292
+
293
+ ## 0.17.4 - 2023-04-20
294
+
295
+ * Fix wrong return in proc
296
+
297
+ ## 0.17.3 - 2023-04-20
298
+
299
+ * Allow event emitters to decide not to emit anything at a later time (ignore event data when it is nil).
300
+
301
+ ## 0.17.2 - 2023-04-20
302
+
303
+ * Adds the possibility to start only :sync or :async agents in Engine#create_agents
304
+
305
+ ## 0.17.1 - 2023-03-07
306
+
307
+ * API#loaded_body now supports x-www-form-urlencoded and returns
308
+ a dup of the request params.
309
+
310
+ * [startback-websocket] Add a way to unsubscribe from a room.
311
+
312
+ ## 0.17.0 - 2023-02-22
313
+
314
+ * Upgraded sinatra to 3.x
315
+ * Upgraded webspicy to 0.23.x
316
+
317
+ ## 0.16.0 - 2023-01-24
318
+
319
+ * Upgraded puma to 6.x
320
+
321
+ * The .api and .web images no longer specify default -t
322
+ (threads) and -w (workers) options to puma commandline.
323
+
324
+ One should use PUMA_MIN_THREADS, PUMA_MAX_THREADS and
325
+ WEB_CONCURRENCY envionment variables instead. For the record,
326
+ the default values (under MRI & puma 6.0.x) are 0, 5 and 0
327
+ (no forking model), respectively.
328
+
329
+ Stricly speaking, this is a broken API, even if you will
330
+ probably not notice the change.
331
+
332
+ Also, note that the .engine image now uses `-t 1:1 -w 0`,
333
+ which should be backward compatible as well. We stopped
334
+ using the workers mode, since only one worker makes little
335
+ sense.
336
+
337
+ * Default ruby version is now 3.1 instead of 2.7
338
+
339
+ If you need ruby 2.7, you must say it explicitely, e.g.
340
+ `enspirit/startback:base-0.16-ruby2.7`
341
+
342
+ ## 0.15.5 - 2023-01-11
343
+
344
+ * [startback-jobs] add support for job failures. Failed jobs
345
+ are considered ready (`isReady: true`) but have a new flag
346
+ (`hasFailed: true`) that tracks the failure. The failure
347
+ itself is dumped in `opResult`. The API that serves the job
348
+ result always dumps the `opResult` and uses a 200 status code
349
+ in case of success and 272 in case of failure.
350
+
351
+ ## 0.15.4 - 2022-10-13
352
+
353
+ * BadRequestError and subclasses (40x) are now logged in WARN
354
+ severity instead of ERROR by the Trailer. This is considered
355
+ a good idea on almost all Enspirit projects, so we dare doing
356
+ it on a tiny version bump (angel emoji).
357
+
358
+ ## 0.15.3 - 2022-09-30
359
+
360
+ * Rebuilding of docker images on latest ruby versions.
361
+
362
+ ## 0.15.2 - 2022-08-03
363
+
364
+ * Allow finitio 0.11 to be used. It's safe.
365
+
366
+ ## 0.15.1 - 2022-06-22
367
+
368
+ * Fix Web::CorsHeaders. An empty value is not allowed, the
369
+ header should simply not be present.
370
+
371
+ ## 0.15.0 - 2022-06-22
372
+
373
+ * POSSIBLY BREAKING: when a Finitio::TypeError is raised
374
+ (typically by an operation failing to validate its input),
375
+ the `location` field of the error is now dumped. This may
376
+ possibly break webspicy tests that validate error responses
377
+ very strictly.
378
+
379
+ * Web::CorsHeaders now support more bouncing options and can be
380
+ used to whitelist some urls (with wildcards) that are
381
+ authorized to bounce.
382
+
383
+ ## 0.14.4 - 2022-06-15
384
+
385
+ * Removed startback-tests.gemspec that is not a valid gem
386
+ anyway.
387
+
388
+ ## 0.14.3 - 2022-06-15
389
+
390
+ * [startback-jobs] properly let inspect a job and its embedded
391
+ results.
392
+
393
+
394
+ ## 0.14.2 - 2022-06-08
395
+
396
+ * [startback-websocket] Fix inclusion of javascript files in gem.
397
+
398
+ ## 0.14.1 - 2022-06-08
399
+
400
+ * Fix the build chain: release of ruby gems.
401
+
402
+ ## 0.14.0 - 2022-06-07
403
+
404
+ * Fix Engine: memoize the bus and run main agent class in
405
+ addition to its subclasses.
406
+
407
+ * BREAKING: Remove serverengine and webrick. Engines should now be started with
408
+ puma and a config.engine.ru instead of engine.rb
409
+
410
+ ## 0.13.0 - 2022-05-31
411
+
412
+ * Contributes Startback::Model, Startback::Services, as well
413
+ as Startback::Support::DataObject and Startback::Support::World
414
+
415
+ * Added the notion of context world, through Context.world,
416
+ Context#world and Context#with_world.
417
+
418
+ * Context.new yields the context instance if a block is given
419
+
420
+ * Bmg minimal dependency is now 0.20.0
421
+
422
+ * POSSIBLY BREAKING: Operation now has a default constructor that
423
+ expects a Hash and installs it under `@input` with an attr_reader.
424
+
425
+ This may break the audit trailer and/or bus dump for legacy
426
+ operations that named their input `request`.
427
+
428
+ ## 0.12.3 - 2022-05-25
429
+
430
+ * Event.json is idempotent.
431
+
432
+ ## 0.12.2 - 2022-05-20
433
+
434
+ * See 0.12.0, same release
435
+
436
+ ## 0.12.1 - 2022-05-19
437
+
438
+ * See 0.12.0, same release
439
+
440
+ ## 0.12.0 - 2022-05-19
441
+
442
+ This release enhances the event layer of Startback with the
443
+ Event, Bus, Engine and Agent collaborating classes.
444
+
445
+ Unfortunately it comes with a couple of BREAKING changes:
446
+
447
+ * `Context::Middleware` now longer takes a context_class
448
+ option, but simply a Context instance (or subclass). That
449
+ instance will be duped and result installed in Rack env.
450
+ Doing so allows building a default context instance with,
451
+ e.g. a logger, and make sure it will be properly reused.
452
+
453
+ * `Startback::Bus` is moved to `Startback::Event::Bus`
454
+
455
+ * `Startback::Event.json` contract has changed. The default
456
+ contract expects the event type to be a fully classified
457
+ class name (subclass of Event) and will attempt to factor
458
+ one. The second argument is no longer a world (Hash) but
459
+ a context instance to attach to the event. A context fork
460
+ is made, using the event context data passed through the
461
+ Context h_factory (if event contains context info).
462
+
463
+ * `Startback::Engine` constructor takes ServerEngine options
464
+ under a `:server_engine` key (was the options themselves).
465
+
466
+ * `Startback::Agent` has a new protocol that relies on agent
467
+ instances and the presence of an `Engine`. The `listen` class
468
+ method no longer exists. You must use the `sync` and `async`
469
+ instance methods instead. Your agent instance should be
470
+ created withing the engine (see `create_agents` and
471
+ `auto_create_agents` there)
472
+
473
+ * `Bus::Bunny` now has `autoconnect: false` by default. You
474
+ should explicit connect your engine instance instead.
475
+
476
+ * `Bus::Bunny` now has `abort_on_exception: true` by default.
477
+ It's much safer but you need a supervisor like Kubernetes
478
+ in pratice.
479
+
480
+ ## 0.11.6 - Unreleased
481
+
482
+ * Extend the Bus abstraction with connect/disconnect.
483
+
484
+ * Bunny::Async now has an autoconnect option (defaulting to true
485
+ for backward compatibility) that can be used to avoid connecting
486
+ too early.
487
+
488
+ * Bunny::Async now has `:abort_on_exception` and
489
+ `:consumer_pool_size` options that control the main channel
490
+ behavior. Their default values are chosen to stay backward
491
+ compatible.
492
+
493
+ ## 0.11.5 - 2022-05-18
494
+
495
+ * Add Startback::Support::Env with `env` and `env!` helper
496
+ methods.
497
+
498
+ * Startback no longer includes a trace in the warning message
499
+ sometimes seen because one uses the default logger.
500
+
501
+ * Added Startback::Event::Agent class, for agents reacting to
502
+ events on a bus.
503
+
504
+ * Added Startback::Event::Engine class, that runs an infinite
505
+ loop using ServerEngine and includes a Webrick small rack
506
+ app with a default and overridable healthcheck behavior.
507
+
508
+ ## 0.11.4 - 2022-05-18
509
+
510
+ * Allow logging Strings & Exceptions directly in both trailer
511
+ and Robusness helpers.
512
+
513
+ ## 0.11.3 - 2022-05-10
514
+
515
+ * Keep allowing `require 'audit/trailer'` alone without an
516
+ error.
517
+
518
+ ## 0.11.2 - 2022-05-10
519
+
520
+ * Audit::Trailer and Audit::Prometheus support any op object
521
+ responding to `op_name` and `op_data` and use them in
522
+ priority over dedicated logic to extract logging info.
523
+
524
+ Their `#call` method are now part of the public API and
525
+ can thus be called by end-user code.
526
+
527
+ ## 0.11.1 - 2022-05-10
528
+
529
+ * We no longer let the Sinatra layer dump errors in log.
530
+
531
+ ## 0.11.0 - 2022-04-21
532
+
533
+ * Require bmg >= 0.19.0
534
+
535
+ ## 0.10.1 - 2021-12-23
536
+
537
+ * Add support for causes in Startback::Errors::Error
538
+
539
+ * The Shield rack middleware dumps the causes to json, provided
540
+ they are subclasses of Startback::Error.
541
+
542
+ * Error & their causes are now properly dumped in the audit
543
+ trail.
544
+
545
+ ## 0.10.0 - 2021-12-22
546
+
547
+ * Add support for operations's transaction policy and transaction
548
+ manager helper
549
+
550
+ * Fix audit trail on multi operations. The op_data recursively
551
+ collect data of sub operations.
552
+
553
+ ## 0.9.1 - 2021-12-13
554
+
555
+ * Fixing thread safetiness of async bus (bunny channels)
556
+
557
+ ## 0.9.0 - 2021-08-27
558
+
559
+ * BREAKING CHANGE: all docker images now run Puma as app on port 3000 instead
560
+ of root on port 80.
561
+
562
+ * Upgrades uglify.js to 4.2, to enable support for ES6.
563
+
564
+ ## 0.8.3 - 2021-05-25
565
+
566
+ * Update dependencies for security patches.
567
+
568
+ ## 0.8.2
569
+
570
+ * Release gem in jenkins pipeline.
571
+
572
+ ## 0.8.1
573
+
574
+ * Web::Api#serve not support Path instances as entities to serve. Sinatra's send_file is
575
+ then used on the path. DTOs returning Path instances are supported too.
576
+
577
+ ## 0.8.0 - 2021/03/12
578
+
579
+ - Bumped finitio to 0.10
580
+ - Bumped webspicy to 0.20
581
+ - Bumped bmg to 0.18
582
+
583
+ ## 0.7.6 - 2020/12/11
584
+
585
+ * Include version.
586
+
587
+ ## 0.7.5 - 2020/12/11
588
+
589
+ * Prometheus metrics include startback_version and have customisable with prefix and labels.
590
+
591
+ ## 0.7.4 - 2020/12/10
592
+
593
+ * Move prometheus-client as a dependency for base.
594
+
595
+ ## 0.7.3 - 2020/12/08
596
+
597
+ * Add prometheus auditor and rack middleware exposing metrics for
598
+ operations. The auditor implements the around_run contract.
599
+
600
+ # Usage example:
601
+ around_run(Startback::Audit::Prometheus.new)
602
+
603
+ # ... in api (exposing /metrics endpoint)
604
+ use Startback::Web::Prometheus
605
+
606
+ ## 0.7.2 - 2020/08/27
607
+
608
+ * Api#with_context and Operation#with_context allow running a block
609
+ with an ephemeral context. The original one is restored after the
610
+ block execution.
611
+
612
+ # With an explicit context created from scratch
613
+ ctx = ...
614
+ with_context(ctx) do
615
+ # will be run using `ctx`, instead of the original one
616
+ run MyOperation.new
617
+ end
618
+ ... # original context is restored here
619
+
620
+ # With a context dup
621
+ with_context do |ctx|
622
+ ctx.foo = "bar"
623
+ # will be run using `ctx`, instead of the original one
624
+ run MyOperation.new
625
+ end
626
+ ... # original context restored; foo=bar is no longer true
627
+
628
+ * DateTime and Time monkey patches are corrected regarding `to_s`
629
+ when the latter takes a parameter (activesupport does).
630
+
631
+ * Bmg "0.17.5" is now a minimum.
632
+
633
+ ## 0.7.1
634
+
635
+ * Context#dup now correctly cleans all factored abstractions.
636
+
637
+ ## 0.7.0
638
+
639
+ * Bumped bmg dependency to 0.17.x to get recent optimizations and bug
640
+ fixes.
641
+
642
+ ## 0.6.0
643
+
644
+ * Docker images now have the startback gem install together with all
645
+ dependencies. This saves build time of image users, since many gems
646
+ that require native extensions are already installed and will be
647
+ reused by bundler.
648
+
649
+ ## 0.5.5
650
+
651
+ * All docker images now run the software as app:app, for improved security.
652
+
653
+ ## 0.5.4
654
+
655
+ * Docker images added for the various variants we have: base, api, web,
656
+ engine.
657
+
658
+ ## 0.5.3 - 2019/10/23
659
+
660
+ * Added a `Startback::Caching::NoStore` abstraction, the easiest way
661
+ to disable caching in practice.
662
+
663
+ ## 0.5.2 - 2019/10/23
664
+
665
+ * Fine-tuned `Robustness` once again, to trace when default logger is
666
+ (incorrectly?) used.
667
+
668
+ * Fixed `EntityCache` and `CatchAll` logging to use the context when
669
+ defined and avoid therefore to end up on the default logger.
670
+
671
+ ## 0.5.1 - 2019/10/19
672
+
673
+ * Improved `EntityCache` with a protocol to convert candidate keys to
674
+ primary keys. The class documentation and vocabulary has been improved
675
+ to be more intuitive for users with a relational database background.
676
+
677
+ Methods `full_key` and `load_raw_data` are renamed in a backwards
678
+ compatible way to `primary_key` and `load_entity`, respectively. The
679
+ old methods will be removed in 0.6.0.
680
+
681
+ * Improved `EntityCache` with logging. Cache hits are logged in debug.
682
+ Cache miss & outdated are logged in info.
683
+
684
+ * Fine-tuned `Robustness`, log & audit trail to make them easier to use.
685
+ In particular, the 25 lines of the backtrace are dumped in `op_data`
686
+ on fatal errors.
687
+
688
+ ## 0.5.0 - 2019/10/16
689
+
690
+ * BREAKING CHANGE: Operation#bind no longer returns new operation
691
+ instances, it mutates the operation on which it is called. This is to
692
+ prevent counterintuitive behaviors when operations are passed around
693
+ while binding is actually rather hidden.
694
+
695
+ * BREAKING CHANGE: Web::CatchAll only dumps 10 stacktrace lines, to
696
+ prevent logs from growing too much, and make sure that logs under
697
+ passenger do not end up being broken.
698
+
699
+ * Add support for run `around` hooks in `Web::Api`, through an
700
+ OperationRunner support module. The same module is included by
701
+ the `Operation` class itself, since it can run sub operations.
702
+
703
+ * Before (resp. after) hooks are added to the `Operation` abstraction.
704
+ They are called right before (resp. after) `call` by operation runners,
705
+ that is `Web::Api` and `Operation` itself.
706
+
707
+ * Introduce an `operation_world` overridable method to participate
708
+ to the world construction in `Web::Api`. This aims at preventing
709
+ `run` cowboy overriding.
710
+
711
+ * The `Context` abstraction now has a dump & reload protocol that allows
712
+ being passed around in a distributed architecture.
713
+
714
+ * The `Context` abstraction now acts as a factory for related abstractions.
715
+ That factory has a caching mechanism, to prevent creating the same classes
716
+ over and over again and reduce memory footprint.
717
+
718
+ * Add Startback::Web::Middleware helper module, that gives access to the
719
+ running context installed by Startback::Context::Middleware under a
720
+ simple `context` method.
721
+
722
+ * Add eventing support through the `Startback::Event` and `Startback::Bus`
723
+ abstractions. Please `require 'startback/bus'` explicitely to use them.
724
+
725
+ * Add `Startback::Caching::EntityCache` abstraction and protocol for making
726
+ caching and invalidation easier on individual objects.
727
+ Please `require 'startback/caching/entity_cache'` explicitely to use them.
728
+
729
+ * Add log & audit trail abstractions, through the `Stackback::Audit::Trailer`
730
+ class. The class can be registered as an operation's around callback and
731
+ will dump a json log of operation executions and their timing.
732
+
733
+ ## 0.4.5 - 2019/06/24
734
+
735
+ * [CatchAll] Log error message and error backtrace as two different lines,
736
+ to avoid message being stripped because the stacktrace is too long.
737
+
738
+ ## 0.4.4 - 2019/03/12
739
+
740
+ * Startback::Web::HealthCheck correctly returns an empty array as third
741
+ rack 204 response, to meet the spec and avoid crashes with webrick.
742
+
743
+ ## 0.4.3 - 2019/03/08
744
+
745
+ * `Context::Middleware.context(env)` can now be used to return the context
746
+ installed on an environment. To avoid having to know the key itself that
747
+ might change in the future.
748
+
749
+ * The Errors module now expose many utility methods to raise errors without
750
+ having to know all error classes. Those methods are available in Operation
751
+ and Api instances. The module can also be included by users to get the new
752
+ methods available elsewhere.
753
+
754
+ * The error `No method unsupported_content_type` is now fixed when a media
755
+ type is unsupported. A correct 415 HTTP error is returned instead.
756
+
757
+ * Ruby's NotImplementedError are now catched by the Shield and transformed
758
+ to a 501 HTPP response.
759
+
760
+ * Severe errors catched by CatchAll are not logged with both the message and
761
+ the full stack trace.
762
+
763
+ ## 0.4.2 - 2019/03/08
764
+
765
+ * Startback::Web::AutoCaching no longer overrides Cache-Control headers
766
+ set down the middleware chain. It trusts existing headers by default.
767
+
768
+ ## 0.4.1 - 2019/03/06
769
+
770
+ * Add a NgHtmlTransformer tool to MagicAssets. Useful for angular assets
771
+ with a component folder structure.
772
+
773
+ ## 0.4.0 - 2019/03/06
774
+
775
+ * BREAKING CHANGE: the various web components are not longer required by
776
+ default. The user must require each component it uses.
777
+
778
+ * Add a Startback::Web::AutoCaching rack middleware to help setting
779
+ the Cache-Control header in development/production environments,
780
+ according to middleware construction parameters and/or environment
781
+ variables.
782
+
783
+ * Add a Startback::Web::CorsHeaders rack middleware to help setting
784
+ the various Cross-Origin Response Headers correctly, while supporting
785
+ good default values and configuration through middleware construction
786
+ parameters and/or environment variables.
787
+
788
+ * Add a Startback::Web::MagicAssets middleware and application, to help
789
+ managing js/css assets using Sprockets.
790
+
791
+ ## 0.3.2 - 2018/11/27
792
+
793
+ * Subclassing error classes keep orginal status codes, unless overriden
794
+
795
+ ## 0.3.1 - 2019/01/30
796
+
797
+ * Fix file upload raising an exception about `file` not being defined.
798
+
799
+ ## 0.3.0 - 2018/10/12
800
+
801
+ * Enhanced CatchAll to support an `error_handler` on the context. Fatal
802
+ exceptions are passed to the error handler when provided.
803
+
804
+ ## 0.2.0 - 2018/09/26
805
+
806
+ * Context::Middleware now accepts a `context_class` option allowing
807
+ to specify a subclass of Context as actual context class. This allows
808
+ application to make the context more specific without monkey patching
809
+ Startback classes.
810
+
811
+ * Main abstractions cleaned and documented
812
+
813
+ ## 0.1.0
814
+
815
+ Birthday