From 16c8136320bb30b8a41607dd14fd71d4813e4b00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 11:15:07 +0000 Subject: [PATCH 1/3] Bump github.com/hashicorp/go-slug from 0.7.0 to 0.8.0 Bumps [github.com/hashicorp/go-slug](https://github.com/hashicorp/go-slug) from 0.7.0 to 0.8.0. - [Release notes](https://github.com/hashicorp/go-slug/releases) - [Commits](https://github.com/hashicorp/go-slug/compare/v0.7.0...v0.8.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-slug dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0ab3f2133..bbf31bdf8 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/google/go-querystring v1.1.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-retryablehttp v0.7.0 - github.com/hashicorp/go-slug v0.7.0 + github.com/hashicorp/go-slug v0.8.0 github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index 7cd076766..2918378f2 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-slug v0.7.0 h1:8HIi6oreWPtnhpYd8lIGQBgp4rXzDWQTOhfILZm+nok= -github.com/hashicorp/go-slug v0.7.0/go.mod h1:Ib+IWBYfEfJGI1ZyXMGNbu2BU+aa3Dzu41RKLH301v4= +github.com/hashicorp/go-slug v0.8.0 h1:h7AGtXVAI/cJ/Wwa/JQQaftQnWQmZbAzkzgZeZVVmLw= +github.com/hashicorp/go-slug v0.8.0/go.mod h1:Ib+IWBYfEfJGI1ZyXMGNbu2BU+aa3Dzu41RKLH301v4= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d h1:9ARUJJ1VVynB176G1HCwleORqCaXm/Vx0uUi0dL26I0= From 28bb3d7f563cf6b080a65feaf9dffe2d753630dc Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 3 Mar 2022 10:43:00 -0700 Subject: [PATCH 2/3] adds local linting to CONTRIBUTING.md --- CONTRIBUTING.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 910bc3fa7..0ba6b0102 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,15 +2,28 @@ If you find an issue with this package, please create an issue in GitHub. If you'd like, we welcome any contributions. Fork this repository and submit a pull request. +## Running the Linters Locally + +1. Ensure you have have [installed golangci-lint](https://golangci-lint.run/usage/install/#local-installation) +2. From the CLI, run `golangci-lint run` + ## Writing Tests -The test suite contains many acceptance tests that are run against the latest version of Terraform Enterprise. You can read more about running the tests against your own Terraform Enterprise environment in [TESTS.md](TESTS.md). Our CI system (Circle) will not test your fork unless you are an authorized employee, so a HashiCorp maintainer will initiate the tests or you and report any missing tests or simple problems. In order to speed up this process, it's not uncommon for your commits to be incorportated into another PR that we can commit test changes to. +The test suite contains many acceptance tests that are run against the latest version of Terraform Enterprise. You can read more about running the tests against your own Terraform Enterprise environment in [TESTS.md](TESTS.md). Our CI system (Circle) will not test your fork unless you are an authorized employee, so a HashiCorp maintainer will initiate the tests or you and report any missing tests or simple problems. In order to speed up this process, it's not uncommon for your commits to be incorporated into another PR that we can commit test changes to. ## Editor Settings We've included VSCode settings to assist with configuring the go extension. For other editors that integrate with the [Go Language Server](https://github.com/golang/tools/tree/master/gopls), the main thing to do is to add the `integration` build tags so that the test files are found by the language server. See `.vscode/settings.json` for more details. -## Adding a new Endpoint +## Generating Mocks + +You'll need to generate mocks if an existing endpoint method is modified or a new method is added. To generate mocks, simply run `./generate_mocks.sh` If you're adding a new API resource to go-tfe, you'll need to add the command to `generate_mocks.sh`. For example if someone creates `example_resource.go`, you'll add: + +``` +mockgen -source=example_resource.go -destination=mocks/example_resource_mocks.go -package=mocks +``` + +## Adding a New Endpoint Here you will find a scaffold to get you started when building a json:api RESTful endpoint. The comments are meant to guide you but should be replaced with endpoint-specific and type-specific documentation. Additionally, you'll need to add an integration test that covers each method of the main interface. From 9e1ede66434400a6725645fa5e741d0170f1e32d Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Thu, 3 Mar 2022 11:52:17 -0700 Subject: [PATCH 3/3] empty commit