-
Notifications
You must be signed in to change notification settings - Fork 28
feat: [REL-8140] add LaunchDarkly Views resource and data source #329
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
feat: [REL-8140] add LaunchDarkly Views resource and data source #329
Conversation
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
- Use endpoint construction pattern from access token implementation - Check if endpoint starts with 'http' and prepend 'https://' if not - This should resolve malformed URLs like 'https:///api/v2/projects/...' - Applied to all four HTTP functions: getViewRaw, createView, patchView, deleteView Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
- Replace malformed URL construction that created 'https:///api/v2/...' - Add fallback to 'app.launchdarkly.com' when client.apiHost is empty - Apply fix to all four HTTP functions: getViewRaw, createView, patchView, deleteView - Remove unused 'strings' import - This should resolve TestAccDataSourceView_exists and TestAccDataSourceView_noMatchReturnsError failures Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
- Update Views tests to use newBetaClient pattern like metrics - Modify Views helper functions to use beta client for API calls - Update resource and data source to create and use beta client - Add LD-API-Version: beta header to all Views API requests - This should resolve HTTP 403 errors in TestAccDataSourceView tests Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
- Replace client.fallbackClient.Do() with client.ld.GetConfig().HTTPClient.Do() - This ensures proper authentication and headers are applied to Views API requests - Should resolve TestAccDataSourceView_exists HTTP 403 errors Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
- Change error format from 'HTTP 404' to '404 Not Found' - Ensures TestAccDataSourceView_noMatchReturnsError passes - Maintains consistency with other data source error patterns Co-Authored-By: ffeldberg@launchdarkly.com <ffeldberg@launchdarkly.com>
Co-authored-by: Isabelle Miller <imiller@launchdarkly.com>
@sloloris I've just re-requested review, I think I've addressed all of your feedback and added more tests (good shout!) I left one comment unresolved, the deletion of flag links is working as expected right now, is there something that I'm missing? |
resource.TestCheckResourceAttr(resourceName, ARCHIVED, "false"), | ||
resource.TestCheckResourceAttr(resourceName, "tags.#", "1"), | ||
), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorryyyy can we add the import verify step on these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that the maintainer thing may cause strange plan outputs. but i think probably easy to remedy by adding maintainer to the config - we expect ot see strange plan outputs if none is defined
Co-authored-by: Isabelle Miller <imiller@launchdarkly.com>
Add LaunchDarkly Views Resource Support
Adds
Related Jira issue: REL-8140: Add View features to TF Provider