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 localto 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-docsto run a docker container that will server the docs on http://localhost:8000. - Edit existing docs in
/docsdirectory or add newX.mdfiles 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
VERSIONin the Makefile to match the new version - Add what you need to
./docs/releases/release_notes.md - Create a new PR to the
mainbranch - After CI is green, add a
/releasecomment 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
GOPATHis setup correctly and runmake lintthis will downloadgolangci-lintif it was not already installed on your machine. Then add the following to yoursettings.json:
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
],