{{ message }}
Tags: integrations/terraform-provider-github
Tags
[FEAT] Add `github_repository_pages` Resource and Data Source (#3168) * Add resource for repository pages and deprecate it from repository R Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add data source for repository pages and deprecate it from repository DS Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update formatting of docs page Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Change `github_repository` to only Read pages info if pages is in the config Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Fix faulty test Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update Import test Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add `repository_id` diff logic and unify naming Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Use `ConfigStateChecks` in DS tests Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Refactor to use `ConfigStateChecks` in Resource Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Comment out `owner` field for now Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Comment out `owner` field for DS as well Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Simplify import ID Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add support for `public` field in pages Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update docs Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Improve field descriptions Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Only modify `CNAME` in state if it has a value upstream Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add `https_enforced` field Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update `go-github` version Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Replace `switch` with `if` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Re-order `d.Set` calls Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Restructure `UpdatePages` section Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Refactor tests to use `testAccConf.testRepositoryVisibility` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Fix linter Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add tests to ensure that `source` validation works properly Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add more debug logging and fix validation Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Fixed validation tests to notify when they are not working Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add comments to make it clearer why we need to use this partial value setting in Create Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Remove unnecessary `hasChanges` checks and explain the ones that are unnecessary Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Reduce test time by parallelising Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
[MAINT] Fixup `github_repository_file` (#3175) * Improve docs of importing `github_repository_file` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add missing test for import Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Ensure we only set `branch` on import if it's not the default branch Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update `branch` to `Computed` field Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add state migration for missing branch field Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add ID migration in the same bunch Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Fix ID parsing Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Fix ID parsing Always use 2 part ID for import. Use buildID for resource ID * fixup! fixup! Fix ID parsing Use 3 part ID for import as well * fixup! fixup! fixup! Add computed `repository_id` field to resource Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! fixup! fixup! fixup! Add migration of the `repository_id` field. This required changing all tests to need a mock of the GH API Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Comment out test in evaluation Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Remove usage of autocreate_branch in `Read`, `Update` and `Delete` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Mark `autocreate_branch` as deprecated Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Change to use `UpdateFile` in `Update` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * fixup! Update docs with missing fields Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
[BUG] Ensure `github_emu_group_mapping` behaves correctly if mapping … …changes upstream (#3118) * Move `toInt` and `toInt64` functions to `util.go` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * `resource_github_emu_group_mapping`) Change `Read` to use `ListExternalGroupsForTeamBySlug` to ensure we match state and reality Signed-off-by: Timo Sand <timo.sand@f-secure.com> * `resource_github_emu_group_mapping`: Refactor `Create` to have less unnecessary code Signed-off-by: Timo Sand <timo.sand@f-secure.com> * `emu_group_mapping`: Add `group_name` computed attribute Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add matching of team ID into Read * Split Create and Update to separate functions * Update Importer to use new ID pattern * Add Schema migration for new ID format - Adds `github.com/migueleliasweb/go-github-mock` package for mocking go-github endpoints - Adds `github.com/go-test/deep` package for better error messages when types of fields differ Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Changes `group_id` to `ForceNew` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add skipped test while waiting for `terraform-plugin-testing` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add `CustomizeDiff` function to determine if `team_slug` change needs `ForceNew` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update docs Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Use `lookupTeamID` instead of `getTeamID` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Move `Create` before `Read` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Replace `deep` package with `go-cmp` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * `ListExternalGroupsForTeamBySlug` does not return a nested `Teams` slice. We need to directly lookup TeamID Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Replace `go-github-mock` with `githubApiMock` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Remove unnecessry `matchTeamID` function Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Rename state migartion functions Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Inline unnecessary function Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Use new reusable diffing pattern Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Refactor mockResponse builder to accept inputs Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Delete test Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
[BUG] Change `allowed_merge_methods` to `Optional` (#3083) * Fix missing docs Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Set `allowed_merge_methods` to `Optional` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Enable running `repository_ruleset` tests on `enterprise` testmode Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
[BUG] Enable importing `github_emu_group_mapping` for Group with mult… …iple teams (#3054) * Add tests for `github_emu_group_mapping` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Fix broken import of `github_emu_group_mapping`` Which was found by our new tests! Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add failing test to verify problem in #3030 Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update import function to support a single ID and a two part ID Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Refactor to use Context-aware functions Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add detailed logging for INFO, DEBUG and TRACE levels Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Extract import functions into `util_import.go` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Merge Create and Update and remove call to Read Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Address review comments Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Use SDK accessors instead of pointers Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add `getTeamSlugContext` func Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Replace `TeamName` with fetching TeamSlug from API Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Only support import with two part ID Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add warning about Read misbehaving Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
[BUG] Ensure repository creation works if vulnerability-alerts isn't … …modifiable on repo level (#3024) * `github_repository`: Convert to use Context-aware functions Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add tests to ensure `vulnerability_alerts` behaviour keeps working Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add error handling to ignore 422 response In the case of `vulnerability_alerts = false` and the message indicates control from parent Org/Enterprise Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Improve descriptions to make interactions slightly clearer Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Add comment to describe this as a temporary workaround Signed-off-by: Timo Sand <timo.sand@f-secure.com> --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
PreviousNext
