Skip to content

Commit

Permalink
prepare 2.6.0 release (#91)
Browse files Browse the repository at this point in the history
* prepare release (#80) (#188)

* Do not allow 0% segment rule weights (#189)

* Prevent users from setting a 0% rollout

* Update changelog

* Fix bug

* Fix flag trigger creation panic (#190)

* Backmerge/release 2.4.1 (#191)

* Backmerge v2.4.1

* fix merge conflicts

* Add Slack webhooks to audit_log_subscription (#192)

* backmerge v2.5.0 (#193)

* Use jennifer to generate audit log subscription configs (#194)

* Run terraform provider acceptance tests daily and notify of failures (#196)

* Update changelog branch (#195)

* [ sc-143291] update autogenerated audit_log_subscription configs  (#197)

* update autogenerated configs to account for hideMemberDetails change to DDog integration

* update changelog

* Add test

* Update CHANGELOG.md

Co-authored-by: Henry Barrow <[email protected]>

Co-authored-by: Henry Barrow <[email protected]>

* Increase checkpoint-api.harhicorp.com timeout to 10s (#198)

* Updated destination tests to use random env keys to avoid env conflict errors

* [sc 148065] add approvals bypass to terraform docs (#200)

* update docs to mention bypassing approval requests

* update changelog

* typo

* Apply suggestions from code review

Co-authored-by: Henry Barrow <[email protected]>

Co-authored-by: Henry Barrow <[email protected]>

* prepare 2.5.1 release

Co-authored-by: Isabelle Miller <[email protected]>
Co-authored-by: Henry Barrow <[email protected]>
Co-authored-by: Clifford Tawiah <[email protected]>
Co-authored-by: Cliff Tawiah <[email protected]>
  • Loading branch information
5 people authored Apr 7, 2022
1 parent 505d607 commit 21e3e7d
Show file tree
Hide file tree
Showing 23 changed files with 1,375 additions and 489 deletions.
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [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:
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

0 comments on commit 21e3e7d

Please sign in to comment.