First off, thanks for taking the time to contribute! 🎉
lpn is a CLI, written in Go, that makes running Liferay Portal's Docker
images easy. This guide explains how to get a development environment up and
running, and how to get your changes merged.
- Code of Conduct
- Where do Pull Requests go?
- Reporting Issues
- Development Setup
- Building
- Running the Tests
- Code Style
- Submitting a Pull Request
Be kind and respectful. We want lpn to be a welcoming project for everybody,
so please assume good intentions and keep the conversation constructive.
Please open your Pull Requests against the develop branch, not master /
main.
develop is the integration branch where all day-to-day work lands. Stable
releases are cut from develop into the release branch, so targeting develop
keeps things flowing and avoids extra rebasing for everybody.
When you open a PR, double-check the base branch selector at the top of the
GitHub "Open a pull request" screen and make sure it reads develop. If you
already opened one against the wrong branch, you can simply edit the PR and
change the base branch — no need to close and reopen it.
Found a bug or have an idea? Please open an issue.
When reporting a bug, it helps a lot if you include:
- The version of
lpnyou are using (lpn version). - Your operating system and Docker version.
- The exact command you ran and the full output (setting
LPN_LOG_LEVEL=DEBUGgives more detail). - What you expected to happen versus what actually happened.
You will need:
- Go (see the
godirective ingo.modfor the required version). - Docker, which the CLI wraps and which the end-to-end tests rely on.
Then clone the repository and fetch the dependencies:
git clone https://github.com/mdelapenya/lpn
cd lpn
go mod downloadIf you plan to send a Pull Request, fork the repository first and clone your fork instead.
Build the binary locally with:
go build -o ./bin/lpn .You can then run the freshly built binary:
./bin/lpn helpRun the unit tests (everything except the end-to-end suite):
go test $(go list ./... | grep -v /e2e)Run the end-to-end tests (these require Docker and can take a while):
go test ./e2e/... -timeout 30mTo generate a coverage report, use the helper script:
./scripts/coverage.shPlease make sure the test suite passes before opening a Pull Request. The same
tests run in CI on every Pull Request against develop.
- Format your code with
gofmt(orgo fmt ./...) before committing. - Run
go vet ./...to catch common mistakes. - Follow standard, idiomatic Go conventions.
- Keep functions focused and use meaningful names.
- Add or update tests (
*_test.go) alongside your changes.
-
Fork the repository and create a topic branch from
develop:git checkout develop git pull git checkout -b my-awesome-change
-
Make your changes, adding tests where it makes sense.
-
Format and lint your code (
go fmt ./...andgo vet ./...). -
Make sure the tests pass (
go test ./...). -
Write clear commit messages that explain the "why" of your change.
-
Push your branch and open a Pull Request against the
developbranch. -
Fill in the Pull Request template and link any related issue.
A maintainer will review your Pull Request as soon as possible. Thanks again
for contributing to lpn! 🚀