2017-01-20 16:59:14 +01:00
|
|
|
# How to contribute
|
|
|
|
|
command: Unmanaged providers
This adds supports for "unmanaged" providers, or providers with process
lifecycles not controlled by Terraform. These providers are assumed to
be started before Terraform is launched, and are assumed to shut
themselves down after Terraform has finished running.
To do this, we must update the go-plugin dependency to v1.3.0, which
added support for the "test mode" plugin serving that powers all this.
As a side-effect of not needing to manage the process lifecycle anymore,
Terraform also no longer needs to worry about the provider's binary, as
it won't be used for anything anymore. Because of this, we can disable
the init behavior that concerns itself with downloading that provider's
binary, checking its version, and otherwise managing the binary.
This is all managed on a per-provider basis, so managed providers that
Terraform downloads, starts, and stops can be used in the same commands
as unmanaged providers. The TF_REATTACH_PROVIDERS environment variable
is added, and is a JSON encoding of the provider's address to the
information we need to connect to it.
This change enables two benefits: first, delve and other debuggers can
now be attached to provider server processes, and Terraform can connect.
This allows for attaching debuggers to provider processes, which before
was difficult to impossible. Second, it allows the SDK test framework to
host the provider in the same process as the test driver, while running
a production Terraform binary against the provider. This allows for Go's
built-in race detector and test coverage tooling to work as expected in
provider tests.
Unmanaged providers are expected to work in the exact same way as
managed providers, with one caveat: Terraform kills provider processes
and restarts them once per graph walk, meaning multiple times during
most Terraform CLI commands. As unmanaged providers can't be killed by
Terraform, and have no visibility into graph walks, unmanaged providers
are likely to have differences in how their global mutable state behaves
when compared to managed providers. Namely, unmanaged providers are
likely to retain global state when managed providers would have reset
it. Developers relying on global state should be aware of this.
2020-05-27 02:48:57 +02:00
|
|
|
We definitely welcome your patches and contributions to gRPC! Please read the gRPC
|
|
|
|
organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md)
|
|
|
|
and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding.
|
2017-01-20 16:59:14 +01:00
|
|
|
|
2017-08-11 19:19:46 +02:00
|
|
|
If you are new to github, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/)
|
2017-01-20 16:59:14 +01:00
|
|
|
|
|
|
|
## Legal requirements
|
|
|
|
|
|
|
|
In order to protect both you and ourselves, you will need to sign the
|
2018-09-24 18:30:39 +02:00
|
|
|
[Contributor License Agreement](https://identity.linuxfoundation.org/projects/cncf).
|
2017-01-20 16:59:14 +01:00
|
|
|
|
2017-08-11 19:19:46 +02:00
|
|
|
## Guidelines for Pull Requests
|
|
|
|
How to get your contributions merged smoothly and quickly.
|
2019-09-09 14:04:58 +02:00
|
|
|
|
|
|
|
- Create **small PRs** that are narrowly focused on **addressing a single
|
|
|
|
concern**. We often times receive PRs that are trying to fix several things at
|
|
|
|
a time, but only one fix is considered acceptable, nothing gets merged and
|
|
|
|
both author's & review's time is wasted. Create more PRs to address different
|
|
|
|
concerns and everyone will be happy.
|
|
|
|
|
|
|
|
- The grpc package should only depend on standard Go packages and a small number
|
|
|
|
of exceptions. If your contribution introduces new dependencies which are NOT
|
|
|
|
in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a
|
|
|
|
discussion with gRPC-Go authors and consultants.
|
|
|
|
|
|
|
|
- For speculative changes, consider opening an issue and discussing it first. If
|
|
|
|
you are suggesting a behavioral or API change, consider starting with a [gRFC
|
|
|
|
proposal](https://github.com/grpc/proposal).
|
|
|
|
|
|
|
|
- Provide a good **PR description** as a record of **what** change is being made
|
|
|
|
and **why** it was made. Link to a github issue if it exists.
|
|
|
|
|
|
|
|
- Don't fix code style and formatting unless you are already changing that line
|
|
|
|
to address an issue. PRs with irrelevant changes won't be merged. If you do
|
|
|
|
want to fix formatting or style, do that in a separate PR.
|
|
|
|
|
|
|
|
- Unless your PR is trivial, you should expect there will be reviewer comments
|
|
|
|
that you'll need to address before merging. We expect you to be reasonably
|
|
|
|
responsive to those comments, otherwise the PR will be closed after 2-3 weeks
|
|
|
|
of inactivity.
|
|
|
|
|
|
|
|
- Maintain **clean commit history** and use **meaningful commit messages**. PRs
|
|
|
|
with messy commit history are difficult to review and won't be merged. Use
|
|
|
|
`rebase -i upstream/master` to curate your commit history and/or to bring in
|
|
|
|
latest changes from master (but avoid rebasing in the middle of a code
|
|
|
|
review).
|
|
|
|
|
|
|
|
- Keep your PR up to date with upstream/master (if there are merge conflicts, we
|
|
|
|
can't really merge your change).
|
|
|
|
|
|
|
|
- **All tests need to be passing** before your change can be merged. We
|
|
|
|
recommend you **run tests locally** before creating your PR to catch breakages
|
|
|
|
early on.
|
2018-09-24 18:30:39 +02:00
|
|
|
- `make all` to test everything, OR
|
|
|
|
- `make vet` to catch vet errors
|
|
|
|
- `make test` to run the tests
|
|
|
|
- `make testrace` to run tests in race mode
|
2019-07-30 00:19:40 +02:00
|
|
|
- optional `make testappengine` to run tests with appengine
|
2017-08-11 19:19:46 +02:00
|
|
|
|
|
|
|
- Exceptions to the rules can be made if there's a compelling reason for doing so.
|