We welcome and appreciate contributions from the community! This document outlines the process for contributing to the pgEdge Terraform Provider project.
- Prerequisites
- Setting Up Your Development Environment
- Making Changes
- Running Tests
- Submitting a Pull Request
- Code Style and Guidelines
Before you begin, ensure you have the following tools installed:
- Go (version 1.20 or later)
- Terraform CLI
- Python 3
- Swagger Go
- golangci-lint
-
Fork the repository on GitHub.
-
Clone your fork locally:
git clone https://github.com/pgEdge/terraform-provider-pgedge.git cd terraform-provider-pgedge
-
Install Dependencies:
make setup
-
Create a
.terraformrc
file in your home directory and copy the contents fromexample.terraformrc
:cp example.terraformrc ~/.terraformrc
-
Set the required environment variables:
export PGEDGE_BASE_URL="https://api.pgedge.com" export PGEDGE_CLIENT_ID="your-client-id" export PGEDGE_CLIENT_SECRET="your-client-secret" export PGEDGE_ROLE_ARN="your-role-arn" # optional. For running Tests only.
-
Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes to the code.
-
After making changes, it's crucial to build the provider for the changes to take effect:
go install .
Note: Remember to run this command every time you make changes to ensure they are reflected in the provider.
-
Run the linter to ensure code quality:
make lint
-
Update or add tests as necessary.
-
Update documentation if you've made changes to the provider's functionality.
Remember, the go install .
step is essential for your changes to be reflected in the provider. Always run this command after making modifications to see the effects of your changes.
To run the acceptance tests:
make test
Note: Running acceptance tests will create real resources in your pgEdge account.
-
Push your changes to your fork:
git push origin feature/your-feature-name
-
Go to the original repository on GitHub and create a new pull request.
-
Ensure your PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
-
Wait for the maintainers to review your PR. Make any requested changes.
- We use terraform-plugin-framework for this provider. Familiarize yourself with its conventions and best practices.
- Follow Go best practices and conventions.
- Write clear, concise commit messages.
- Keep your changes focused. If you're addressing multiple issues, consider creating separate PRs.
- Add or update tests to cover your changes.
- Update documentation, including the README if necessary.
Thank you for contributing to the pgEdge Terraform Provider!