First of all, thanks for contributing!. Before contributing please read the CODE_OF_CONDUCT and search the issue tracker; your issue may have already been discussed
-
If you think you've found an issue with the extension, you can open a Github issue.
-
Feel free to reach out to us at sumodojo.slack.com.
- Fork the repo 🎉
- Create a feature branch. ☕
- Run unit tests and confirm that it passes. ⚡
- Commit your changes. 📝
- Rebase your local changes against the master branch. 💡
- Create new Pull Request.
-
To install build related dependencies use below command
env GO111MODULE=off go install <package>. -
Always use
go mod tidyto clean up unwanted dependencies. -
To generate the binary use below command
go build -o target/extensions/sumologic-extension lambda-extensions/sumologic-extension.go
-
Unit Testing locally
- Go to root folder and run
go test ./... - Go to lambda-extensions folder and run
go test ./...
- Go to root folder and run
-
Testing with Lambda function
Add the layer arn generated from build command output to your lambda function by following instructions in docs.Test by running the function manually. Confirm that logs are coming to Sumo Logic.
-
Lambda layer versions are immutable.
- Once a version (e.g.,
v10) is published, its code and content cannot be modified. - If changes are needed, you must publish a new version (e.g.,
v11).
- Once a version (e.g.,
-
Once you delete a Lambda layer version (like
v10), it’s permanently gone.- You cannot reuse or re-publish that same version number.
- Any new Lambda function or update trying to reference
v10will fail.
-
Existing Lambda functions that were already using
v10may still run for a while, because AWS caches the layer code internally.- However, once you update or redeploy them,
v10will no longer be available.
- However, once you update or redeploy them,
- Change the AWS_PROFILE environment variable using below command. The profile should point to sumocontent aws account.
export AWS_PROFILE=<sumo content profile> - Update the layer version in config/version.go.
- Go to scripts folder
cd scripts/ - Change the layer_name variable in zip.sh to avoid replacing the prod.
- Run the following command to publish the layer:
sh zip.sh - Run the following command to verify that the layer version is published across regions:
sh verify_layer_versions.sh
-
The new extension binary and zip files gets released automatically after the tags are pushed using Github actions(Refer tagged-release in https://github.com/marvinpinto/action-automatic-releases).
Run below commands to create and push tags
git tag -a v<major.minor.patch> <commit_id>git push origin v<major.minor.patch> -
Add the
sumologic-extension-amd64.tar.gzandsumologic-extension-arm64.tar.gzfiles manually from the target folder generated after running zip.sh. -
Update the release description with new layer arns and more details on what's changed.
- Make sure to install new go version. Preferably use gvm.
- Update golang version in
go.modor run commandgo mod edit -go <version ex 1.22>. - Run
go mod tidy. This will updatego.sumfile and clean up unwanted dependencies. - Install
golangci-lintby running commandbrew install golangci-lint. Go tolambda-extensionsdirectory and rungolangci-lint run, this will check for deprecated methods. Check enabled linters usinggolangci-lint linterscommand. - Install
govulncheckby running commandgo install golang.org/x/vuln/cmd/govulncheck@latestand run~/go/bin/govulncheck -mode=binary target/amd64/extensions/sumologic-extension. this will find common security issues. - Run
go test ./...to run the unit tests