Thank you for contributing to help make Pulumi Java support better. We appreciate the help! This repository is one of many across the Pulumi ecosystem and we welcome contributions to them all.
Please make sure to read and observe our Contributor Code of Conduct.
You are welcome to join the Pulumi Community Slack for questions and a community of like-minded folks. We discuss features and file bugs on GitHub via Issues as well as Discussions.
Feel free to pick up any existing issue that looks interesting to you or fix a bug you stumble across while using Pulumi with Java. No matter the size, we welcome all improvements.
For larger features, we'd appreciate it if you open a new issue before investing a lot of time so we can discuss the feature together.
Please also be sure to browse current issues to make sure your issue is unique, to lighten the triage burden on our maintainers.
This repo uses mise to manage tool versions (Go, JDK, Gradle, Maven, etc.). Install mise and run mise install to get the correct versions. See .mise.toml for the full list.
You will also need:
- Pulumi CLI 3.30.0 or higher
- Ensure running
makepasses with no issues. - Run
make codegen_tests_updateif anything related to codegen has been changed. - We require a changelog entry for all PRs that aren't labeled
impact/no-changelog-required. To generate a new changelog entry, runmake changelogand follow the prompts on screen.
-
sdk/java/is a Gradle project that hosts the core Java SDK -
pkg/cmd/pulumi-language-javais a Go program that defines the Pulumi Java Language Provider -
pkg/codegenhosts Java SDK and program generation Go packages -
tests/examplescontain a few example programs and Go test automation that exercises them regularly in a CI context -
pulumiis a Git submodule reference to a copy ofpulumi/pulumiwith the purpose of consuming protobuf definitions that declare SDK and provider interfaces
There are Make targets that help rebuild all Java and Go packages from
source. For correct cross-referencing in examples and tests, Java
packages need to be installed into the local ~/.m2 Maven repo.
The targets do not yet understand dependencies accurately, so you may need to re-run to make sure changes to Java SDK or providers are rebuilt.
As for Go changes, Pulumi CLI will respect the version of
pulumi-language-java it finds in PATH over the default version it
ships with. When testing changes to the language provider, you
therefore might need to manipulate PATH to prefer the locally build
version.
make submodule_update # downloads pulumi/pulumi for protobuf definitions
make install_sdk # installs com.pulumi:pulumi into ~/.m2 maven repo
make bin/pulumi-language-java # builds bin/pulumi-language-java language host
export PATH="${PATH}:${PWD}/bin" # add bin/pulumi-language-java to PATHThe pkg/codegen/testing/test/testdata directory holds generated code used in tests.
Tests will begin failing if the code in this directory is out-of-date.
Use make codegen_tests_update to update code it if you change any codegen logic.
Release builds of the Java SDK are published to Maven Central as
com.pulumi:pulumi.
Every example is a valid Pulumi program that can be tested by manually
doing pulumi up in the right folder.
cd tests/examples/aws-java-webserver
pulumi up
Manual testing sometimes requires setting per-example settings using
pulumi config and is documented in every individual example
README.md.
For automated testing, examples are added to java_examples_test.go
to run under ProgramTest framework. There is a Make helper to run
the automated test:
make test_example.aws-java-webserver
See templates/README.md on how to manually test template changes
locally.
Similarly to examples, Make helper targets are provided to
automatically test templates, for example to test
templates/java-gradle run:
make test_template.java-gradle
We are sure there are rough edges and we appreciate you helping out.
If you want to talk with other folks in the Pulumi community
(including members of the Pulumi team) come hang out in the
#contribute channel on the
Pulumi Community Slack.
Changelog management is done via changie.
See the installation guide for changie.
Always use make changelog (or changie new) to create entries. Do not
hand-write the YAML files in .changes/unreleased/: the rendered changelog
embeds the pull request number from custom.PR, and omitting it causes links
to render as <no value>.
Here is an example of what make changelog looks like:
$ make changelog
✔ Component … sdk
✔ Kind … Improvements
✔ Body … Cool new SDK feature.
✔ GitHub Pull Request … 123Changelog notes are written in the active imperative form. They should not end with a period. The simple rule is to pretend the message starts with "This change will ..."
Good examples for changelog entries are:
- Exit immediately from state edit when no change was made
- Fix root and program paths to always be absolute
Here's some examples of what we're trying to avoid:
- Fixes a bug
- Adds a feature
- Feature now does something
Releases are prepared automatically every Monday at 09:00 UTC. If there are unreleased changelog entries, the automation:
- Runs
changie batch autoto choose the next version from the change kinds, thenchangie mergeto updateCHANGELOG.md. - Opens or updates a
Changelog for v<version>PR fromautomation/next-releasecontaining the versioned changelog and updatedCHANGELOG.md. - Approves the PR and enables squash auto-merge, so it merges once the required checks pass.
Merging the release PR triggers this repository's
release workflow, which creates the GitHub
release, publishes the Java SDK to Maven Central, pushes the v* and sdk/v*
tags, and triggers the SDK documentation update.