If you encounter an issue with the SDK, you are welcome to submit a bug report. Before that, please search for similar issues. It's possible somebody has encountered this issue already.
Commit messages should follow the Angular Commit Message Guidelines. This is because our release tool - semantic-release - uses this format for determining release versions and generating changelogs. Tools such as commitizen or commitlint can be used to help contributors and enforce commit messages. Here are some examples of acceptable commit messages, along with the release type that would be done based on the commit message:
Commit message | Release type |
---|---|
fix(IAM Authentication) propagate token request errors back to request invocation thread |
Patch Release |
feat(JSON Serialization): add custom deserializer for dynamic models |
|
feat(BaseService): added baseURL as param to BaseService ctor BREAKING CHANGE: The global-search service has been updated to reflect version 3 of the API. |
If you want to contribute to the repository, here's a quick guide:
- Fork the repository
- If you have "write" access to the repository, you can avoid using a fork.
-
The
go-sdk-core
project uses Go modules for dependency management, so do NOT set theGOPATH
environment variable to include your localgo-sdk-core
project directory. -
Clone the respository into a local directory.
-
Install the
golangci-lint
tool:curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.2
- Note: As of this writing, the 1.51.2 version of
golangci-lint
is being used by this project. Please check thecurl
command found in the.travis.yml
file to see the version of this tool that is currently being used at the time you are planning to commit changes. This will ensure that you are using the same version of the linter as the Travis build automation, which will ensure that you are using the same set of linter checks that the automated build uses.
-
Install the
gosec
tool:curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
-
Make sure that you have a clean "baseline" to work from by building/testing the project before you start to make changes:
make all
-
Make your code changes as needed. Be sure to add new tests for any new or modified functionality.
-
Test your changes:
make test
The above command will run all the unit tests with the command
go test -tags=all
. Each unit test file contains one or more build tags as a way to classify the tests into various groups (example://go:build all || fast || auth
). Currently, these tags include: all, slow, fast, auth, basesvc, log and retries. Others might be added in the future. To run a specific class of tests (example 'retries'), use a command like this:cd core go test -tags=retries
-
Check your code for lint issues:
make lint
-
To build, test and lint check in one step:
sh make all
-
Make sure there are no security vulnerabilities by running
gosec
:sh make scan-gosec
-
Commit your changes:
- Commit messages should follow the Angular commit message guidelines as mentioned above.
- Push your branch to remote and submit a pull request to the main branch.
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.