Skip to content

Latest commit

 

History

History
169 lines (114 loc) · 4.94 KB

CONTRIBUTING.md

File metadata and controls

169 lines (114 loc) · 4.94 KB

Contributing to Dagu

Thank you for considering to help improve Dagu! We welcome contributions from anyone on the internet.

You do not need to understand the whole repository before making a useful first change.

First 15 Minutes

  1. Fork the repository and clone it locally.
  2. Pick a small issue, then comment on it to claim the work. Use the Discord server if you have questions or get stuck for 20 minutes; that is expected.
  3. Choose the track closest to your change:
Track Start with First check
Docs / examples A Markdown file or examples/ No build is required; validate a changed DAG with dagu validate if you have the binary available
UI ui/ Start the backend with make run-server, then run cd ui && pnpm install && pnpm dev
One executor internal/runtime/builtin/EXECUTOR_PACKAGE make test TEST_TARGET=./internal/runtime/builtin/EXECUTOR_PACKAGE (replace EXECUTOR_PACKAGE with the package name)
API / CLI internal/service/frontend/api/v1 or internal/cmd make test TEST_TARGET=./internal/service/frontend/api/v1 or the matching package

For a first PR, change only the files needed for the issue. You do not need to learn every package or run the full test suite before opening a focused PR.

How to Contribute

We welcome contributions of all kinds, including:

  • Help other users by answering questions and providing support
  • Suggest new features or improvements
  • Improve documentation and examples, or provide use cases
  • Refactor code for better readability and maintainability
  • Fix bugs or add missing tests
  • Add new features based on issue discussions
  • Review and provide feedback on PRs

Development

Prerequisites depend on your track:

  • Go (latest stable) for Go and backend changes.
  • Node.js (latest stable) and pnpm for UI changes.
  • Go is also needed for the UI development loop, since starting the backend builds it.
  • Docs-only changes do not require the Go toolchain.

Nix

If you use Nix, the flake gives you Go, Node.js, pnpm, make and the host tools the Makefile calls:

nix develop

The Makefile installs its Go tools and protoc into .local itself. Docker and Zig, used only by the image and keepalive targets, are not included.

Building frontend assets:

make ui

Building binary:

make bin

Running Tests

Run the smallest relevant check first. For a first code change, pass the Go package you touched through TEST_TARGET:

make test TEST_TARGET=./path/to/changed/package

For UI changes:

cd ui
pnpm install
pnpm test

Docs-only and example-only changes do not need Go tests. If an example changes a DAG, validate it with the dagu binary when available.

The full repository check is primarily for CI and maintainers. Run it locally when practical:

make lint
make test

To run tests with code coverage analysis:

make test-coverage

After changing Go files, run make fmt and check the diff before opening the PR.

Frontend

Starting the backend server on port 8080:

make run-server

Starting the development server:

cd ui
pnpm install
pnpm dev

Navigate to http://localhost:8081 to view hot-reloading frontend.

Code Standards

  • Write unit tests for any new functionality
  • Aim for good test coverage on new code
  • Test error conditions and edge cases

Pull Requests

Before submitting:

  • The smallest relevant test or validation command passes
  • make lint passes for Go changes when practical
  • New code includes tests when behavior changes
  • Documentation updated if applicable
  • Commit messages following the Go Commit Message Guidelines

Review Process

  • All PRs are reviewed by maintainers.
  • Community members are encouraged to review and provide feedback.
  • CI runs lint and the Linux unit and integration tests on every push. The Windows, conformance, and E2E checks run once a maintainer adds the full-ci label, usually after review. The Windows tests also run when a PR changes Go code built only for Windows, or with the windows-ci label. Draft PRs run no checks.

Issues

Bug Reports

When reporting bugs, please include:

  • Operating system and version
  • Steps to reproduce the issue (example DAG yaml is very helpful)
  • Expected behavior
  • Actual behavior
  • Relevant logs or error messages

Feature Requests

When requesting features, please describe:

  • Clearly describe the feature and its use case
  • Explain why it would be valuable
  • Consider backward compatibility
  • Provide examples if possible

License

By contributing to Dagu, you agree that your contributions will be licensed under the GNU General Public License v3.0.