Commit Graph
23 Commits
Author SHA1 Message Date
Yota Hamada 45b11e0db1 ci: run tests on windows-latest (#1997) 2026-04-16 10:51:49 +09:00
Yota Hamada 2c47e3f284 fix: migrate GitHub org references to dagucloud 2026-04-06 13:16:44 +09:00
Yota Hamada e85b7b7041 fix: clean up failed command temp scripts (#1829) 2026-03-22 22:17:04 +09:00
Yota Hamada b581118067 chore: add GPL-3.0 license headers to source files
Add copyright and SPDX license identifier headers to all Go source
files, test files, shell scripts, and proto files.
2026-03-09 18:38:11 +09:00
Yota Hamada 1b856b04c4 feat: annotate script errors with failing line content and preserve emp scripts on failure (#1733) 2026-03-07 22:40:32 +09:00
Yota Hamada 99b4999e97 fix(#1661): expand env vars for non-Unix shells (PowerShell/cmd) (#1666) 2026-02-14 03:41:30 +09:00
Yota Hamada 5394d09878 chore: Upgrade to go 1.26 (#1655) 2026-02-12 22:37:40 +09:00
Pedro Rodriguez a83d1ea0de Fix/windows process tree and timeout fix (#1635)
# Fix: Enforce timeoutSec on Windows and prevent process hangs

## Problem Description

When `timeoutSec` is set on a DAG step, processes that exceed the
timeout should be forcibly terminated. However, on Windows, some
processes would continue running for hours even when `timeoutSec` was
set (e.g., to 900 seconds).

### Root Cause

The issue had two components:

1. **Blocking `cmd.Wait()`**: The `commandExecutor.Run()` method blocked
indefinitely on `cmd.Wait()` without listening to context cancellation.
When the timeout expired, the process would not be killed because the
code was stuck waiting for `Wait()` to return.
  
2. **Incomplete process termination on Windows**: The Windows
`KillProcessGroup()` function only killed the immediate process, leaving
child processes (subprocess tree) orphaned and running.
  

## Changes Made

### 1. `internal/runtime/builtin/command/command.go`

Modified the `Run()` method to:

- Run `cmd.Wait()` in a goroutine with a result channel
- Use `select` to watch for both context cancellation and command
completion
- Forcibly kill the process when context is cancelled (timeout)
- Return exit code 124 (standard timeout exit code) on timeout

### 2. `internal/cmn/cmdutil/cmd_windows.go`

Updated `KillProcessGroup()` to:

- Use `killProcessTree()` instead of just `cmd.Process.Kill()`
- Ensure child processes are also terminated on Windows
- Match the behavior used in `KillMultipleProcessGroups()` and Unix
implementation

## Impact

- **timeoutSec** now works reliably on all platforms, especially Windows
- Processes that hang due to I/O blocking or zombie states are properly
terminated
- Child processes on Windows are no longer orphaned when the parent is
killed
- Exit code 124 is returned for timeout scenarios (consistent with Unix
timeout behavior)

## Files Changed

1. `internal/runtime/builtin/command/command.go` - Core timeout
enforcement fix
2. `internal/cmn/cmdutil/cmd_windows.go` - Windows process tree
termination fix
2026-02-06 11:09:07 +09:00
Yota Hamada 96d046f818 feat: dollar sign escape syntax (#1634)
Resolves #1628
2026-02-06 09:59:04 +09:00
Yota Hamada 4027aa4075 feat: restrict OS env expansion to DAG env (#1632) 2026-02-05 16:19:15 +09:00
Yota Hamada 1557b14f23 worker: fix problems in shared nothing worker (#1573)
* **New Features**
* Added distributed DAG execution support with coordinator integration
for remote execution on worker nodes.
* Introduced live remote progress display with spinner animation for
distributed DAG runs.
  * Added DAG run cancellation support for distributed executions.
  * Enabled real-time scheduler log streaming to coordinator.
  * Implemented graceful shutdown handling via SIGINT/SIGTERM signals.

* **Improvements**
* Automatic worker ID derivation from hostname when not explicitly
configured.
  * Enhanced log file error handling with proper 404 detection in UI.
2026-01-13 00:37:31 +09:00
Yota Hamada 8dd3bcaf5c feat(all): add shell field for ssh config (#1546)
* **New Features**
- SSH now supports optional shell configuration for remote command
execution; shell can be specified at DAG or step level with proper
precedence handling.
- Added controls for variable expansion behavior in command evaluation.

* **Bug Fixes**
- Improved Docker container timeout error reporting with clearer status
information.

* **Tests**
  - Expanded shell detection and command building test coverage.
  - Added comprehensive shell configuration precedence tests for SSH.
2026-01-01 23:11:47 +09:00
Yota Hamada 86bc2c66fe fix(spec): allow single-field overrides for errorMail, infoMail, and SMTP configs (#1513)
Resolves #1512 

* **Bug Fixes**
* Improved handling of SMTP and Mail configuration so empty/partial
configs are detected and applied consistently.

* **Tests**
* Added tests covering configuration override and inheritance scenarios
for SMTP and mail settings.

* **Chores**
* Added internal compile-time assertions to reinforce interface
conformance and code correctness.
2025-12-28 17:53:54 +09:00
Yota Hamada 3e9d49d1e0 feat(all): multiple commands syntax (#1506)
* **New Features**
* Steps can contain multiple commands executed sequentially; UIs and
runners display and run command lists.

* **Validation**
* Executors advertise capabilities and produce clearer errors when
features conflict or are unsupported (multi-command vs
sub-workflow/script/container).

* **API**
* Step payloads now use a commands list for command entries; legacy
single-command fields remain supported for compatibility.

* **Integration & UX**
* Schemas, APIs, reporting, and UI components updated to present and
handle the commands array.
2025-12-27 03:42:15 +09:00
Yota Hamada 882b6ebbfa fix(runtime): decode log tail in proper encoding (#1449)
* **New Features**
* Logs and recent stderr tails now decode many encodings (Shift_JIS,
EUC-JP, ISO-8859-1, Windows-1252, GBK, Big5, EUC-KR, UTF-8); log
encoding can be specified.

* **Bug Fixes**
* Environment and secret propagation during execution setup improved so
secrets correctly override env vars and PATH handling preserved.

* **Tests**
* Added comprehensive tests covering multiple encodings and charset name
variants.
2025-12-06 22:53:40 +09:00
Yota Hamada a255fb234f fix(windows): bug in command construction with powershell/cmd.exe (#1445)
* **Bug Fixes**
* Prevented unintended propagation of extra command arguments when
invoking shell commands, reducing surprise argument forwarding across
certain shell invocation paths.

* **Tests**
* Added tests covering shell argument behavior across multiple shells
(cmd.exe, PowerShell, pwsh, etc.), including cases for script-only
invocations to ensure correct argument inclusion/exclusion.
2025-12-06 00:41:41 +09:00
YotaHamada e75d14f781 fix(windows): Windows specific script handling (#1439)
* **New Features**
* Direct command mode, nix-shell and prioritized shell handlers
(PowerShell, cmd, Unix).
* Platform-aware environment whitelist with normalized env-key handling
and platform-specific defaults.
* Log reading: selectable encodings, platform-aware default encoding,
and richer read-result metadata.
  * New helper to detect regular files.

* **Refactor**
* Consolidated command construction for consistent cross-shell
execution.

* **Tests**
  * Expanded shell, path-normalization, file, and encoding tests.

* **Chore**
  * More restrictive permissions for created work directories.
2025-12-04 19:33:32 +09:00
YotaHamada 8b340e63f6 fix(all): resolve working directory relative paths correctly (#1436)
- DAG-level relative `workingDir` now resolves against DAG file location
- Step-level relative `dir` now resolves against DAG's `workingDir`
2025-12-02 21:58:12 +09:00
YotaHamada a7e61b5653 feat(spec): add DAG level shell field (#1426)
- add dag level 'shell' field
- refactor to handle shell detection consistently
2025-11-30 02:31:49 +09:00
YotaHamada 8ded20ff4c fix(executor/command): handle windows script extensions (#1425) 2025-11-29 17:28:06 +09:00
YotaHamada b6e390fed8 Adopt “Sub DAG” terminology across backend, UI, and docs (#1362) 2025-10-29 09:06:15 +09:00
YotaHamada 30f8a04144 feat: add DAG secret references with runtime resolution and masking (#1338) 2025-10-19 02:51:56 +09:00
YotaHamada 85439bc71e Refactor internal packages into layered architecture (#1319) 2025-10-13 03:52:00 +09:00