We appreciate your interest in contributing to the pulumi-pgedge project! This document provides guidelines and instructions for contributing to this repository.
Before you begin, ensure you have the following tools installed:
- Pulumi CLI
- Go (version 1.18 or later)
- pulumictl
- golangci-lint
- Node.js (Active LTS or maintenance version, we recommend using nvm to manage Node.js installations)
- Yarn
- TypeScript
- Python (Python 3)
- .NET SDK
-
Fork the repository and clone your fork:
git clone https://github.com/pgEdge/pulumi-pgedge.git cd pulumi-pgedge
-
Add the upstream repository as a remote:
git remote add upstream https://github.com/pgEdge/pulumi-pgedge.git
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name
To migrate to a newer Terraform version:
-
Update the pgedge Terraform provider in the
provider/shim
directory:cd provider/shim go get -u github.com/pgEdge/terraform-provider-pgedge go mod tidy go build
-
Change to the
provider
directory and update dependencies:cd ../ go mod tidy go build
-
Generate schemas, binaries, and SDKs:
make tfgen make build
If you need to test with a modified version of the Terraform provider, you have two options:
-
In your
provider/shim/go.mod
file, add areplace
directive to use your local version of the Terraform provider:replace github.com/pgEdge/terraform-provider-pgedge => /path/to/your/local/terraform-provider-pgedge
Replace
/path/to/your/local/terraform-provider-pgedge
with the actual path to your local copy of the Terraform provider.
If you've pushed your changes to a branch on GitHub and want to test with that branch:
-
Navigate to the
provider/shim
directory:cd provider/shim
-
Use the
go get
command to fetch the specific branch:go get github.com/pgEdge/terraform-provider-pgedge@<branch-name>
Replace
<branch-name>
with the name of your branch.
For both options, after making the changes:
-
Run
go mod tidy
to ensure thego.mod
file is updated and consistent:go mod tidy
-
Navigate back to the root of the project and rebuild the provider:
cd ../../ make build
-
Test your changes as described in the "Testing Your Changes" section below.
Remember to revert any changes to the go.mod
file before committing, unless they're specifically required for the project.
-
Set your
PATH
to include the/bin
directory of the codebase for the current terminal session:export PATH=$PATH:/path/to/pulumi-pgedge/bin
-
Test the examples:
For TypeScript:
cd examples/typescript yarn install yarn link "@pgEdge/pulumi-pgedge" # Make changes to index.ts pulumi up
For Go:
cd examples/go # Add this line to go.mod: # replace github.com/pgEdge/pulumi-pgedge/sdk => ../../sdk pulumi up
Note: If you encounter errors, try copying the binary to your GOPATH:
cp bin/pulumi-resource-pgedge $GOPATH/bin
-
Commit your changes with a clear and descriptive commit message:
git commit -am "Add feature: your feature description"
-
Push your changes to your fork:
git push origin feature/your-feature-name
-
Create a pull request from your fork to the main repository.
-
Wait for the maintainers to review your pull request. They may ask for changes or clarifications.
- Follow the existing code style in the project.
- Write clear, concise, and well-documented code.
- Include unit tests for new features or bug fixes.
- Update documentation as necessary.
If you find a bug or have a suggestion for improvement:
- Check if the issue already exists in the GitHub Issues.
- If not, create a new issue, providing as much detail as possible.
If you need help or have questions, feel free to:
- Open an issue for discussion
- Reach out to the maintainers
Thank you for contributing to pulumi-pgedge!