Commit graph

10 commits

Author SHA1 Message Date
Vitali sharp8n 42ffcb9adc workflows 2026-09-13 19:28:47 +03:00
Vitali sharp8n c33e34796f enchancements 2026-09-13 11:35:17 +03:00
Vitali sharp8n b977619f94 workflow development 2026-09-12 23:29:19 +03:00
Vitali sharp8n e2265c7856 reengineering of workflow system 2026-09-12 01:02:46 +03:00
Vitali sharp8n 17d4515961 fix(dispatcher): use tenant-selected workflow repo and ensure clone before dispatch
The C# worker failed with 'entry file not found: Main.cs' because the
dispatcher resolved the working directory against the DEFAULT workflow
repo instead of the tenant's currently-selected one, and never ensured
the selected repo was cloned on the executing host. This left the worker
working in a directory whose code files did not exist.

- WorkflowSourceFactory.ResolveCopiesRoot now anchors a relative
  WorkflowSource:CopiesRoot to the content root (not the process CWD), so
  a worker started from a container/different CWD still lands on the same
  wizard root as the control plane.
- ForgejoWorkflowRepoService takes IWebHostEnvironment and uses
  ResolveCopiesRoot the same way.
- TaskDispatcher.ResolveWorkerRootForTenantAsync resolves the tenant's
  SELECTED repo from WorkflowRepoStore, and calls EnsureCloneAsync to
  materialize that repo on the executing host before resolving the working
  directory. EnsureClone is a no-op once the clone exists, so repeated
  dispatches stay cheap; failures are logged and swallowed so the resolved
  path still surfaces a deterministic error if the repo is genuinely missing.

Adds regression tests: TaskDispatcherWorkingDirTests.
2026-09-03 19:27:03 +03:00
Vitali sharp8n 4ad6cc2cb9 workflow source mapping 2026-09-03 17:44:39 +03:00
Vitali sharp8n 3b50333353 fixes 2026-09-03 10:59:54 +03:00
Vitali sharp8n 6f10e33069 Fix working-dir resolution + add trigger backpressure
ResolveWorkingDir now prefers the on-disk layout (root/dir, else
root/sharedDir/dir) so workflows compiled with or without the
shared-dir prefix stop spawning failing jobs against a missing cwd.

TriggerScheduler defers an auto-trigger once a tenant has >=
Workflow:TriggerMaxInFlight (default 5) in-flight runs, so a slow
worker no longer stacks a never-draining backlog (the root of the
run-timeout overload).
2026-09-02 18:10:08 +03:00
Vitali sharp8n 3e31e4a8da stabilization 2026-09-02 01:12:21 +03:00
Vitali sharp8n 6042171fc2 Initial: workflows API control plane + tests + YAML workflow definitions 2026-09-01 19:37:53 +03:00