Thank you for helping improve WorkloadGovernor! This guide covers everything you need to know to contribute effectively.
- Getting Started
- Reporting Bugs
- Proposing Features
- Development Workflow
- Branch Naming
- Commit Convention
- PR Checklist
- Changelog Requirements
- Versioning Convention (Semver)
- Release Process
- Code Style
- Testing
- Code of Conduct
# 1. Fork the repository and clone your fork
git clone https://github.com/<your-username>/workload-governor.git
cd workload-governor
# 2. Add the upstream remote
git remote add upstream https://github.com/FaveTeamz/workload-governor.git
# 3. Install the Soroban toolchain
rustup target add wasm32v1-none
cargo install --locked stellar-cli
# 4. Verify everything builds and tests pass
cargo build --target wasm32v1-none --release
cargo test --features testutilsOpen an issue using the Bug Report template (.github/ISSUE_TEMPLATE/bug_report.md).
Include:
- What you did (steps to reproduce)
- What you expected to happen
- What actually happened (error message, error code)
- Environment: network (testnet/mainnet), contract ID, browser/Node version
Open an issue using the Feature Request template (.github/ISSUE_TEMPLATE/feature_request.md).
Include:
- The problem you are solving
- Your proposed solution
- Alternatives you considered
- Whether it requires a contract upgrade (ABI change = MAJOR semver bump)
- Sync your fork:
git fetch upstream && git rebase upstream/main. - Create a feature branch:
git checkout -b feat/short-description. - Make your changes — keep commits focused and atomic.
- Update
CHANGELOG.mdunder the[Unreleased]section (see below). - Open a pull request targeting
main.
feat/<short-description> # new functionality
fix/<short-description> # bug fixes
docs/<short-description> # documentation only
refactor/<short-description> # no behaviour change
chore/<short-description> # tooling, deps, CI
Example: feat/global-cap-increase, fix/saturating-subtraction.
Use Conventional Commits:
<type>(<scope>): <short summary>
[optional body]
[optional footer, e.g. Closes #42]
Common types: feat, fix, docs, refactor, test, chore.
Before requesting review, confirm every item:
-
cargo fmtapplied -
cargo clippy --features testutils -- -D warningspasses with zero warnings -
cargo test --features testutilspasses - New functionality has new tests
-
CHANGELOG.mdupdated under[Unreleased] - Docs updated if public API or behaviour changed
- PR title follows Conventional Commits format
- Issue number referenced in PR description (
Closes #N)
Every pull request to main must update CHANGELOG.md.
- Add your entry under the
## [Unreleased]heading. - Use the appropriate sub-heading:
Added,Changed,Deprecated,Removed,Fixed, orSecurity. - Reference the issue number in parentheses, e.g.
(#42). - A CI check (
changelog-check) will fail the PR ifCHANGELOG.mdhas not been modified.
Example entry:
## [Unreleased]
### Fixed
- Correct saturating subtraction in `withdraw_application` (#55).This project follows Semantic Versioning 2.0.0.
MAJOR.MINOR.PATCH
| Component | Increment when… |
|---|---|
| MAJOR | A breaking on-chain change: altered function signatures, changed error discriminants, storage key renames, or removal of a public function. |
| MINOR | New backward-compatible functionality: new public functions, new events, new optional parameters. |
| PATCH | Backward-compatible bug fixes, documentation updates, refactors with no observable behavior change. |
Important: Because WorkloadGovernor is a Soroban smart contract, any change that alters the ABI (function names, parameter types, return types, error codes) is a MAJOR version bump — even if it seems minor from a traditional software perspective. Deployed contracts cannot change their address, so clients depend on strict ABI stability.
git checkout main
git pull upstream main
git checkout -b release/vX.Y.ZMove all entries from [Unreleased] to a new versioned heading and update the
diff links at the bottom of CHANGELOG.md:
## [X.Y.Z] - YYYY-MM-DD
### Added
- ...
[X.Y.Z]: https://github.com/FaveTeamz/workload-governor/compare/vPREV...vX.Y.Z
[Unreleased]: https://github.com/FaveTeamz/workload-governor/compare/vX.Y.Z...HEAD[package]
version = "X.Y.Z"Run cargo build --target wasm32v1-none --release to confirm the build still passes.
Open a PR from release/vX.Y.Z → main. After review and CI passes, merge.
git checkout main
git pull upstream main
git tag -a vX.Y.Z -m "Release vX.Y.Z"
git push upstream vX.Y.Z- Go to Releases → Draft a new release.
- Select the tag
vX.Y.Z. - Copy the changelog section for this version into the release notes.
- Attach the optimised WASM artifact:
Attach
stellar contract optimize \ --wasm target/wasm32v1-none/release/workload_governor.wasm
target/wasm32v1-none/release/workload_governor.optimized.wasm.
- Run
cargo fmtbefore committing. - Run
cargo clippy --features testutils -- -D warningsand fix all warnings. - Every new
pub fnmust have a Rustdoc comment following the style insrc/lib.rs(sections: summary,# Who can call,# Arguments,# Returns,# Errors,# Examplesfor user-facing functions).
# All tests
cargo test --features testutils
# Property-based tests only
cargo test --features testutils prop_
# Unit tests only
cargo test --features testutils unit_
# Check docs build cleanly
cargo doc --no-deps# Run all frontend unit tests once
npm run test:unit
# Run in watch mode during development
npm run test:unit:watch
# Run with coverage report
npm run test:unit:coverageSnapshot files live in tests/unit/__snapshots__/. They are committed to
version control so CI catches unintended visual regressions.
When you intentionally change a component's rendered output, update the
snapshots and commit the new .snap file alongside your code change:
# Update all snapshots
npx vitest run --update-snapshots
# Update snapshots for a single file
npx vitest run tests/unit/snapshots.test.tsx --update-snapshotsCI will fail if any snapshot differs from the committed version. Always review
git diff tests/unit/__snapshots__/ before committing updated snapshots.
All PRs must pass CI. New functionality requires new tests.
This project follows the Contributor Covenant v2.1. By participating you agree to uphold its standards. Report unacceptable behaviour to the maintainers via a private GitHub message.