Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 2.5.1 release #90

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,35 @@ version: 2.1
orbs:
go: circleci/[email protected]
linter: talkiq/[email protected]
slack: circleci/[email protected]

commands:
notify-slack-of-failures:
parameters:
branch_pattern:
type: string
default: main
steps:
- slack/notify:
branch_pattern: <<parameters.branch_pattern>>
channel: CLR408M4Y #proj-terraform
event: fail
custom: |
{"text":"A terraform provider test failed","blocks":[{"type":"section",
"text":{"type":"mrkdwn","text":":terraform-on-fire: A terraform provider *${CIRCLE_JOB}* job failed"}},
{"type":"context","elements":[{"type":"mrkdwn","text":"branch: _${CIRCLE_BRANCH}_"}]},{"type":"actions","elements":
[{"type":"button","text":{"type":"plain_text","text":"View job"},"url":"${CIRCLE_BUILD_URL}"}]}]}

jobs:
test:
executor:
name: go/default
tag: &go_version "1.16.10"

environment:
# sc-146360 - overrides the default timeout of 3000ms when reaching checkpoint-api.hashicorp.com
CHECKPOINT_TIMEOUT: 10000

steps:
- checkout
- go/mod-download-cached
Expand Down Expand Up @@ -66,6 +88,7 @@ jobs:
- run:
name: Test Webhook Resource
command: TESTARGS="-run TestAccWebhook" make testacc
- notify-slack-of-failures

lint:
executor:
Expand All @@ -80,9 +103,26 @@ jobs:
sudo apt update
sudo apt install python3-pip python-is-python3
- linter/pre-commit
- notify-slack-of-failures

workflows:
main:
jobs:
- test
- lint
- test:
context: slack-orb
- lint:
context: slack-orb

daily:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- main
jobs:
- test:
context: slack-orb
- lint:
context: slack-orb
15 changes: 7 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ repos:
rev: v0.1.4
hooks:
- id: gofmts

- repo: https://github.com/golangci/golangci-lint
rev: v1.43.0
hooks:
- id: golangci-lint

- repo: local
hooks:
- id: generate-audit-log-subscription-configs
name: Generate Audit Log Subscription Configurations
description: This hook runs a python script to update the audit log subscription configuration validation fields.
entry: python scripts/generate_integration_audit_log_configs.py
- id: make-generate-no-change
name: Make generate does not create additional changes
description: Ensures make generate does not create additional changes
entry: bash -c 'make generate'
pass_filenames: false
language: python
additional_dependencies: ['requests']
verbose: true

language: system
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## [2.5.1] (April 7, 2022)

ENHANCEMENTS:

- Added the `hide_member_details` argument to the Datadog `config` for the `launchdarkly_audit_log_subscription` resource. When `hide_member_details` is `true`, LaunchDarkly member information will be redacted before events are sent to Datadog.

NOTES:

- Added a callout to the `bypassRequiredApproval` action in documentation.

## [2.5.0] (February 7, 2022)

FEATURES:

- Added Slack webhooks to the `launchdarkly_audit_log_subscription` resource and data source. [#16](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/16)
- Added more Datadog host URLs to the Datadog `launchdarkly_audit_log_subscription` resource.

BUG FIXES:

- Fixed an issue where the `config` was not being set on the `launchdarkly_audit_log_subscription` data source.

## [2.4.1] (January 21, 2022)

BUG FIXES:

- Fixed a [bug](https://app.shortcut.com/launchdarkly/story/138913/terraform-provider-panics-when-trying-to-create-triggers-that-are-enabled) preventing `launchdarkly_flag_trigger`s from being created in the `enabled` state.

- Fixed a [bug](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/79) introduced in v2.2.0 where `launchdarkly_segments` with `rule` blocks not containing a `weight` were defaulting to a `weight` of 0.

## [2.4.0] (January 19, 2022)

FEATURES:
Expand Down
6 changes: 6 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ fmtcheck:
errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

install-codegen:
cd scripts/codegen && go install && cd ../..

generate: install-codegen
go generate ./...

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terrafor
$ git clone [email protected]:launchdarkly/terraform-provider-launchdarkly
```

If you are working on the `launchdarkly_audit_log_subscription` resource, you will want to ensure the configuration field mapping is up-to-date with the [most recent changes](https://github.com/launchdarkly/integration-framework/tree/master/integrations) while testing by `cd`-ing into `scripts/` and running `python generate_integration_audit_log_configs.py`. Please note you will need to have the Python `requests` package installed locally. Otherwise, this will be run as a git commit hook. Then, to update the go mapping, follow the instructions in audit_log_subscription_configs.go and commit and push your changes.
If you are working on the `launchdarkly_audit_log_subscription` resource, you will want to ensure the configuration field mapping is up-to-date with the [most recent changes](https://github.com/launchdarkly/integration-framework/tree/master/integrations) by running `make generate`.

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ terraform {
}
```

Some resources or attributes, such as [webhook policy_statements](./webhook/example.tf), that were added later may require a provider version later than 1.0; check the [changelog](https://github.com/launchdarkly/terraform-provider-launchdarkly/blob/master/CHANGELOG.md) for more information on versions.
Some resources or attributes, such as [webhook policy_statements](./webhook/example.tf), that were added later may require a provider version later than 1.0; check the [changelog](https://github.com/launchdarkly/terraform-provider-launchdarkly/blob/main/CHANGELOG.md) for more information on versions.

If you would prefer to define your variables some other way, see [Terraform's documentation on input variables](https://learn.hashicorp.com/terraform/getting-started/variables) for some other ways to do so.
4 changes: 4 additions & 0 deletions examples/v2/feature_flags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ This example contains three config files:
- [flag_types_example.tf](./flag_types_example.tf), which provides examples of the different ways you can define binary (boolean) and multivariate (string, numeric, and JSON) flag variations using the `launchdarkly_feature_flag` resource
- [targeting_example.tf](./targeting_example.tf), which provides complex examples of user targeting using the `launchdarkly_feature_flag_environment` resource. For more detail on user targeting, see the [official LaunchDarkly documentation](https://docs.launchdarkly.com/home/managing-flags/targeting-users).

### Bypassing approval requests

If [approval requests are required](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings) in the feature flag's environment, you can bypass them by adding the [`bypassRequiredApproval` action](https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#bypassing-required-approvals) to the role associated with the LaunchDarkly access token or service token used by the provider.

### Run

Init your working directory from the CL with `terraform init` and then apply the changes with `terraform apply`. You should see output resembling the following:
Expand Down
7 changes: 7 additions & 0 deletions examples/v2/feature_flags/setup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ resource "launchdarkly_project" "tf_flag_examples" {
name = "example environment"
key = "example-env"
color = "ababab"
# You can configure approval settings per environment to control who can apply flag changes
# Your Terraform user can be configured with a custom role to allow it to bypass approval requirements
# See https://docs.launchdarkly.com/home/feature-workflows/environment-approvals#configuring-approval-settings
approval_settings {
min_num_approvals = 2
required = true
}
}

tags = [
Expand Down
Loading