Skip to content

Commit

Permalink
Merge branch 'main' into md/implement-retry-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDordoy committed Sep 1, 2023
2 parents 0eda1df + 1e65f1b commit 36fcc75
Show file tree
Hide file tree
Showing 726 changed files with 20,442 additions and 6,431 deletions.
3 changes: 3 additions & 0 deletions .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

bug:
- 'panic:'
crash:
Expand Down
3 changes: 3 additions & 0 deletions .github/labeler-pull-request-triage.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

dependencies:
- go.mod
- go.sum
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/acctest-oidc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
needs: [oidc-check]
if: needs.oidc-check.outputs.available == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: .go-version
- run: bash scripts/gogetcookie.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/depscheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
depscheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: .go-version
- run: bash scripts/gogetcookie.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
docs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: .go-version
- run: bash scripts/gogetcookie.sh
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
golint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: .go-version
- uses: golangci/golangci-lint-action@v3
- uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
with:
version: 'v1.50.1'
args: -v
6 changes: 3 additions & 3 deletions .github/workflows/issue-comment-created.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
issue_comment_triage:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-remove-labels@v1
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
labels: stale
- uses: actions-ecosystem/action-remove-labels@v1
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
if: ${{ !github.event.issue.pull_request }}
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
labels: waiting-response
- uses: actions-ecosystem/action-remove-labels@v1
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0
if: (github.event.issue.pull_request && github.actor == github.event.issue.user.login)
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/issue-opened.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
issue_triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: github/issue-labeler@v2.4
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: github/issue-labeler@98b5412841f6c4b0b3d9c29d53c13fad16bd7de2 # v3.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-issue-triage.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link-milestone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pull-requests: write
issues: write
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: .go-version
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21 # v4.0.1
with:
github-token: ${{ github.token }}
issue-lock-comment: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/milestone-closed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
Comment:
runs-on: ubuntu-latest
steps:
- uses: bflad/action-milestone-comment@v1
- uses: bflad/action-milestone-comment@ae6c9fdf5778064d4e09b4632604a16b7289096c # v1.0.2
with:
body: |
This functionality has been released in [${{ github.event.milestone.title }} of the Terraform Provider](https://github.com/${{ github.repository }}/blob/${{ github.event.milestone.title }}/CHANGELOG.md). Please see the [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#provider-versions) or reach out if you need any assistance upgrading.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0
with:
configuration-path: .github/labeler-pull-request-triage.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: CodelyTV/pr-size-labeler@v1
- uses: CodelyTV/pr-size-labeler@54ef36785e9f4cb5ecf1949cfc9b00dbb621d761 # v1.8.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
release-notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0

- name: Generate Release Notes
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: release-notes
path: release-notes.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/teamcity-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
teamcity-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
distribution: zulu
java-version: 11
java-version: 17
java-package: jdk
- uses: actions/cache@v3
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tflint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ concurrency:
jobs:
tflint:
runs-on: ubuntu-latest
if: false # skip until https://github.com/bflad/tfproviderlint/issues/255 is fixed
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/thirty-two-bit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
compatibility-32bit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
test:
runs-on: [custom, linux, large]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
website-lint:
runs-on: [custom, linux, large]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

run:
deadline: 30m10s
modules-download-mode: vendor
Expand Down
5 changes: 4 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

archives:
- files:
# Ensure only built binary is archived
Expand Down Expand Up @@ -32,7 +35,7 @@ builds:
- goarch: arm64
goos: windows
ldflags:
- -s -w -X main.Version={{.Version}}
- -s -w -X github.com/hashicorp/terraform-provider-azuread/version.ProviderVersion={{.Version}}
mod_timestamp: '{{ .CommitTimestamp }}'
checksum:
algorithm: sha256
Expand Down
3 changes: 3 additions & 0 deletions .release/release-metadata.hcl
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

url_source_repository = "https://github.com/hashicorp/terraform-provider-azuread"
url_license = "https://github.com/hashicorp/terraform-provider-azuread/blob/main/LICENSE"
10 changes: 8 additions & 2 deletions .teamcity/components/build_azure.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.ParametrizedWithType
/*
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import jetbrains.buildServer.configs.kotlin.ParametrizedWithType

class ClientConfiguration(var clientId: String,
var clientSecret: String,
val tenantId : String) {
val tenantId : String,
val vcsRootId : String) {
}

class LocationConfiguration(var primary : String, var secondary : String, var ternary : String, var rotate : Boolean) {
Expand Down
13 changes: 9 additions & 4 deletions .teamcity/components/build_components.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.GolangFeature
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.ScriptBuildStep
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule
/*
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.buildFeatures.GolangFeature
import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
import jetbrains.buildServer.configs.kotlin.triggers.schedule

// NOTE: in time this could be pulled out into a separate Kotlin package

Expand Down
12 changes: 9 additions & 3 deletions .teamcity/components/build_config_pull_request.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.*
/*
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

class pullRequest(displayName: String, environment: String) {
import jetbrains.buildServer.configs.kotlin.*

class pullRequest(displayName: String, environment: String, vcsRootId : String) {
val displayName = displayName
val environment = environment
val vcsRootId = vcsRootId

fun buildConfiguration(providerName : String) : BuildType {
return BuildType {
Expand All @@ -12,7 +18,7 @@ class pullRequest(displayName: String, environment: String) {
name = displayName

vcs {
root(providerRepository)
root(rootId = AbsoluteId(vcsRootId))
cleanCheckout = true
}

Expand Down
12 changes: 9 additions & 3 deletions .teamcity/components/build_config_service.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.*
/*
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

class serviceDetails(name: String, displayName: String, environment: String) {
import jetbrains.buildServer.configs.kotlin.*

class serviceDetails(name: String, displayName: String, environment: String, vcsRootId : String) {
val packageName = name
val displayName = displayName
val environment = environment
val vcsRootId = vcsRootId

fun buildConfiguration(providerName : String, nightlyTestsEnabled: Boolean, startHour: Int, parallelism: Int) : BuildType {
return BuildType {
Expand All @@ -13,7 +19,7 @@ class serviceDetails(name: String, displayName: String, environment: String) {
name = "%s - Acceptance Tests".format(displayName)

vcs {
root(providerRepository)
root(rootId = AbsoluteId(vcsRootId))
cleanCheckout = true
}

Expand Down
27 changes: 16 additions & 11 deletions .teamcity/components/project.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
/*
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.Project

const val providerName = "azuread"

Expand All @@ -12,20 +17,20 @@ var services = mapOf(
"directoryroles" to "Directory Roles",
"domains" to "Domains",
"groups" to "Groups",
"identitygovernance" to "Identity Governance",
"invitations" to "Invitations",
"policies" to "Policies",
"serviceprincipals" to "Service Principals",
"userflows" to "User Flows",
"users" to "Users"
)

fun AzureAD(environment: String, configuration : ClientConfiguration) : Project {
fun AzureAD(environment: String, config : ClientConfiguration) : Project {
return Project{
vcsRoot(providerRepository)

var pullRequestBuildConfig = pullRequestBuildConfiguration(environment, configuration)
var pullRequestBuildConfig = pullRequestBuildConfiguration(environment, config)
buildType(pullRequestBuildConfig)

var buildConfigs = buildConfigurationsForServices(services, providerName, environment, configuration)
var buildConfigs = buildConfigurationsForServices(services, providerName, environment, config)
buildConfigs.forEach { buildConfiguration ->
buildType(buildConfiguration)
}
Expand All @@ -41,7 +46,7 @@ fun buildConfigurationsForServices(services: Map<String, String>, providerName :
var testConfig = testConfiguration(defaultParallelism, defaultStartHour)
var runNightly = runNightly.getOrDefault(environment, false)

var service = serviceDetails(serviceName, displayName, environment)
var service = serviceDetails(serviceName, displayName, environment, config.vcsRootId)
var buildConfig = service.buildConfiguration(providerName, runNightly, testConfig.startHour, testConfig.parallelism)

buildConfig.params.ConfigureAzureSpecificTestParameters(environment, config, locationsForEnv)
Expand All @@ -52,11 +57,11 @@ fun buildConfigurationsForServices(services: Map<String, String>, providerName :
return list
}

fun pullRequestBuildConfiguration(environment: String, configuration: ClientConfiguration) : BuildType {
fun pullRequestBuildConfiguration(environment: String, config: ClientConfiguration) : BuildType {
var locationsForEnv = locations.get(environment)!!
var pullRequest = pullRequest("! Run Pull Request", environment)
var pullRequest = pullRequest("! Run Pull Request", environment, config.vcsRootId)
var buildConfiguration = pullRequest.buildConfiguration(providerName)
buildConfiguration.params.ConfigureAzureSpecificTestParameters(environment, configuration, locationsForEnv)
buildConfiguration.params.ConfigureAzureSpecificTestParameters(environment, config, locationsForEnv)
return buildConfiguration
}

Expand Down
Loading

0 comments on commit 36fcc75

Please sign in to comment.