fun_ci 2.3.0 → 2.5.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 +4 -4
- data/CHANGELOG.md +143 -0
- data/README.md +20 -10
- data/lib/fun_ci/agent/events.rb +15 -7
- data/lib/fun_ci/agent/job_events.rb +12 -5
- data/lib/fun_ci/agent/onward.rb +21 -0
- data/lib/fun_ci/agent/output.rb +7 -0
- data/lib/fun_ci/agent/reports.rb +3 -0
- data/lib/fun_ci/agent/snapshots.rb +25 -7
- data/lib/fun_ci/agent/status_text.rb +9 -5
- data/lib/fun_ci/agent/wait_command.rb +37 -5
- data/lib/fun_ci/cli.rb +2 -0
- data/lib/fun_ci/cli_command_help.rb +51 -0
- data/lib/fun_ci/cli_help.rb +9 -9
- data/lib/fun_ci/console/board_data.rb +50 -10
- data/lib/fun_ci/console/branch_page.rb +9 -0
- data/lib/fun_ci/console/console_state.rb +22 -8
- data/lib/fun_ci/console/cursor.rb +22 -0
- data/lib/fun_ci/console/cursor_rows.rb +37 -0
- data/lib/fun_ci/console/job_message.rb +5 -4
- data/lib/fun_ci/console/job_order.rb +5 -3
- data/lib/fun_ci/console/job_row.rb +17 -0
- data/lib/fun_ci/console/job_rows.rb +14 -3
- data/lib/fun_ci/console/key_handler.rb +88 -51
- data/lib/fun_ci/console/question.rb +63 -0
- data/lib/fun_ci/console/run_message.rb +3 -3
- data/lib/fun_ci/console/trunk_marks.rb +3 -1
- data/lib/fun_ci/console/view.rb +20 -6
- data/lib/fun_ci/evidence/about_stage.rb +1 -1
- data/lib/fun_ci/evidence/collector.rb +6 -3
- data/lib/fun_ci/evidence/outcome.rb +6 -3
- data/lib/fun_ci/jobs/job_run.rb +10 -9
- data/lib/fun_ci/jobs/locks.rb +1 -1
- data/lib/fun_ci/persistence/active_jobs.rb +2 -11
- data/lib/fun_ci/persistence/active_runs.rb +48 -16
- data/lib/fun_ci/persistence/arrival.rb +18 -0
- data/lib/fun_ci/persistence/branch_visibility.rb +40 -0
- data/lib/fun_ci/persistence/database.rb +28 -2
- data/lib/fun_ci/persistence/died.rb +21 -0
- data/lib/fun_ci/persistence/hidden_row_tables.rb +24 -0
- data/lib/fun_ci/persistence/job_recorder.rb +1 -0
- data/lib/fun_ci/persistence/job_runs.rb +17 -7
- data/lib/fun_ci/persistence/job_visibility.rb +43 -0
- data/lib/fun_ci/persistence/null_recorder.rb +4 -0
- data/lib/fun_ci/persistence/pipeline_recorder.rb +23 -3
- data/lib/fun_ci/persistence/pipeline_run.rb +25 -11
- data/lib/fun_ci/persistence/stage_job.rb +25 -0
- data/lib/fun_ci/persistence/trunk_checks.rb +7 -6
- data/lib/fun_ci/pipeline/group_kill.rb +38 -0
- data/lib/fun_ci/pipeline/pipeline_forker.rb +3 -1
- data/lib/fun_ci/pipeline/process_runner.rb +14 -8
- data/lib/fun_ci/pipeline/process_tree.rb +37 -0
- data/lib/fun_ci/pipeline/progress_reporter.rb +2 -1
- data/lib/fun_ci/pipeline/run_canceller.rb +16 -6
- data/lib/fun_ci/pipeline/slot.rb +12 -0
- data/lib/fun_ci/pipeline/slot_run.rb +20 -5
- data/lib/fun_ci/pipeline/slow_turns.rb +74 -0
- data/lib/fun_ci/pipeline/stage_end.rb +2 -1
- data/lib/fun_ci/pipeline/stale_pipeline_canceller.rb +1 -1
- data/lib/fun_ci/pipeline/trigger.rb +9 -1
- data/lib/fun_ci/pipeline/trigger_params.rb +7 -3
- data/lib/fun_ci/pipeline/turn_queue.rb +65 -0
- data/lib/fun_ci/pipeline/waiting_slots.rb +30 -0
- data/lib/fun_ci/pipeline/workspaces.rb +2 -1
- data/lib/fun_ci/pipeline/worktree_pool.rb +27 -7
- data/lib/fun_ci/pipeline/worktree_prune.rb +9 -4
- data/lib/fun_ci/pipeline/worktrees.rb +41 -7
- data/lib/fun_ci/setup/commands.rb +16 -7
- data/lib/fun_ci/setup/eslint_detection.rb +38 -0
- data/lib/fun_ci/setup/init_options.rb +34 -0
- data/lib/fun_ci/setup/installer.rb +41 -7
- data/lib/fun_ci/setup/placeholders.rb +30 -0
- data/lib/fun_ci/setup/project_config.rb +1 -0
- data/lib/fun_ci/setup/settings.rb +21 -1
- data/lib/fun_ci/setup/setup_checker.rb +5 -3
- data/lib/fun_ci/setup/stage_templates/javascript.rb +14 -4
- data/lib/fun_ci/setup/stage_templates/placeholders.rb +21 -0
- data/lib/fun_ci/setup/stage_templates.rb +6 -4
- data/lib/fun_ci/setup/template_writer.rb +3 -5
- data/lib/fun_ci/trunk/check.rb +7 -2
- data/lib/fun_ci/version.rb +1 -1
- metadata +34 -11
|
@@ -5,13 +5,23 @@ require_relative "shell"
|
|
|
5
5
|
module FunCi
|
|
6
6
|
module Setup
|
|
7
7
|
# JavaScript and TypeScript: Deno, Bun, and Node with its package managers.
|
|
8
|
+
# Lint runs beside the build, which installs the packages, so it checks
|
|
9
|
+
# the source alone: a linter that loads them, ESLint, goes in the build
|
|
10
|
+
# after the install (EslintDetection). Deno's lint needs no packages.
|
|
8
11
|
module StageTemplates
|
|
12
|
+
SOURCES = "find . -name node_modules -prune -o -name .git -prune -o -type f"
|
|
13
|
+
NODE_CHECK = "#{SOURCES} \\( -name '*.js' -o -name '*.mjs' -o -name '*.cjs' \\) -print | " \
|
|
14
|
+
'while read -r file; do node --check "$file" || exit 1; done'.freeze
|
|
15
|
+
BUN_CHECK = "#{SOURCES} \\( -name '*.js' -o -name '*.mjs' -o -name '*.cjs' -o -name '*.ts' " \
|
|
16
|
+
"-o -name '*.tsx' \\) -print | " \
|
|
17
|
+
'while read -r file; do bun build --no-bundle "$file" > /dev/null || exit 1; done'.freeze
|
|
18
|
+
|
|
9
19
|
JAVASCRIPT = {
|
|
10
20
|
deno: stages("deno lint", "deno check", "deno test", "deno task test:slow"),
|
|
11
|
-
bun: stages(
|
|
12
|
-
node_pnpm: stages(
|
|
13
|
-
node_yarn: stages(
|
|
14
|
-
node_npm: stages(
|
|
21
|
+
bun: stages(BUN_CHECK, "bun install", "bun test", "bun run test:slow"),
|
|
22
|
+
node_pnpm: stages(NODE_CHECK, "pnpm install", "pnpm test", "pnpm run test:slow"),
|
|
23
|
+
node_yarn: stages(NODE_CHECK, "yarn install", "yarn test", "yarn run test:slow"),
|
|
24
|
+
node_npm: stages(NODE_CHECK, "npm install", "npm test", "npm run test:slow")
|
|
15
25
|
}.freeze
|
|
16
26
|
end
|
|
17
27
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "shell"
|
|
4
|
+
|
|
5
|
+
module FunCi
|
|
6
|
+
module Setup
|
|
7
|
+
# The scripts `fun-ci init` writes where it knows no stack: each passes,
|
|
8
|
+
# says it tests nothing, and carries MARKER, by which `fun-ci check` warns
|
|
9
|
+
# of it until the project's own command takes its place.
|
|
10
|
+
module StageTemplates
|
|
11
|
+
MARKER = "# fun-ci placeholder"
|
|
12
|
+
|
|
13
|
+
def self.placeholder(stage)
|
|
14
|
+
"#{MARKER}: init knew no stack here, so put the project's #{stage} in place of this.\n" \
|
|
15
|
+
"echo \"fun-ci: .fun-ci/#{stage}.sh is init's placeholder and tests nothing\""
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
PLACEHOLDERS = stages(*%w[lint build fast slow].map { |stage| placeholder(stage) }).freeze
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -4,6 +4,7 @@ require_relative "stage_templates/managed"
|
|
|
4
4
|
require_relative "stage_templates/native"
|
|
5
5
|
require_relative "stage_templates/scripting"
|
|
6
6
|
require_relative "stage_templates/javascript"
|
|
7
|
+
require_relative "stage_templates/placeholders"
|
|
7
8
|
|
|
8
9
|
module FunCi
|
|
9
10
|
module Setup
|
|
@@ -15,10 +16,11 @@ module FunCi
|
|
|
15
16
|
module StageTemplates
|
|
16
17
|
TEMPLATES = [MANAGED, NATIVE, SCRIPTING, JAVASCRIPT].reduce(:merge).freeze
|
|
17
18
|
|
|
18
|
-
# { "lint.sh" => script, ... }; +lint_override+
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
# { "lint.sh" => script, ... }; +lint_override+ and +build_override+
|
|
20
|
+
# replace the lint and build commands.
|
|
21
|
+
def self.scripts(template_id, lint_override: nil, build_override: nil)
|
|
22
|
+
overrides = { "lint.sh" => lint_override, "build.sh" => build_override }.compact
|
|
23
|
+
TEMPLATES.fetch(template_id).merge(overrides.to_h { |name, command| [name, script(name, command)] })
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
26
|
end
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "stage_templates"
|
|
4
|
-
|
|
5
3
|
module FunCi
|
|
6
4
|
module Setup
|
|
7
|
-
# Writes a project's .fun-ci/ stage scripts, executable.
|
|
5
|
+
# Writes a project's .fun-ci/ stage scripts, executable: scripts is { "lint.sh" => script, ... }.
|
|
8
6
|
class TemplateWriter
|
|
9
|
-
def initialize(
|
|
10
|
-
@scripts =
|
|
7
|
+
def initialize(scripts, target_dir)
|
|
8
|
+
@scripts = scripts
|
|
11
9
|
@target_dir = target_dir
|
|
12
10
|
end
|
|
13
11
|
|
data/lib/fun_ci/trunk/check.rb
CHANGED
|
@@ -50,7 +50,12 @@ module FunCi
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
# One check of a commit against one trunk tip (architecture.md, Checking against the trunk);
|
|
53
|
-
# the tip is nil when there was none to check against.
|
|
54
|
-
|
|
53
|
+
# the tip is nil when there was none to check against. checked_at: when
|
|
54
|
+
# it was recorded, for a check read back; nil for one just made.
|
|
55
|
+
Check = Data.define(:commit, :tip, :merge, :checked_at)
|
|
56
|
+
|
|
57
|
+
class Check
|
|
58
|
+
def initialize(checked_at: nil, **) = super
|
|
59
|
+
end
|
|
55
60
|
end
|
|
56
61
|
end
|
data/lib/fun_ci/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fun_ci
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erik Thyge Madsen
|
|
@@ -43,15 +43,17 @@ description: 'Opinionated local CI that checks your code before it leaves your m
|
|
|
43
43
|
held to a strict time budget (30 s, 30 s, 10 s and 5 minutes). The pre-push hook
|
|
44
44
|
stops a push whose lint, build or fast suite failed. There are two ways in. People
|
|
45
45
|
watch fun-ci console, a terminal dashboard drawn in 24-bit colour by a Rust renderer
|
|
46
|
-
(included in the Linux and macOS gems), where each milestone of a run plays
|
|
47
|
-
own
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
commit''s verdict is in, and fun-ci
|
|
51
|
-
|
|
52
|
-
lines, the end of the output, with secrets
|
|
53
|
-
again to see what broke. Results are kept
|
|
54
|
-
stages are shell scripts; fun-ci init writes
|
|
46
|
+
(included in the Linux and macOS gems), where each milestone of a run plays a scene
|
|
47
|
+
of its own: a rocket while it runs, gears when the build passes, fireworks or a
|
|
48
|
+
sunrise when the whole run does, an explosion when it fails, and a quiet night scene
|
|
49
|
+
when nothing has run for a while. Coding agents and scripts ask with commands that
|
|
50
|
+
answer in exit codes: fun-ci wait blocks until a commit''s verdict is in, and fun-ci
|
|
51
|
+
why prints what was kept about a failure (the failures a test runner reported, excerpts
|
|
52
|
+
picked out by presets for 34 tools, log lines, the end of the output, with secrets
|
|
53
|
+
masked), so nobody has to run a suite again to see what broke. Results are kept
|
|
54
|
+
in SQLite. Any language works, since the stages are shell scripts; fun-ci init writes
|
|
55
|
+
them for Ruby, Gradle, Maven, Rust, Go, Elixir, Dart, Swift, PHP, .NET, Python,
|
|
56
|
+
Deno, Bun, Node, Perl, and C and C++ built with CMake or make.'
|
|
55
57
|
executables:
|
|
56
58
|
- fun-ci
|
|
57
59
|
extensions: []
|
|
@@ -84,6 +86,7 @@ files:
|
|
|
84
86
|
- lib/fun_ci/agent/jobs_text.rb
|
|
85
87
|
- lib/fun_ci/agent/live_pipeline.rb
|
|
86
88
|
- lib/fun_ci/agent/next_step.rb
|
|
89
|
+
- lib/fun_ci/agent/onward.rb
|
|
87
90
|
- lib/fun_ci/agent/options.rb
|
|
88
91
|
- lib/fun_ci/agent/output.rb
|
|
89
92
|
- lib/fun_ci/agent/report_stage.rb
|
|
@@ -113,23 +116,29 @@ files:
|
|
|
113
116
|
- lib/fun_ci/agent/why_json.rb
|
|
114
117
|
- lib/fun_ci/agent/why_text.rb
|
|
115
118
|
- lib/fun_ci/cli.rb
|
|
119
|
+
- lib/fun_ci/cli_command_help.rb
|
|
116
120
|
- lib/fun_ci/cli_help.rb
|
|
117
121
|
- lib/fun_ci/console/board_data.rb
|
|
118
122
|
- lib/fun_ci/console/board_heartbeat.rb
|
|
123
|
+
- lib/fun_ci/console/branch_page.rb
|
|
119
124
|
- lib/fun_ci/console/cancelled_folding.rb
|
|
120
125
|
- lib/fun_ci/console/console_events.rb
|
|
121
126
|
- lib/fun_ci/console/console_log.rb
|
|
122
127
|
- lib/fun_ci/console/console_loop.rb
|
|
123
128
|
- lib/fun_ci/console/console_session.rb
|
|
124
129
|
- lib/fun_ci/console/console_state.rb
|
|
130
|
+
- lib/fun_ci/console/cursor.rb
|
|
131
|
+
- lib/fun_ci/console/cursor_rows.rb
|
|
125
132
|
- lib/fun_ci/console/job_message.rb
|
|
126
133
|
- lib/fun_ci/console/job_order.rb
|
|
134
|
+
- lib/fun_ci/console/job_row.rb
|
|
127
135
|
- lib/fun_ci/console/job_rows.rb
|
|
128
136
|
- lib/fun_ci/console/key_handler.rb
|
|
129
137
|
- lib/fun_ci/console/launcher.rb
|
|
130
138
|
- lib/fun_ci/console/milestone_events.rb
|
|
131
139
|
- lib/fun_ci/console/milestones.rb
|
|
132
140
|
- lib/fun_ci/console/paging.rb
|
|
141
|
+
- lib/fun_ci/console/question.rb
|
|
133
142
|
- lib/fun_ci/console/renderer_lookup.rb
|
|
134
143
|
- lib/fun_ci/console/renderer_process.rb
|
|
135
144
|
- lib/fun_ci/console/row_order.rb
|
|
@@ -235,9 +244,14 @@ files:
|
|
|
235
244
|
- lib/fun_ci/jobs/wall_clock_wait.rb
|
|
236
245
|
- lib/fun_ci/persistence/active_jobs.rb
|
|
237
246
|
- lib/fun_ci/persistence/active_runs.rb
|
|
247
|
+
- lib/fun_ci/persistence/arrival.rb
|
|
248
|
+
- lib/fun_ci/persistence/branch_visibility.rb
|
|
238
249
|
- lib/fun_ci/persistence/database.rb
|
|
250
|
+
- lib/fun_ci/persistence/died.rb
|
|
251
|
+
- lib/fun_ci/persistence/hidden_row_tables.rb
|
|
239
252
|
- lib/fun_ci/persistence/job_recorder.rb
|
|
240
253
|
- lib/fun_ci/persistence/job_runs.rb
|
|
254
|
+
- lib/fun_ci/persistence/job_visibility.rb
|
|
241
255
|
- lib/fun_ci/persistence/null_recorder.rb
|
|
242
256
|
- lib/fun_ci/persistence/output_tail.rb
|
|
243
257
|
- lib/fun_ci/persistence/pipeline_recorder.rb
|
|
@@ -257,17 +271,20 @@ files:
|
|
|
257
271
|
- lib/fun_ci/pipeline/command_executor.rb
|
|
258
272
|
- lib/fun_ci/pipeline/gate.rb
|
|
259
273
|
- lib/fun_ci/pipeline/git_environment.rb
|
|
274
|
+
- lib/fun_ci/pipeline/group_kill.rb
|
|
260
275
|
- lib/fun_ci/pipeline/head_part.rb
|
|
261
276
|
- lib/fun_ci/pipeline/in_place.rb
|
|
262
277
|
- lib/fun_ci/pipeline/output_window.rb
|
|
263
278
|
- lib/fun_ci/pipeline/pipeline_forker.rb
|
|
264
279
|
- lib/fun_ci/pipeline/priorities.rb
|
|
265
280
|
- lib/fun_ci/pipeline/process_runner.rb
|
|
281
|
+
- lib/fun_ci/pipeline/process_tree.rb
|
|
266
282
|
- lib/fun_ci/pipeline/progress_reporter.rb
|
|
267
283
|
- lib/fun_ci/pipeline/run_canceller.rb
|
|
268
284
|
- lib/fun_ci/pipeline/slot.rb
|
|
269
285
|
- lib/fun_ci/pipeline/slot_lock.rb
|
|
270
286
|
- lib/fun_ci/pipeline/slot_run.rb
|
|
287
|
+
- lib/fun_ci/pipeline/slow_turns.rb
|
|
271
288
|
- lib/fun_ci/pipeline/stage_dir.rb
|
|
272
289
|
- lib/fun_ci/pipeline/stage_end.rb
|
|
273
290
|
- lib/fun_ci/pipeline/stage_execution.rb
|
|
@@ -279,22 +296,27 @@ files:
|
|
|
279
296
|
- lib/fun_ci/pipeline/trigger_command.rb
|
|
280
297
|
- lib/fun_ci/pipeline/trigger_params.rb
|
|
281
298
|
- lib/fun_ci/pipeline/trunk_run.rb
|
|
299
|
+
- lib/fun_ci/pipeline/turn_queue.rb
|
|
300
|
+
- lib/fun_ci/pipeline/waiting_slots.rb
|
|
282
301
|
- lib/fun_ci/pipeline/workspaces.rb
|
|
283
302
|
- lib/fun_ci/pipeline/worktree_pool.rb
|
|
284
303
|
- lib/fun_ci/pipeline/worktree_prune.rb
|
|
285
304
|
- lib/fun_ci/pipeline/worktrees.rb
|
|
286
305
|
- lib/fun_ci/setup/agent_instructions.rb
|
|
287
306
|
- lib/fun_ci/setup/commands.rb
|
|
307
|
+
- lib/fun_ci/setup/eslint_detection.rb
|
|
288
308
|
- lib/fun_ci/setup/git_hooks.rb
|
|
289
309
|
- lib/fun_ci/setup/gradle_linter_detector.rb
|
|
290
310
|
- lib/fun_ci/setup/hook_script.rb
|
|
291
311
|
- lib/fun_ci/setup/hook_writer.rb
|
|
312
|
+
- lib/fun_ci/setup/init_options.rb
|
|
292
313
|
- lib/fun_ci/setup/installed_hooks.rb
|
|
293
314
|
- lib/fun_ci/setup/installer.rb
|
|
294
315
|
- lib/fun_ci/setup/legacy_hooks.rb
|
|
295
316
|
- lib/fun_ci/setup/lfs_hook.rb
|
|
296
317
|
- lib/fun_ci/setup/lint_detection.rb
|
|
297
318
|
- lib/fun_ci/setup/maven_linter_detector.rb
|
|
319
|
+
- lib/fun_ci/setup/placeholders.rb
|
|
298
320
|
- lib/fun_ci/setup/project_config.rb
|
|
299
321
|
- lib/fun_ci/setup/project_detector.rb
|
|
300
322
|
- lib/fun_ci/setup/settings.rb
|
|
@@ -303,6 +325,7 @@ files:
|
|
|
303
325
|
- lib/fun_ci/setup/stage_templates/javascript.rb
|
|
304
326
|
- lib/fun_ci/setup/stage_templates/managed.rb
|
|
305
327
|
- lib/fun_ci/setup/stage_templates/native.rb
|
|
328
|
+
- lib/fun_ci/setup/stage_templates/placeholders.rb
|
|
306
329
|
- lib/fun_ci/setup/stage_templates/scripting.rb
|
|
307
330
|
- lib/fun_ci/setup/stage_templates/shell.rb
|
|
308
331
|
- lib/fun_ci/setup/template_writer.rb
|
|
@@ -344,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
344
367
|
- !ruby/object:Gem::Version
|
|
345
368
|
version: '0'
|
|
346
369
|
requirements: []
|
|
347
|
-
rubygems_version: 4.0.
|
|
370
|
+
rubygems_version: 4.0.23
|
|
348
371
|
specification_version: 4
|
|
349
372
|
summary: Opinionated local CI that checks every commit on your machine, for you to
|
|
350
373
|
watch and for your coding agent to ask
|