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.7.1 release #103

Merged
merged 39 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8fd56bd
prepare release (#80) (#188)
sloloris Jan 20, 2022
aea6005
Do not allow 0% segment rule weights (#189)
ldhenry Jan 21, 2022
f1e972c
Fix flag trigger creation panic (#190)
ldhenry Jan 21, 2022
09a6fa3
Backmerge/release 2.4.1 (#191)
ldhenry Jan 21, 2022
e493b76
Add Slack webhooks to audit_log_subscription (#192)
ldhenry Feb 7, 2022
2512cf3
backmerge v2.5.0 (#193)
ldhenry Feb 8, 2022
f4332bc
Use jennifer to generate audit log subscription configs (#194)
ldhenry Feb 8, 2022
de0fe41
Run terraform provider acceptance tests daily and notify of failures …
ldhenry Feb 8, 2022
9a38dde
Update changelog branch (#195)
ldhenry Feb 9, 2022
d285706
[ sc-143291] update autogenerated audit_log_subscription configs (#197)
monsagri Mar 14, 2022
42d99ac
Increase checkpoint-api.harhicorp.com timeout to 10s (#198)
ldhenry Mar 17, 2022
04b73ff
Updated destination tests to use random env keys to avoid env conflic…
ctawiah Apr 6, 2022
b6bc3f2
Merge pull request #199 from launchdarkly/ctawiah/sc-148136/randomize…
ctawiah Apr 6, 2022
e722f06
[sc 148065] add approvals bypass to terraform docs (#200)
monsagri Apr 7, 2022
b88452a
Backmerge/release 2.6.0 (#201)
monsagri Apr 7, 2022
ae41bdb
fix doc issues (#202)
sloloris Apr 14, 2022
a402d11
[sc-149869] roll back documentation changes regarding (#203)
monsagri Apr 14, 2022
66d55a1
backmerge 2.6.1 (#204)
monsagri Apr 14, 2022
494df8f
Imiller/sc 151834/add base permissions to custom role resource (#205)
sloloris May 4, 2022
38d70bc
Backmerge/release 2.7.0 (#206)
sloloris May 5, 2022
6559f71
(bug-fix) Update modules to accept new API header
May 11, 2022
4795ea3
Merge pull request #207 from launchdarkly/fix-ci
lucywyman May 13, 2022
626aaae
Update circleci test timeout to 15 seconds
May 19, 2022
2c88570
Merge pull request #208 from launchdarkly/sunny/sc-153482/increase-ti…
lucywyman May 20, 2022
9084524
Regenerate auditlog configs to resolve CI failures (#211)
ldhenry Jun 30, 2022
54dbc29
Run make generate to supress CI failures (#212)
ldhenry Jul 11, 2022
b9a3419
added a check for environment and warning
Jul 12, 2022
c073a3b
fix go lint error
Jul 12, 2022
822f9d8
Merge branch 'main' into sunny/sc-158595/leftover-resources-cannot-be…
Jul 12, 2022
2ba884b
use environmentExists function
Jul 12, 2022
dd21dac
remove grafana
Jul 13, 2022
66c862c
fix: [sc-158595] leftover resources cannot be cleared out after launc…
Jul 13, 2022
88840f0
Update changelog with bug fix for datasource feature flag environment
Jul 13, 2022
33a1f9f
Merge pull request #215 from launchdarkly/sunny/update-changelog-data…
lucywyman Jul 14, 2022
7f85c5f
updated change log
Jul 21, 2022
86df0a6
Merge branch 'main' into release-2.7.1
Jul 21, 2022
d71adb4
Update launchdarkly/feature_flag_environment_helper.go
Jul 25, 2022
24b825d
Update launchdarkly/feature_flag_environment_helper.go
Jul 25, 2022
9d05532
link to github issue in changelog
Jul 25, 2022
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

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

steps:
- checkout
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## [2.7.0] (Unreleased)
## [2.7.1] (July 21, 2022)

BUG FIXES:

- Datasource `launchdarkly_feature_flag_environment` now checks whether the environment exists and print out a more descriptive error. [#101](https://github.com/launchdarkly/terraform-provider-launchdarkly/issues/101)

## [2.7.0] (May 5, 2022)

FEATURES:

Expand Down
23 changes: 9 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,21 @@ require (
github.com/fatih/color v1.13.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-hclog v1.0.0 // indirect
github.com/hashicorp/go-plugin v1.4.3 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0
github.com/hashicorp/hcl/v2 v2.11.1 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0
github.com/hashicorp/terraform-registry-address v0.0.0-20210816115301-cb2034eba045 // indirect
github.com/hashicorp/go-plugin v1.4.4 // indirect
github.com/hashicorp/go-retryablehttp v0.7.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0
github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 // indirect
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/launchdarkly/api-client-go/v7 v7.1.1
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/stoewer/go-strcase v1.2.0
github.com/stretchr/testify v1.7.0
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
golang.org/x/text v0.3.7 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.42.0 // indirect
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 // indirect
)
163 changes: 58 additions & 105 deletions go.sum

Large diffs are not rendered by default.

66 changes: 63 additions & 3 deletions launchdarkly/audit_log_subscription_configs_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions launchdarkly/feature_flag_environment_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ func featureFlagEnvironmentRead(ctx context.Context, d *schema.ResourceData, raw
}
envKey := d.Get(ENV_KEY).(string)

envExists, err := environmentExists(projectKey, envKey, client)

if err != nil {
return diag.FromErr(err)
}

if !envExists {
log.Printf("[WARN] failed to find environment %q in project %q, removing resource from state", envKey, projectKey)
diags = append(diags, diag.Diagnostic{
Severity: diag.Warning,
Summary: fmt.Sprintf("[WARN] failed to find environment %q in project %q, removing resource from state", envKey, projectKey),
})
d.SetId("")
return diags
}

flag, res, err := getFeatureFlagEnvironment(client, projectKey, flagKey, envKey)
if isStatusNotFound(res) && !isDataSource {
log.Printf("[WARN] failed to find flag %q in project %q, removing from state", flagKey, projectKey)
Expand Down
4 changes: 2 additions & 2 deletions launchdarkly/resource_launchdarkly_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func TestAccEnvironmentWithApprovals(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "approval_settings.0.can_review_own_request", "true"),
resource.TestCheckResourceAttr(resourceName, "approval_settings.0.can_apply_declined_changes", "false"),
resource.TestCheckResourceAttr(resourceName, "approval_settings.0.min_num_approvals", "1"),
resource.TestCheckNoResourceAttr(resourceName, "approval_settings.0.required_approval_tags"),
resource.TestCheckNoResourceAttr(resourceName, "approval_settings.0.required_approval_tags.#"),
),
},
{
Expand All @@ -316,7 +316,7 @@ func TestAccEnvironmentWithApprovals(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, KEY, "approvals-test"),
resource.TestCheckResourceAttr(resourceName, COLOR, "bababa"),
resource.TestCheckResourceAttr(resourceName, PROJECT_KEY, projectKey),
resource.TestCheckNoResourceAttr(resourceName, APPROVAL_SETTINGS),
resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.%%", APPROVAL_SETTINGS)),
),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,11 @@ func TestAccFeatureFlagEnvironment_Empty(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, OFF_VARIATION, "2"),
resource.TestCheckResourceAttr(resourceName, "fallthrough.0.variation", "0"),
resource.TestCheckResourceAttr(resourceName, TRACK_EVENTS, "false"),
resource.TestCheckNoResourceAttr(resourceName, RULES),
resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.0", RULES)),
resource.TestCheckNoResourceAttr(resourceName, "rules.#"),
resource.TestCheckNoResourceAttr(resourceName, PREREQUISITES),
resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.0", PREREQUISITES)),
resource.TestCheckNoResourceAttr(resourceName, "prerequisites.#"),
resource.TestCheckNoResourceAttr(resourceName, TARGETS),
resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.0", TARGETS)),
resource.TestCheckNoResourceAttr(resourceName, "targets.#"),
),
},
Expand Down
1 change: 0 additions & 1 deletion launchdarkly/resource_launchdarkly_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ func TestAccProject_Update(t *testing.T) {
testAccCheckProjectExists(resourceName),
resource.TestCheckResourceAttr(resourceName, KEY, projectKey),
resource.TestCheckResourceAttr(resourceName, NAME, "awesome test project"),
resource.TestCheckNoResourceAttr(resourceName, "tags"),
resource.TestCheckNoResourceAttr(resourceName, "tags.#"),
resource.TestCheckResourceAttr(resourceName, INCLUDE_IN_SNIPPET, "false"),
),
Expand Down
2 changes: 1 addition & 1 deletion launchdarkly/resource_launchdarkly_segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestAccSegment_Update(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "excluded.#", "2"),
resource.TestCheckResourceAttr(resourceName, "excluded.0", "user3"),
resource.TestCheckResourceAttr(resourceName, "excluded.1", "user4"),
resource.TestCheckNoResourceAttr(resourceName, RULES),
resource.TestCheckNoResourceAttr(resourceName, fmt.Sprintf("%s.#", RULES)),
),
},
{
Expand Down
3 changes: 1 addition & 2 deletions launchdarkly/variations_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package launchdarkly
import (
"encoding/json"
"fmt"
"reflect"
"strconv"
"strings"

Expand Down Expand Up @@ -307,7 +306,7 @@ func variationsToVariationType(variations []ldapi.Variation) (string, error) {
case map[string]interface{}, []interface{}:
variationType = JSON_VARIATION
default:
return "", fmt.Errorf("unknown variation type: %q", reflect.TypeOf(variationValue))
return "", fmt.Errorf("unknown variation type: %T", variationValue)
}
return variationType, nil
}