Skip to content

Latest commit

 

History

History
153 lines (93 loc) · 5.25 KB

CONTRIBUTING.md

File metadata and controls

153 lines (93 loc) · 5.25 KB

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Areas of contribution

Contributions are welcome across the entire project:

  • Code
  • Documentation
  • Testing
  • Packaging/distribution

Contributing workflow

New Contributors

  1. Search the issues to see if there is an existing issue. If not, please open one.

  2. Fork the repository to your personal namespace (only needed to do this once).

  3. Clone the repo from your personal namespace.

    git clone https://github.com/{username}/terraform-google-vmseries-modules.git Ensure that {username} is your user name.

  4. Add the source repository as an upsteam.

    git remote add upstream https://github.com/PaloAltoNetworks/terraform-google-vmseries-modules.git

  5. Create a branch which corresponds to the issue ID created in step 1.

    For example, if the issue ID is 101: git checkout -b 101-updating-wildfire-templates

  6. Make the desired changes and commit to your local repository.

  7. Run the pre-commit script. See the tools section for more information. NOTE If making changes that will update the Terraform docs, this will need to be run twice.

  8. Push changes to your repository

    git push origin/101-updating-wildfire-templates

  9. Rebase with the upstream to resolve any potential conflicts.

    git rebase upstream dev

  10. Open a Pull Request and link it to the issue (reference the issue, i.e. "fixes #233")

  11. Once the PR has been merged, delete your local branch

    git branch -D 101-updating-wildfire-templates

Existing Contributors

  1. Search the issues to see if there is an existing issue. If not, open an issue (note the issue ID).

  2. Update from the source repository.

    git pull upstream dev

  3. Create a branch which corresponds to the issue ID created in step 1.

    For example, if the issue ID is 101: git checkout -b 101-updating-wildfire-templates

  4. Make any changes, and ensure the commit messages are clear and consistent (reference the issue ID and type of change in all commit messages)

  5. Document the changes (update the README and any other relevant documents)

  6. Run the pre-commit script. See the tools section for more information. NOTE If making changes that will update the Terraform docs, this will need to be run twice.

  7. Push changes to your repository

    git push origin/101-updating-wildfire-templates

  8. Rebase with the upstream to resolve any potential conflicts.

    git rebase upstream dev

  9. Open a Pull Request and link it to the issue (reference the issue, i.e. "fixes #233")

  10. Once the PR has been merged, delete your local branch

    git branch -D 101-updating-wildfire-templates

Tools

Any serious changes, especially any changes of variables or providers, require the pre-commit tool. Install the recommended versions:

  • pre-commit 2.9.3 - installation instruction (a Python3 package)
  • terraform-docs 0.12.1 - download the binary from GitHub releases
  • tflint 0.20.2 - download the binary from GitHub releases
  • coreutils - required only on macOS (due to use of realpath), simply execute brew install coreutils

For more details and a Docker-compatible alternative see the official guide of the author of pre-commit-terraform, Anton Babenko.

For these Contributors who prefer not to use the recommended git hooks, the command to fully update the auto-generated README files and to run formatters/tests:

pre-commit run -a

This command does not commit/add/push any changes to Git. It only changes local files.

The first time pre-commit is run, it is possible to show "FAILED" if any docs were updated. This is expected behavior. Simply run pre-commit again and it should pass. Once all pre-commit tests pass, make another commit to check in those changes and push.

Coding Standards

Please follow the Terraform conventions.

Publish a new release (for maintainers)

Test the release process

Testing the workflow requires node, npm, and semantic-release to be installed locally:

npm install -g semantic-release@^17.1.1 @semantic-release/git@^9.0.0 @semantic-release/exec@^5.0.0 conventional-changelog-conventionalcommits@^4.4.0

Run semantic-release on develop:

semantic-release --dry-run --no-ci --branches=develop

Verify in the output that the next version is set correctly, and the release notes are generated correctly.

Merge develop to master and push

git checkout master
git merge develop
git push origin master

At this point, GitHub Actions builds and tags the release.

Merge master to develop and push

Now, sync develop to master to add any commits made by the release bot.

git fetch --all --tags
git pull origin master
git checkout develop
git merge master
git push origin develop