Skip to content

feat: add headless release artifact#2260

Open
yohamta0 wants to merge 3 commits into
mainfrom
feat/dagu-headless-release
Open

feat: add headless release artifact#2260
yohamta0 wants to merge 3 commits into
mainfrom
feat/dagu-headless-release

Conversation

@yohamta0

@yohamta0 yohamta0 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a headless build tag that excludes embedded frontend assets while keeping API/headless server behavior available
  • publish dagu-headless release archives alongside the normal UI-enabled dagu archives
  • keep Homebrew formulas pinned to the normal dagu archive

Changes

  • split embedded frontend assets behind default and headless build-tag files
  • gate Web UI routes and template rendering through webUIEnabled() so server.headless and headless builds behave consistently
  • add build-specific frontend route tests for default and headless binaries
  • add a dagu-headless GoReleaser build and archive while restricting Homebrew formulas to the normal dagu archive

Related Issues

  • N/A

Checklist

  • Code style follows existing patterns
  • Self-review completed
  • Tests added or updated where needed
  • Documentation updated or not required
  • Local validation completed

Testing

  • go test ./internal/service/frontend -count=1
  • go test -tags=headless ./internal/service/frontend -count=1
  • go build -o /private/tmp/dagu-default ./cmd
  • go build -tags=headless -o /private/tmp/dagu-headless ./cmd
  • git diff --cached --check
  • not run: goreleaser check (GoReleaser is not installed locally)

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06f859d6-829f-4125-8666-5d2871942b63

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces a dagu-headless build variant that conditionally packages and enables the Web UI. The default build embeds Web UI assets; the headless build omits them. Routes and templates gate Web UI availability through a new abstraction, ensuring consistent behavior across both variants and enabling release of a lightweight headless binary.

Changes

Headless Build Variant with Conditional Web UI Embedding

Layer / File(s) Summary
Build variant definition
.goreleaser.yaml
Goreleaser adds a new dagu-headless build target compiled with -tags=headless flag, sharing the existing cross-platform matrix and ignore rules. Homebrew configurations are updated to include dagu-headless in two release taps.
Conditional asset embedding
internal/service/frontend/assets_embed.go, internal/service/frontend/assets_headless.go, internal/service/frontend/templates.go
Default builds embed UI resources via assets_embed.go with webUIEmbedded=true. Headless builds provide an empty filesystem via assets_headless.go with webUIEmbedded=false. Asset embedding is moved out of templates.go into these build-specific files.
Web UI enablement abstraction
internal/service/frontend/templates.go, internal/service/frontend/server.go
A new Server.webUIEnabled() helper gates Web UI availability by checking both the embedded asset flag and the headless config. Route registration and template rendering use this helper instead of directly checking the headless flag.
Test infrastructure and validation
internal/service/frontend/export_test.go, internal/service/frontend/assets_default_test.go, internal/service/frontend/assets_headless_test.go
Test-only exports provide helpers to access webUIEmbedded and set up route tests. Build-specific tests verify assets return HTTP 200 in default builds and HTTP 404 in headless builds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly matches the main change: introducing a headless build variant with its own release artifact.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description includes all required template sections with detailed content covering the summary, changes, related issues, and a completed checklist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dagu-headless-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Re-trigger cubic

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.

1 participant