## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

- Auto
- Light
- Dark

# xGov Beta Architecture

```
mainfeat/add-foo-123feat/add-bar-123feat/add-baz-123version/1.0.0release0-629912d0.37.0feat(foo): ...doc(foo): ...v1.0.0.canary.1feat(baz): ...doc(baz): ...test(baz): ...chore(bar): ...feat(bar): ...v1.0.0.canary.2bump(v1.0.0): pyproject.tomlrelease(v1.0.0): ...v1.0.0v1.1.0.canary.1Trunk-based with CD
```

- `main` (default), the _trunk_
- `release`

The trunk is considered _stable_ and **MUST**:

- Reject commits not included in a Pull Request
- Reject commits from branches other than `release` that have a `diff` on the `pyproject.toml` version bump
- Require Docs and TestNet deployments to be healthy to accept commits from `release`
- Meet the quality criteria defined in the CI/CD pipeline

The `release` branch **MUST**:

- Be kept in sync with `main`
- Be used to generate release tags
- Reject commits from branches other than `main` that are:
  
  - Not included in a Pull Request
  - Have a `diff` that is not strictly equal to the `pyproject.toml` version bump.

The CI/CD pipeline ensures that:

- The `main` branch contains release-grade code at any time (both for Smart Contracts and Docs)

- The `release` branch is synced with `main` and used only to generate release tags (reflected as `pyproject.toml` version)

Features, major refactoring, dependency bumps, or bugfixes **SHALL** be carried
out on a dedicated unprotected branch pointing to the trunk (`main`).

The `pyproject.toml` release version bumps **SHALL** be carried out on a dedicated
unprotected branch pointing to the `release` branch.

Draft Pull Requests from unprotected branches, either to `main` or `release`, **SHOULD**
skip the CI.

The CD makes use of the following deployment environments:

- `preview`: to host the static documentation (mdBook)

- `contract-testnet`: to continuously deploy Smart Contracts to the Algorand TestNet

- `contract-mainnet`: to deploy Smart Contracts to the Algorand MainNet on release

The CI/CD pipeline is implemented with the following _automated_ workflows:

- Smart Contracts CI (tests, lint, output stability, mock deployment)

- Smart Contracts CD (to TestNet)

- Documentation CI (tests, lint, preview)

- Release CI (validate release tag, version, etc.)

- Release (to MainNet)

And the following _manually dispatchable_ workflows:

- Documentation preview for external contributions
- Documentation deployment (to [https://docs.xgov.algorand.co/](https://docs.xgov.algorand.co/))
- xGov Registry parameters configuration
- xGov Registry RBAC management
- Pause and Resume Proposals
- Release and Update xGov Council
