Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.65 KB

File metadata and controls

63 lines (43 loc) · 1.65 KB

Developing

Prerequisites

The extension requires the gh CLI to be installed and added to the PATH. Users must also authenticate via gh auth before using the extension.

For development, we use Go with a minimum version of 1.22.

$ go version
go version go1.22.x <arch>

Building

To build the project, run make build (or script/build). After building, you can run the binary locally, for example: ./gh-models list.

Testing

To run lint tests, unit tests, and other Go-related checks before submitting a pull request, use:

make check

We also provide separate scripts for specific tasks, where check runs them all:

make test
make fmt  # for auto-formatting
make vet  # to find suspicious constructs
make tidy # to keep dependencies up-to-date

Integration Tests

In addition to unit tests, we have integration tests that use the compiled binary to test against live endpoints:

# Build the binary first
make build

# Run integration tests
cd integration
go test -v

Integration tests are located in the integration/ directory and automatically skip tests requiring authentication when no GitHub token is available. See integration/README.md for more details.

Releasing

When upgrading or installing the extension using gh extension upgrade github/gh-models or gh extension install github/gh-models, the latest release will be pulled, not the latest commit. Therefore, all changes require a new release:

git tag v0.0.x main
git push origin tag v0.0.x

This process triggers the release action, which runs the production build.