Skip to content

Fix embedded Task version detection#1

Open
miki3421 wants to merge 2 commits into
sciabarracom:openserverlessfrom
miki3421:agent/fix-embedded-task-version
Open

Fix embedded Task version detection#1
miki3421 wants to merge 2 commits into
sciabarracom:openserverlessfrom
miki3421:agent/fix-embedded-task-version

Conversation

@miki3421

Copy link
Copy Markdown

What changed

  • Preserves Task versions injected with linker flags.
  • Uses the main module version when Task is built as the standalone program.
  • Uses github.com/sciabarracom/task/v3 from debug.BuildInfo.Deps when Task is embedded in another Go application.
  • Returns unknown instead of borrowing the host application version when the Task module cannot be identified.
  • Adds regression tests for standalone, embedded, replaced-module and missing-module cases.

Root cause

The embedded OpenServerless CLI imports Task as a library. internal/version previously read debug.BuildInfo.Main.Version, which is the host CLI version in that situation. A tagged CLI build such as v0.9.1 therefore made the Task schema validator compare schema 3.0.0 against Task 0.9.1 and reject valid v3 Taskfiles. Local source builds hid the bug because the host version was usually reported as devel and the upper-bound check was skipped.

Impact

Embedded consumers validate Taskfile schemas against the Task module version rather than their own unrelated release version. The minimum supported schema check remains active even when version discovery falls back to unknown.

Validation

  • go test ./internal/version passes with four regression cases.
  • git diff --check passes.
  • go test ./... was attempted but the openserverless base branch already fails to compile unrelated existing tests because several table literals use an unknown ops field in task_test.go and internal/fingerprint/task_test.go; taskfile/ast also has a preexisting parsing failure. None of those files are changed here.

Tracking issue: apache/openserverless#209

@mergify

mergify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants