Skip to content

Commit

Permalink
Ensure vendor directory is up-to-date as part of CI (microsoft#343)
Browse files Browse the repository at this point in the history
* Adding vendor checks to CI

* Docs update

* More changes to PR template
  • Loading branch information
Nicholas M. Iodice authored May 28, 2020
1 parent 376fd7c commit 9f638a9
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 27 deletions.
10 changes: 8 additions & 2 deletions .azdo/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ jobs:
make tools
displayName: 'Install Dependencies'
- bash: |
#!/usr/bin/env bash
cd "$BUILD_SOURCESDIRECTORY"
make check-vendor-vs-mod
displayName: 'Verify Vendored Dependencies'
- bash: |
#!/usr/bin/env bash
cd "$BUILD_SOURCESDIRECTORY"
Expand All @@ -55,7 +61,7 @@ jobs:
#!/usr/bin/env bash
cd "$BUILD_SOURCESDIRECTORY"
make testacc
displayName: 'Run Acceptance Tests'
displayName: 'Run All Tests'
env:
AZDO_ORG_SERVICE_URL: $(ACC_TEST_AZDO_ORG_URL)
AZDO_PERSONAL_ACCESS_TOKEN: $(ACC_TEST_AZDO_PAT)
Expand All @@ -72,4 +78,4 @@ jobs:
fi
env:
GO_VERSION: $(goVersion)
displayName: 'Run Build Script in Docker'
displayName: 'Run Devcontainer Build'
43 changes: 21 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
## All Submissions:
-------------------------------------
* [YES/NO] Have you added an explanation of what your changes do and why you'd like us to include them?
* [YES/NO] I have updated the documentation accordingly.
* [YES/NO/NA] I have added tests to cover my changes.
* [YES/NO/NA] All new and existing tests passed.
* [YES/NO/NA] My code follows the code style of this project.
* [YES/NO/NA] I ran lint checks locally prior to submission.
* [YES/NO] Have you checked to ensure there aren't other open PRs for the same update/change?

## What is the current behavior?
-------------------------------------

* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] I have updated the documentation accordingly.
* [ ] I have added tests to cover my changes.
* [ ] All new and existing tests passed.
* [ ] My code follows the code style of this project.
* [ ] I ran lint checks locally prior to submission.
* [ ] Have you checked to ensure there aren't other open PRs for the same update/change?

## What about the current behavior has changed?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A
Issue Number:

## Does this introduce a change to `go.mod`, `go.sum` or `vendor/`?

## What is the new behavior?
-------------------------------------
<!-- Please describe the behavior or changes that are being added by this PR. -->
- [ ] Yes
- [ ] No

-
-
-
<!-- If this introduces a change to these files, please elaborate on why -->

## Does this introduce a breaking change?
-------------------------------------
- [YES/NO]

- [ ] Yes
- [ ] No

<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->

## Any relevant logs, error output, etc?
-------------------------------------

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)


## Other information
-------------------------------------

<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
10 changes: 9 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tools:
GO111MODULE=off go get -u github.com/bflad/tfproviderdocs
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$GOPATH/bin v1.27.0

build: fmtcheck
build: fmtcheck check-vendor-vs-mod
go install

fmt:
Expand Down Expand Up @@ -50,6 +50,14 @@ test-compile:
fi
go test -c $(TEST) $(TESTARGS)

check-vendor-vs-mod: ## Check that go modules and vendored code are on par
@echo "==> Checking that go modules and vendored dependencies match..."
go mod vendor
@if [[ `git status --porcelain vendor` ]]; then \
echo "ERROR: vendor dir is not on par with go modules definition." && \
exit 1; \
fi

vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
Expand Down
24 changes: 22 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@
- [0. (Optional) Docker](#0-optional-docker)
- [1. Install dependencies](#1-install-dependencies)
- [2. Clone repository](#2-clone-repository)
- [Note for Go 1.13](#note-for-go-113)
- [Setup your workspace](#setup-your-workspace)
- [Note for Go 1.13](#note-for-go-113)
- [Setup your workspace](#setup-your-workspace)
- [3. Build & Install Provider](#3-build--install-provider)
- [4. Run provider locally](#4-run-provider-locally)
- [Development SDLC](#development-sdlc)
- [1. Pick an issue](#1-pick-an-issue)
- [2. Repository Structure](#2-repository-structure)
- [3. Code for Terraform](#3-code-for-terraform)
- [Don't use Sleep](#dont-use-sleep)
- [Visual Studio Code snippets](#visual-studio-code-snippets)
- [4. Test changes](#4-test-changes)
- [5. Debug changes](#5-debug-changes)
- [6. Document changes](#6-document-changes)
- [7. Explore with postman](#7-explore-with-postman)
- [8. Post a PR](#8-post-a-pr)
- [Tips for PR authors](#tips-for-pr-authors)
- [Tips for PR reviewers](#tips-for-pr-reviewers)
- [Contributing back](#contributing-back)
- [8. Creating a release](#8-creating-a-release)
- [Note about CLA](#note-about-cla)

This document is intended to be an introduction to contributing to the `terraform-provider-azuredevops` project. Links to background information about the project and general guidance on Terraform providers are included below:
Expand Down Expand Up @@ -449,6 +454,21 @@ Most changes should involve updates to the client-facing reference documentation

Azure DevOps has a rich set of [REST API's](https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.1) available for integrating with Terraform. A convenient way to explore the APIs is through [postman](https://www.getpostman.com/). Once you have postman installed, you can clone/fork this [repo](https://github.com/rguthriemsft/azuredevops-postman-collections) and follow the instructions in the README to setup postman to be able to explore a large set of the rest API's. A second resource that is very helpful in understanding how to call/use the apis is the Azure DevOps Cli extension found [here](https://github.com/Azure/azure-devops-cli-extension).

## 8. Post a PR

After the feature or bug is completed, you'll want to post a PR to get it reviewed by somebody in the core development team. Here are some useful tips to keep in mind:

### Tips for PR authors

- The steps run by the CI are located [here](./../.azdo/ci.yml). You should manually execute these commands to make sure that they pass before you post your PR.
- The PR template for the repository is located [here](../.github/PULL_REQUEST_TEMPLATE.md). Please be ready to fill this template out when posting the PR.
- If your PR is a draft, please mark it as a draft and put `WIP` (stands for "Work In Progress") in the title. This helps reviewers prioritize which reviews to look at.
- If your PR contains changes to the `go.mod` or `go.sum` files, or the `vendor/` directory, please elaborate on why the change is being made.

### Tips for PR reviewers

- If a PR contains changes to the `go.mod` or `go.sum` files, or the `vendor/` directory, carefully understand them and make sure that these changes are (1) minimal and (2) necessary. This helps the stability of the product over time. Dependency upgrades to get off of old, deprecated or unsupported libraries should be done in isolated PRs, if possible.

### Contributing back

If you find an api is missing from the postman collection, please submit a PR. We intend make the collection as complete as possible over time.
Expand Down

0 comments on commit 9f638a9

Please sign in to comment.