Skip to content

Latest commit

 

History

History
117 lines (84 loc) · 3.91 KB

CONTRIBUTING.md

File metadata and controls

117 lines (84 loc) · 3.91 KB

Contributing

By participating in this project, you agree to abide our Code of conduct.

Set up your machine

qd is written in Go.

Prerequisites:

Other things you might need to develop:

Clone the project anywhere:

git clone git@github.com:JetBrains/qodana-cli.git

cd into the cli directory and run for debug:

go run main.go

Build a binary with

go build -o qd main.go

Test your code with coverage:

go test -v $(go list -f '{{.Dir}}/...' -m | xargs)

Dry run goreleaser:

goreleaser release --snapshot --clean

Create a commit

Commit messages should be well formatted, and to make that "standardized", we are using Gitmoji.

You can follow the documentation on their website.

Submit a pull request

Push your branch to your repository fork and open a pull request against the main branch.

'Patching' an existing Qodana image

For testing purposes, it can be necessary to patch an existing Qodana image with a custom qodana-cli build. To achieve that, first build a linux binary:

# assume we're in the cli directory
env GOOS=linux CGO_ENABLED=0 go build -o qd-custom

Then build a new docker image, replacing the bundled qodana-cli with the newly built one:

# Use any existing qodana image
FROM registry.jetbrains.team/p/sa/containers/qodana-go:latest
COPY qd-custom /opt/idea/bin/qodana
docker build . -t qd-image

And lastly run the custom image with the custom binary:

/path/to/qodana-cli/cli/qd-custom scan --linter="docker.io/library/qd-image" --skip-pull

Release a new version

If you are a core maintainer and want to release a new version, all you need to release a new version is:

  1. Tag release in the release branch (e.g. 241)
git checkout 241 && git tag -a vX.X.X -m "vX.X.X" && git push origin vX.X.X
  1. Trigger release job in the release branch (e.g. 241)
  2. The release will be published to:

Troubleshooting choco releases

Releases through choco channel can be unstable sometimes depending on the Chocolatey services, so if you have any issues with it on release, upload the package manually:

  • Set up goreleaser and choco (for non-Windows systems – look at ci.yml for details)
  • Run the following commands:
    • Check out the wanted tag
    • Release the package locally to generate all metadata files and executables
    • Set the correct checksum for the already published package (can be obtained from the release page)
    • Set up choco API key and publish
git checkout v2024.1.2
goreleaser release --skip-publish --clean
vim dist/qodana.choco/tools/chocolateyinstall.ps1
choco apikey --key <YOUR_API_KEY> --source https://push.chocolatey.org/
cd dist/qodana.choco && choco pack && choco push qodana.2024.1.2.nupkg --source https://push.chocolatey.org/