Skip to content

Commit

Permalink
Merge branch 'main' into renovate/github.com-hashicorp-go-cty-digest
Browse files Browse the repository at this point in the history
  • Loading branch information
nieomylnieja authored Feb 16, 2024
2 parents 194245e + 975ba7f commit 96a37f7
Show file tree
Hide file tree
Showing 25 changed files with 323 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ while IFS= read -r line; do
continue
fi
commit_msg="${BASH_REMATCH[1]}"
commit_body=$(git log --grep "$commit_msg" -n1 --pretty="%b")
commit_body=$(git log -F --grep "$commit_msg" -n1 --pretty="%b")

add_notes() {
local notes="$1"
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/acc-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Acceptance tests
on:
workflow_call:
inputs:
clientId:
description: Client ID to use for authentication
required: true
type: string
oktaOrgUrl:
description: Okta organization URL
required: false
type: string
oktaAuthServer:
description: Okta authentication server identifier
required: false
type: string
project:
description: Project name to create the tested objects in
required: false
type: string
secrets:
clientSecret:
description: Client secret to use for authentication
required: true
jobs:
test:
name: Run acceptance tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
repository: nobl9/terraform-provider-nobl9
ref: main
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Run acceptance tests
env:
NOBL9_CLIENT_ID: "${{ inputs.clientId }}"
NOBL9_CLIENT_SECRET: "${{ secrets.clientSecret }}"
TERRAFORM_NOBL9_OKTA_ORG_URL: "${{ inputs.oktaOrgUrl }}"
TERRAFORM_NOBL9_OKTA_AUTH_SERVER: "${{ inputs.oktaAuthServer }}"
TERRAFORM_NOBL9_PROJECT: "${{ inputs.project }}"
run: make test/acc
2 changes: 1 addition & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
pull_request:
types: [opened, reopened, edited]
types: [opened, reopened, edited, synchronize]
merge_group:
name: pr-title
jobs:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release candidate
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
jobs:
test:
uses: ./.github/workflows/acc-tests.yml
with:
clientId: "${{ vars.TERRAFORM_NOBL9_CLIENT_ID }}"
project: "${{ vars.TERRAFORM_NOBL9_PROJECT }}"
secrets:
clientSecret: "${{ secrets.TERRAFORM_NOBL9_CLIENT_SECRET }}"
14 changes: 12 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
name: Release
on:
push:
tags:
- "v*"
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta"
- "v[0-9]+.[0-9]+.[0-9]+-alpha"
jobs:
test:
uses: ./.github/workflows/acc-tests.yml
with:
clientId: "${{ vars.TERRAFORM_NOBL9_CLIENT_ID }}"
project: "${{ vars.TERRAFORM_NOBL9_PROJECT }}"
secrets:
clientSecret: "${{ secrets.TERRAFORM_NOBL9_CLIENT_SECRET }}"
goreleaser:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Unit tests
on:
push:
branches:
Expand All @@ -18,4 +18,4 @@ jobs:
go-version-file: go.mod
cache: false
- name: Run unit tests
run: make test
run: make test/unit
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ NAMESPACE=nobl9
NAME=nobl9
BIN_DIR=./bin
BINARY=$(BIN_DIR)/terraform-provider-$(NAME)
VERSION=0.23.0-beta
VERSION=0.23.0
BUILD_FLAGS="-X github.com/nobl9/terraform-provider-nobl9/nobl9.Version=$(VERSION)"
OS_ARCH?=linux_amd64

# renovate datasource=github-releases depName=securego/gosec
GOSEC_VERSION := v2.18.2
GOSEC_VERSION := v2.19.0
# renovate datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION := v1.55.2
# renovate datasource=go depName=golang.org/x/vuln/cmd/govulncheck
GOVULNCHECK_VERSION := v1.0.3
GOVULNCHECK_VERSION := v1.0.4
# renovate datasource=go depName=golang.org/x/tools/cmd/goimports
GOIMPORTS_VERSION := v0.17.0
GOIMPORTS_VERSION := v0.18.0
# renovate datasource=github-releases depName=segmentio/golines
GOLINES_VERSION := v0.9.0
GOLINES_VERSION := v0.12.2

# Check if the program is present in $PATH and install otherwise.
# ${1} - oneOf{binary,yarn}
Expand Down Expand Up @@ -53,16 +53,18 @@ install: build
build:
go build -ldflags $(BUILD_FLAGS) -o $(BINARY)

.PHONY: test
.PHONY: test test/unit test/acc
## Run all tests.
test: test/unit test/acc

## Run Go unit tests.
test:
test/unit:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

.PHONY: testacc
## Run acceptance tests.
testacc:
cd nobl9 && TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
## Run Terraform acceptance tests.
test/acc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m nobl9/

.PHONY: release-dry-run
## Run Goreleaser in dry-run mode.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ terraform {
required_providers {
nobl9 = {
source = "nobl9/nobl9"
version = "0.23.0-beta"
version = "0.23.0"
}
}
}
Expand Down
41 changes: 0 additions & 41 deletions codefresh.yml

This file was deleted.

1 change: 1 addition & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ words:
- gopath
- gosec
- govulncheck
- kusto
- ldflags
- logql
- msteams
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ terraform {
required_providers {
nobl9 = {
source = "nobl9/nobl9"
version = "0.23.0-beta"
version = "0.23.0"
}
}
}
Expand Down
88 changes: 68 additions & 20 deletions docs/resources/slo.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,17 @@ Required:

Required:

- `aggregation` (String) Aggregation type
- `data_type` (String) Specifies source: 'metrics' or 'logs'
- `metric_name` (String) Name of the metric
- `resource_id` (String) Name of the added application

Optional:

- `dimensions` (Block Set) Dimensions of the metric (see [below for nested schema](#nestedblock--objective--count_metrics--total--azure_monitor--dimensions))
- `metric_namespace` (String) Namespace of the metric
- `aggregation` (String) Aggregation type [Required for metrics]
- `dimensions` (Block Set) Dimensions of the metric [Optional for metrics] (see [below for nested schema](#nestedblock--objective--count_metrics--total--azure_monitor--dimensions))
- `kql_query` (String) Logs query in Kusto Query Language [Required for logs]
- `metric_name` (String) Name of the metric [Required for metrics]
- `metric_namespace` (String) Namespace of the metric [Optional for metrics]
- `resource_id` (String) Identifier of the Azure Cloud resource [Required for metrics]
- `workspace` (Block Set) Log analytics workspace [Required for logs] (see [below for nested schema](#nestedblock--objective--count_metrics--total--azure_monitor--workspace))

<a id="nestedblock--objective--count_metrics--total--azure_monitor--dimensions"></a>
### Nested Schema for `objective.count_metrics.total.azure_monitor.dimensions`
Expand All @@ -280,6 +282,16 @@ Required:
- `value` (String) Value


<a id="nestedblock--objective--count_metrics--total--azure_monitor--workspace"></a>
### Nested Schema for `objective.count_metrics.total.azure_monitor.workspace`

Required:

- `resource_group` (String) Resource group of the workspace
- `subscription_id` (String) Subscription ID of the workspace
- `workspace_id` (String) ID of the workspace



<a id="nestedblock--objective--count_metrics--total--bigquery"></a>
### Nested Schema for `objective.count_metrics.total.bigquery`
Expand Down Expand Up @@ -598,15 +610,17 @@ Required:

Required:

- `aggregation` (String) Aggregation type
- `data_type` (String) Specifies source: 'metrics' or 'logs'
- `metric_name` (String) Name of the metric
- `resource_id` (String) Name of the added application

Optional:

- `dimensions` (Block Set) Dimensions of the metric (see [below for nested schema](#nestedblock--objective--count_metrics--bad--azure_monitor--dimensions))
- `metric_namespace` (String) Namespace of the metric
- `aggregation` (String) Aggregation type [Required for metrics]
- `dimensions` (Block Set) Dimensions of the metric [Optional for metrics] (see [below for nested schema](#nestedblock--objective--count_metrics--bad--azure_monitor--dimensions))
- `kql_query` (String) Logs query in Kusto Query Language [Required for logs]
- `metric_name` (String) Name of the metric [Required for metrics]
- `metric_namespace` (String) Namespace of the metric [Optional for metrics]
- `resource_id` (String) Identifier of the Azure Cloud resource [Required for metrics]
- `workspace` (Block Set) Log analytics workspace [Required for logs] (see [below for nested schema](#nestedblock--objective--count_metrics--bad--azure_monitor--workspace))

<a id="nestedblock--objective--count_metrics--bad--azure_monitor--dimensions"></a>
### Nested Schema for `objective.count_metrics.bad.azure_monitor.dimensions`
Expand All @@ -617,6 +631,16 @@ Required:
- `value` (String) Value


<a id="nestedblock--objective--count_metrics--bad--azure_monitor--workspace"></a>
### Nested Schema for `objective.count_metrics.bad.azure_monitor.workspace`

Required:

- `resource_group` (String) Resource group of the workspace
- `subscription_id` (String) Subscription ID of the workspace
- `workspace_id` (String) ID of the workspace



<a id="nestedblock--objective--count_metrics--bad--bigquery"></a>
### Nested Schema for `objective.count_metrics.bad.bigquery`
Expand Down Expand Up @@ -935,15 +959,17 @@ Required:

Required:

- `aggregation` (String) Aggregation type
- `data_type` (String) Specifies source: 'metrics' or 'logs'
- `metric_name` (String) Name of the metric
- `resource_id` (String) Name of the added application

Optional:

- `dimensions` (Block Set) Dimensions of the metric (see [below for nested schema](#nestedblock--objective--count_metrics--good--azure_monitor--dimensions))
- `metric_namespace` (String) Namespace of the metric
- `aggregation` (String) Aggregation type [Required for metrics]
- `dimensions` (Block Set) Dimensions of the metric [Optional for metrics] (see [below for nested schema](#nestedblock--objective--count_metrics--good--azure_monitor--dimensions))
- `kql_query` (String) Logs query in Kusto Query Language [Required for logs]
- `metric_name` (String) Name of the metric [Required for metrics]
- `metric_namespace` (String) Namespace of the metric [Optional for metrics]
- `resource_id` (String) Identifier of the Azure Cloud resource [Required for metrics]
- `workspace` (Block Set) Log analytics workspace [Required for logs] (see [below for nested schema](#nestedblock--objective--count_metrics--good--azure_monitor--workspace))

<a id="nestedblock--objective--count_metrics--good--azure_monitor--dimensions"></a>
### Nested Schema for `objective.count_metrics.good.azure_monitor.dimensions`
Expand All @@ -954,6 +980,16 @@ Required:
- `value` (String) Value


<a id="nestedblock--objective--count_metrics--good--azure_monitor--workspace"></a>
### Nested Schema for `objective.count_metrics.good.azure_monitor.workspace`

Required:

- `resource_group` (String) Resource group of the workspace
- `subscription_id` (String) Subscription ID of the workspace
- `workspace_id` (String) ID of the workspace



<a id="nestedblock--objective--count_metrics--good--bigquery"></a>
### Nested Schema for `objective.count_metrics.good.bigquery`
Expand Down Expand Up @@ -1280,15 +1316,17 @@ Required:

Required:

- `aggregation` (String) Aggregation type
- `data_type` (String) Specifies source: 'metrics' or 'logs'
- `metric_name` (String) Name of the metric
- `resource_id` (String) Name of the added application

Optional:

- `dimensions` (Block Set) Dimensions of the metric (see [below for nested schema](#nestedblock--objective--raw_metric--query--azure_monitor--dimensions))
- `metric_namespace` (String) Namespace of the metric
- `aggregation` (String) Aggregation type [Required for metrics]
- `dimensions` (Block Set) Dimensions of the metric [Optional for metrics] (see [below for nested schema](#nestedblock--objective--raw_metric--query--azure_monitor--dimensions))
- `kql_query` (String) Logs query in Kusto Query Language [Required for logs]
- `metric_name` (String) Name of the metric [Required for metrics]
- `metric_namespace` (String) Namespace of the metric [Optional for metrics]
- `resource_id` (String) Identifier of the Azure Cloud resource [Required for metrics]
- `workspace` (Block Set) Log analytics workspace [Required for logs] (see [below for nested schema](#nestedblock--objective--raw_metric--query--azure_monitor--workspace))

<a id="nestedblock--objective--raw_metric--query--azure_monitor--dimensions"></a>
### Nested Schema for `objective.raw_metric.query.azure_monitor.dimensions`
Expand All @@ -1299,6 +1337,16 @@ Required:
- `value` (String) Value


<a id="nestedblock--objective--raw_metric--query--azure_monitor--workspace"></a>
### Nested Schema for `objective.raw_metric.query.azure_monitor.workspace`

Required:

- `resource_group` (String) Resource group of the workspace
- `subscription_id` (String) Subscription ID of the workspace
- `workspace_id` (String) ID of the workspace



<a id="nestedblock--objective--raw_metric--query--bigquery"></a>
### Nested Schema for `objective.raw_metric.query.bigquery`
Expand Down
Loading

0 comments on commit 96a37f7

Please sign in to comment.