Development¶
This guide is meant for developers who want to contribute or debug argocd-autopilot
.
Adding a New Feature:¶
- Fork the repository
- Clone it and add the upstream remote with
git remote add upstream https://github.com/argoproj-labs/argocd-autopilot.git
- Run
make local
to build the project - Add your feature, run
make pre-commit
, then commit - Run
make pre-push
- Push the changes to the remote branch and create a new PR:
git push --set-upstream upstream <remote-branch-name>
- If you need to get changes from the upstream repo, run:
git pull upstream main
Adding Documentation:¶
- Fork the repository.
- Clone it and add the upstream remote with:
git remote add upstream https://github.com/argoproj-labs/argocd-autopilot.git
. - Run
make serve-docs
to run a docker container that will server the docs on http://localhost:8000. - Edit existing docs in
/docs
directory or add newX.md
files and add them to themkdocs.yml
. - When you're ready, push your changes to your fork and submit a PR.
Releasing a New Version:¶
- Checkout to a release branch:
release-v0.X.X
- Change the
VERSION
in the Makefile to match the new version - Add what you need to
./docs/releases/release_notes.md
- Create a new PR to the
main
branch - After CI is green, add a
/release
comment to the PR to trigger the release pipeline (maintainers only) - After Release build is finished you can merge back to
main
Using pre-commit:¶
With pre-commit installed and properly set-up, both the pre-commit and pre-push hooks will run automatically.
- Install pre-commit on your machine
- Install the hooks in the repo folder:
pre-commit install -t pre-commit -t pre-push
- Enjoy
Linting:¶
We are using https://github.com/golangci/golangci-lint as our linter, you can integrate golangci-lint with the following IDEs:
- vscode: make sure
GOPATH
is setup correctly and runmake lint
this will downloadgolangci-lint
if it was not already installed on your machine. Then add the following to yoursettings.json
:
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
],