yamine 0.14.2 → 0.15.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: 56dbba9d974dc247a9f96271e6dd40e0e68b170a6ad20f9e0660aa6fa1d20a28
4
- data.tar.gz: 218da1110324af22c665581eeb26101a29628f1f4e96fed47e492aebd6c18488
3
+ metadata.gz: 8ed2f817c57a50bb8b6d1d06b801c11e321314f4106592797a5554398dab57c5
4
+ data.tar.gz: a8d5de965cd99d455bea51bc0403b968d05a5eb3af988f94eb7cbe631c8d4fac
5
5
  SHA512:
6
- metadata.gz: 9e26fe517122747c2793eb2b441fe83289898796d47c99330d2589413873fa7a12ae1cc2a8b1da69928b39bc6f8ed01aa6e7647f682a872c80886d04d1a862be
7
- data.tar.gz: ce6b77f5a0263594e698cae37ddd3673a8dc6e16a63b946f8bd0f3b939747d80ce86bbc19e100da84a4a7b38aa942de39d86cdc509e348d71d817bc7a6def433
6
+ metadata.gz: c6b57abccf1ba59aa2ac525f1f44cb9ed36bf3e6183ed409affdb42af5dec4bd6674a7df6fc6b259d77aa48ece1279aea552a44ffe50479ace3974614b29fc1c
7
+ data.tar.gz: e075319032988c9efcaf70ca3835a46bcb3a0f55986a35bfe42b765483b24c89611c4893fc26d5b1437a9a49d263cd1f9aabed27e27f56705069e43e2832544c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.0] — 2026-09-15
4
+
5
+ ### Changed
6
+
7
+ - **App logs now live in `log/development.log` — `log/yamine-*.log` is gone.**
8
+ Every process used to append to a per-process `log/yamine-#{name}.log`,
9
+ hijacking the Rails request log away from `log/development.log` and
10
+ making `tail -f log/development.log` go silent under yamine. Now
11
+ every process appends to the same shared file — the one Rails people
12
+ already expect — with `tail -F` surviving rotation. `yamine log` and
13
+ `yamine log -F` tail that file; the `--wait` failure payload's log tail
14
+ and `died_detail` now point at `log/development.log` too. Old
15
+ `log/yamine-*.log` files are cleaned up automatically on the next
16
+ boot. Interleaving matches the foreman/without-yamine experience; a
17
+ per-process opt-in can be added later if needed.
18
+
3
19
  ## [0.14.2] — 2026-09-15
4
20
 
5
21
  ### Added
data/README.md CHANGED
@@ -229,7 +229,7 @@ yamine db list|create|drop # per-worktree databases
229
229
  yamine worktree list|add|remove|clean # worktree lifecycle
230
230
  yamine stop # stop this app's backend + routes
231
231
  yamine restart # touch tmp/restart.txt (managed apps reboot)
232
- yamine log [-f] [n] # tail (or follow) this app's backend log
232
+ yamine log [-F] [n] # tail (or follow) log/development.log
233
233
  yamine proxy start|stop # control the proxy
234
234
  yamine service install|status|uninstall # root-owned OS startup service
235
235
  yamine hosts sync|clean # manage /etc/hosts entries
@@ -276,9 +276,10 @@ old fire-and-forget path.
276
276
 
277
277
  ## Log rotation
278
278
 
279
- `proxy.log` and per-app backend logs rotate at 5MB
280
- (`YAMINE_LOG_MAX_BYTES`), keeping one generation. `doctor` warns
281
- when the state dir passes 100MB.
279
+ `proxy.log` rotates at 5MB (`YAMINE_LOG_MAX_BYTES`), keeping one
280
+ generation. `log/development.log` is rotated too — use
281
+ `tail -F log/development.log` (or `yamine log -F`) so rotation doesn't
282
+ lose the tail. `doctor` warns when the state dir passes 100MB.
282
283
 
283
284
  ## Supervision
284
285
 
@@ -39,7 +39,7 @@ yamine start --json # machine-readable wait result (--wait default)
39
39
  yamine # same as start
40
40
  yamine stop # stop this app's backend + routes
41
41
  yamine status # show service, processes, and URLs
42
- yamine log [-f] # tail the web process log
42
+ yamine log [-F] # tail log/development.log (every process)
43
43
  ```
44
44
 
45
45
  `$PORT` and `YAMINE_URL` are injected per process; HTTP processes get
@@ -268,7 +268,7 @@ module Yamine
268
268
  children << { name: item[:name], pid: app.pid }
269
269
  apps[item[:name]] = {
270
270
  item: item,
271
- log_path: File.join(Dir.pwd, "log", "yamine-#{item[:name]}.log"),
271
+ log_path: File.join(Dir.pwd, "log", "development.log"),
272
272
  app: app
273
273
  }
274
274
  end
@@ -330,7 +330,7 @@ module Yamine
330
330
  def tail_for(failure, apps)
331
331
  name = failure[:name]
332
332
  slot = apps[name]
333
- path = slot ? File.expand_path(File.join(Dir.pwd, "log", "yamine-#{name}.log")) : nil
333
+ path = slot ? File.expand_path(File.join(Dir.pwd, "log", "development.log")) : nil
334
334
  lines = path && File.file?(path) ? File.readlines(path).last(20).join : "(no log file)"
335
335
  { path: path, tail: lines }
336
336
  rescue SystemCallError
@@ -580,7 +580,7 @@ module Yamine
580
580
  if dead
581
581
  pid, name = dead
582
582
  $stderr.puts "\n[#{name}] exited (pid #{pid}) — stopping the whole tree."
583
- log = File.join(Dir.pwd, "log", "yamine-#{name}.log")
583
+ log = File.join(Dir.pwd, "log", "development.log")
584
584
  $stderr.puts " log: #{log}" if File.file?(log)
585
585
  reporter&.note("#{name} exited; cleaning up routes")
586
586
  cleanup_routes(ctx, hostnames)
@@ -249,12 +249,13 @@ module Yamine
249
249
  puts "Touched #{path} — managed app restarts on next request."
250
250
  end
251
251
 
252
- # Tail the app log (default 50 lines); --follow streams.
253
- def log(ctx, args)
252
+ # Tail the shared app log (default 50 lines); --follow streams.
253
+ # Every process writes log/development.log, so `yamine log` and
254
+ # `yamine log -F` tail the one file `tail -F` survives rotation.
255
+ def log(_ctx, args)
254
256
  follow = args.delete("--follow") || args.delete("-f")
255
257
  lines = (args.first || 50).to_i
256
- resolved = Resolver.resolve(Dir.pwd)
257
- path = File.expand_path(File.join(Dir.pwd, "log", "yamine-#{resolved.app}.log"))
258
+ path = File.expand_path(File.join(Dir.pwd, "log", "development.log"))
258
259
  unless File.file?(path)
259
260
  puts "No log at #{path} yet."
260
261
  return
data/lib/yamine/cli.rb CHANGED
@@ -104,7 +104,7 @@ module Yamine
104
104
  yamine kamal <variant> Preview-deploy snippet for Kamal
105
105
  yamine stop Stop this app's backend + routes
106
106
  yamine restart Touch tmp/restart.txt
107
- yamine log [-f] [n] Tail (or follow) this app's backend log
107
+ yamine log [-F] [n] Tail (or follow) log/development.log
108
108
 
109
109
  Flags: --variant, --tld, --force, --app-port, --wait (default), --no-wait, --json, --branch
110
110
  Env: YAMINE_VARIANT/TLD/PORT/STATE_DIR/AGENT, YAMINE_BRANCH=1
@@ -189,13 +189,14 @@ module Yamine
189
189
  end
190
190
 
191
191
  # Why a process that died before answering died: the recognized
192
- # fatal line when there is one, else point at its log.
192
+ # fatal line when there is one, else point at the shared log
193
+ # (every process appends to log/development.log).
193
194
  def died_detail(name, slot)
194
195
  reason = fatal_line(slot[:log_path])
195
196
  if reason
196
- "process exited: #{reason} (log/yamine-#{name}.log)"
197
+ "process exited: #{reason} (log/development.log)"
197
198
  else
198
- "process exited before becoming healthy — see log/yamine-#{name}.log"
199
+ "process exited before becoming healthy — see log/development.log"
199
200
  end
200
201
  end
201
202
 
data/lib/yamine/runner.rb CHANGED
@@ -91,8 +91,10 @@ module Yamine
91
91
 
92
92
  # Run an arbitrary command with PORT + YAMINE_URL. Returns App.
93
93
  # register: false spawns without a route (background processes).
94
- # Child output goes to log/yamine-<name>.log so `--wait` failure
95
- # payloads can tail it (same file the managed path uses).
94
+ # Child output goes to log/development.log (every process appends
95
+ # to the same file) so `tail -f log/development.log` is the same
96
+ # view yamine's failure payloads use. Interleaving matches the
97
+ # foreman/without-yamine experience.
96
98
  #
97
99
  # extra_env is the config's env.clear/env.secret for this process —
98
100
  # yamine's own keys (PORT, YAMINE_URL, DATABASE_URL, the TLS vars)
@@ -221,6 +223,14 @@ module Yamine
221
223
 
222
224
  private
223
225
 
226
+ def cleanup_legacy_logs(dir)
227
+ Dir.glob(File.expand_path(File.join(dir, "log", "yamine-*.log*"))).each do |path|
228
+ FileUtils.rm_f(path)
229
+ rescue SystemCallError
230
+ nil
231
+ end
232
+ end
233
+
224
234
  def socket_command(dir, socket_path)
225
235
  socket = "unix://#{socket_path}"
226
236
  config_ru = File.join(dir, "config.ru")
@@ -288,12 +298,15 @@ module Yamine
288
298
  end
289
299
  end
290
300
 
291
- # Log path for a process — public so the --wait failure payload
292
- # can tail the right file for the phase that failed.
293
- def log_path(dir, name)
294
- path = File.expand_path(File.join(dir, "log", "yamine-#{name}.log"))
301
+ # Log path for any process — every process appends to
302
+ # log/development.log so `tail -F` is the one view for humans
303
+ # and for --wait failure tails. Keep the two-arg signature so
304
+ # existing call sites don't need to change.
305
+ def log_path(dir, _name = nil)
306
+ path = File.expand_path(File.join(dir, "log", "development.log"))
295
307
  FileUtils.mkdir_p(File.dirname(path))
296
308
  Log.rotate(path)
309
+ cleanup_legacy_logs(dir)
297
310
  path
298
311
  end
299
312
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yamine
4
- VERSION = "0.14.2"
4
+ VERSION = "0.15.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto