-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add protected_branch_ids to gitlab_project_approval_rule #542
Conversation
I see this is still a draft, but I don't think this will relate to #492, which is about adding a |
In order to properly provide the protected branch IDs, you would either have to configure them using a The current implementation of Edit: In fact, let me split out the |
Signed-off-by: Sune Keller <[email protected]>
@armsnyder This PR is now strictly about adding |
@nicholasklick I saw you were looking over pull requests in this project yesterday. This merge request is also available to be reviewed/merged |
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.
@sirlatrom this looks great, thank you for adding this! 👍
@sirlatrom I'm seeing some acceptance test failures for this:
Any chance I could bug you for some help with these? Seems like an issue with |
Sorry for the noise, just talking out loud where I'm at looking at this...looks like
Because Not sure where to go next, I thought about adding a |
+1 to adding a computed And because it's related, there's an open PR for fixing the |
…labhq#542)" This reverts commit 401790a.
* Fix documentation to show up on terraform registry * update reference to `master` branch to `main` Tested to confirm that it does create a `main` branch by default * Add support for importing Pipeline Schedules and Triggers * Also wait for import_status when a project template is configured Signed-off-by: Sune Keller <[email protected]> * Update dependencies Signed-off-by: Julien Pivotto <[email protected]> * Add most Premium features for gitlab_branch_protection (gitlabhq#556) * Rebase and update go.mod Signed-off-by: Sune Keller <[email protected]> * Add most Premium features for gitlab_branch_protection Signed-off-by: Sune Keller <[email protected]> * Re-work modified schema for gitlab_branch_protection, and update docs Signed-off-by: Sune Keller <[email protected]> * Accommodate to name changes from library maintainer Signed-off-by: Sune Keller <[email protected]> * Remove invalid check for CE Signed-off-by: Sune Keller <[email protected]> * Revert back how merge_access_level and push_access_level are created Signed-off-by: Sune Keller <[email protected]> * Simplify expansion of arguments Signed-off-by: Sune Keller <[email protected]> * Remove several obsolete functions and make acceptance tests independent of implementation functions Signed-off-by: Sune Keller <[email protected]> * fix: update default_branch to "main" for gitlab_project tests * chore: add error handling to resourceGitlabProjectSetToState * Documentation improvements (gitlabhq#642) * Documentation improvements * More Markdown lint fixes * Add golangci-lint to the pipeline Fixes #361 * Add protected_branch_ids to gitlab_project_approval_rule (gitlabhq#542) Signed-off-by: Sune Keller <[email protected]> * chore: remove incomplete gitlab_project_repository_file resource (gitlabhq#650) This file was part of gitlabhq#556 but did not include a test, docs, or an entry in gitlab/provider.go, so we are removing it until it can be completed. * golangci-lint: exclude ResourceData.Set (gitlabhq#652) The common case when using this method is to ignore the error return. This is because the Terraform test framework checks these errors for primitive types for us. * CI: Add tfproviderlint workflow * Ignore preexisting tfproviderlint issues * chore: run golangci-lint for pull requests and annotate failing checks so we can fix them individually (gitlabhq#658) * chore: fix markdown linter errors in branch_protection.md (gitlabhq#656) * modify Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]>
* add build coverage regex * fmt * modify data source and tests * modify doc * fmt * Feature (#1) * Fix documentation to show up on terraform registry * update reference to `master` branch to `main` Tested to confirm that it does create a `main` branch by default * Add support for importing Pipeline Schedules and Triggers * Also wait for import_status when a project template is configured Signed-off-by: Sune Keller <[email protected]> * Update dependencies Signed-off-by: Julien Pivotto <[email protected]> * Add most Premium features for gitlab_branch_protection (#556) * Rebase and update go.mod Signed-off-by: Sune Keller <[email protected]> * Add most Premium features for gitlab_branch_protection Signed-off-by: Sune Keller <[email protected]> * Re-work modified schema for gitlab_branch_protection, and update docs Signed-off-by: Sune Keller <[email protected]> * Accommodate to name changes from library maintainer Signed-off-by: Sune Keller <[email protected]> * Remove invalid check for CE Signed-off-by: Sune Keller <[email protected]> * Revert back how merge_access_level and push_access_level are created Signed-off-by: Sune Keller <[email protected]> * Simplify expansion of arguments Signed-off-by: Sune Keller <[email protected]> * Remove several obsolete functions and make acceptance tests independent of implementation functions Signed-off-by: Sune Keller <[email protected]> * fix: update default_branch to "main" for gitlab_project tests * chore: add error handling to resourceGitlabProjectSetToState * Documentation improvements (#642) * Documentation improvements * More Markdown lint fixes * Add golangci-lint to the pipeline Fixes #361 * Add protected_branch_ids to gitlab_project_approval_rule (#542) Signed-off-by: Sune Keller <[email protected]> * chore: remove incomplete gitlab_project_repository_file resource (#650) This file was part of #556 but did not include a test, docs, or an entry in gitlab/provider.go, so we are removing it until it can be completed. * golangci-lint: exclude ResourceData.Set (#652) The common case when using this method is to ignore the error return. This is because the Terraform test framework checks these errors for primitive types for us. * CI: Add tfproviderlint workflow * Ignore preexisting tfproviderlint issues * chore: run golangci-lint for pull requests and annotate failing checks so we can fix them individually (#658) * chore: fix markdown linter errors in branch_protection.md (#656) * modify Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]>
* add build coverage regex * fmt * modify data source and tests * modify doc * fmt * Feature (#1) * Fix documentation to show up on terraform registry * update reference to `master` branch to `main` Tested to confirm that it does create a `main` branch by default * Add support for importing Pipeline Schedules and Triggers * Also wait for import_status when a project template is configured Signed-off-by: Sune Keller <[email protected]> * Update dependencies Signed-off-by: Julien Pivotto <[email protected]> * Add most Premium features for gitlab_branch_protection (gitlabhq#556) * Rebase and update go.mod Signed-off-by: Sune Keller <[email protected]> * Add most Premium features for gitlab_branch_protection Signed-off-by: Sune Keller <[email protected]> * Re-work modified schema for gitlab_branch_protection, and update docs Signed-off-by: Sune Keller <[email protected]> * Accommodate to name changes from library maintainer Signed-off-by: Sune Keller <[email protected]> * Remove invalid check for CE Signed-off-by: Sune Keller <[email protected]> * Revert back how merge_access_level and push_access_level are created Signed-off-by: Sune Keller <[email protected]> * Simplify expansion of arguments Signed-off-by: Sune Keller <[email protected]> * Remove several obsolete functions and make acceptance tests independent of implementation functions Signed-off-by: Sune Keller <[email protected]> * fix: update default_branch to "main" for gitlab_project tests * chore: add error handling to resourceGitlabProjectSetToState * Documentation improvements (gitlabhq#642) * Documentation improvements * More Markdown lint fixes * Add golangci-lint to the pipeline Fixes #361 * Add protected_branch_ids to gitlab_project_approval_rule (gitlabhq#542) Signed-off-by: Sune Keller <[email protected]> * chore: remove incomplete gitlab_project_repository_file resource (gitlabhq#650) This file was part of gitlabhq#556 but did not include a test, docs, or an entry in gitlab/provider.go, so we are removing it until it can be completed. * golangci-lint: exclude ResourceData.Set (gitlabhq#652) The common case when using this method is to ignore the error return. This is because the Terraform test framework checks these errors for primitive types for us. * CI: Add tfproviderlint workflow * Ignore preexisting tfproviderlint issues * chore: run golangci-lint for pull requests and annotate failing checks so we can fix them individually (gitlabhq#658) * chore: fix markdown linter errors in branch_protection.md (gitlabhq#656) * modify Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]>
* Add most Premium features for gitlab_branch_protection (gitlabhq#556) * Rebase and update go.mod Signed-off-by: Sune Keller <[email protected]> * Add most Premium features for gitlab_branch_protection Signed-off-by: Sune Keller <[email protected]> * Re-work modified schema for gitlab_branch_protection, and update docs Signed-off-by: Sune Keller <[email protected]> * Accommodate to name changes from library maintainer Signed-off-by: Sune Keller <[email protected]> * Remove invalid check for CE Signed-off-by: Sune Keller <[email protected]> * Revert back how merge_access_level and push_access_level are created Signed-off-by: Sune Keller <[email protected]> * Simplify expansion of arguments Signed-off-by: Sune Keller <[email protected]> * Remove several obsolete functions and make acceptance tests independent of implementation functions Signed-off-by: Sune Keller <[email protected]> * fix: update default_branch to "main" for gitlab_project tests * chore: add error handling to resourceGitlabProjectSetToState * Documentation improvements (gitlabhq#642) * Documentation improvements * More Markdown lint fixes * Add golangci-lint to the pipeline Fixes #361 * Add protected_branch_ids to gitlab_project_approval_rule (gitlabhq#542) Signed-off-by: Sune Keller <[email protected]> * chore: remove incomplete gitlab_project_repository_file resource (gitlabhq#650) This file was part of gitlabhq#556 but did not include a test, docs, or an entry in gitlab/provider.go, so we are removing it until it can be completed. * golangci-lint: exclude ResourceData.Set (gitlabhq#652) The common case when using this method is to ignore the error return. This is because the Terraform test framework checks these errors for primitive types for us. * CI: Add tfproviderlint workflow * Ignore preexisting tfproviderlint issues * chore: run golangci-lint for pull requests and annotate failing checks so we can fix them individually (gitlabhq#658) * chore: fix markdown linter errors in branch_protection.md (gitlabhq#656) * add build coverage regex (gitlabhq#627) * add build coverage regex * fmt * modify data source and tests * modify doc * fmt * Feature (#1) * Fix documentation to show up on terraform registry * update reference to `master` branch to `main` Tested to confirm that it does create a `main` branch by default * Add support for importing Pipeline Schedules and Triggers * Also wait for import_status when a project template is configured Signed-off-by: Sune Keller <[email protected]> * Update dependencies Signed-off-by: Julien Pivotto <[email protected]> * Add most Premium features for gitlab_branch_protection (gitlabhq#556) * Rebase and update go.mod Signed-off-by: Sune Keller <[email protected]> * Add most Premium features for gitlab_branch_protection Signed-off-by: Sune Keller <[email protected]> * Re-work modified schema for gitlab_branch_protection, and update docs Signed-off-by: Sune Keller <[email protected]> * Accommodate to name changes from library maintainer Signed-off-by: Sune Keller <[email protected]> * Remove invalid check for CE Signed-off-by: Sune Keller <[email protected]> * Revert back how merge_access_level and push_access_level are created Signed-off-by: Sune Keller <[email protected]> * Simplify expansion of arguments Signed-off-by: Sune Keller <[email protected]> * Remove several obsolete functions and make acceptance tests independent of implementation functions Signed-off-by: Sune Keller <[email protected]> * fix: update default_branch to "main" for gitlab_project tests * chore: add error handling to resourceGitlabProjectSetToState * Documentation improvements (gitlabhq#642) * Documentation improvements * More Markdown lint fixes * Add golangci-lint to the pipeline Fixes #361 * Add protected_branch_ids to gitlab_project_approval_rule (gitlabhq#542) Signed-off-by: Sune Keller <[email protected]> * chore: remove incomplete gitlab_project_repository_file resource (gitlabhq#650) This file was part of gitlabhq#556 but did not include a test, docs, or an entry in gitlab/provider.go, so we are removing it until it can be completed. * golangci-lint: exclude ResourceData.Set (gitlabhq#652) The common case when using this method is to ignore the error return. This is because the Terraform test framework checks these errors for primitive types for us. * CI: Add tfproviderlint workflow * Ignore preexisting tfproviderlint issues * chore: run golangci-lint for pull requests and annotate failing checks so we can fix them individually (gitlabhq#658) * chore: fix markdown linter errors in branch_protection.md (gitlabhq#656) * modify Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]> * CI: Use golangci-lint to run gofmt; remove redundant errcheck script * gitlab_project resource: make default_branch attribute configurable on creation - Made default_branch a computed attribute - Removed the DiffSuppressFunc from default_branch so that we can use it during creation - Implemented logic to set the default branch in cases where a repository exists (if the project was created with a readme, as a mirror, or from a template) - Refactored the mirror code to be more explicit, instead of calling the update function from inside the create function. There was an error being returned here, which was being ignored. * Add common test helpers for setting up test data * Fix failing test TestAccGitLabProjectApprovalRule_basic * CI: Increase golangci-lint timeout to 3m * Adds support for gitlab project badges (gitlabhq#648) * add project badge support * fix tests and gitlab sdk references * change id to projectid:badgeid and add importer * add gitlab_project_badge documentation * unify basic test and imporState test for project_badge * Change project_badge test order Co-authored-by: Adam Snyder <[email protected]> * remove unnecessary newlines * add project_badge import documentation Co-authored-by: Adam Snyder <[email protected]> * Add CustomCIPath to resource `gitlab_project` (gitlabhq#662) * Add CustomCIPath to resource `gitlab_project` * Delete acc test for simple GitLabProject attribute. - Amend existing Acceptance test to reflect this change in the default project * New branch_protection_id attribute for gitlab_branch_protection * CI: Run markdown linter on pull requests ...so that main branch builds to not fail unexpectedly after merging a PR from a fork. * resource/gitlab_project_cluster: Suppress whitespace diffs for kubernetes_ca_cert attribute * Clarify supported Terraform versions (gitlabhq#677) * Update EE license * Update CHANGELOG for 3.7.0 * Fix GitLab project membership example * Authenticate using a Bearer token to support OAuth tokens * Change acceptance test token value The personal access token must be a certain length in order to use it as a Bearer token * update to two part id * use two part id for resource * fmt * remove unused * update resource commit * update flatten commit method * remove max items * updated logic for handling 404 * remove required * added importer * update refs * updated so markdown lint would pass * removed fmt * md lint suggestions * switch to set type * update * update tests * Update docs/resources/branch.md Co-authored-by: Corey Hemminger <[email protected]> * update docs * changed map type schema for commit * syntax' * fmt * added check for empty commit * force error * force error * update provider * updated error check * update provider lint * lint suggestions * fmt * remove duplication of ci config path Co-authored-by: Sune Keller <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Mikhail Mazurskiy <[email protected]> Co-authored-by: Willian Paixao <[email protected]> Co-authored-by: Matt Kasa <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: Adam Snyder <[email protected]> Co-authored-by: zawazawa0316 <[email protected]> Co-authored-by: Denis Doria <[email protected]> Co-authored-by: Daniel Hill <[email protected]> Co-authored-by: Patrick Decat <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Filipe Andujar <[email protected]> Co-authored-by: Marcos Soutullo Rodriguez <[email protected]> Co-authored-by: nicholasklick <[email protected]> Co-authored-by: Nicholas Klick <[email protected]> Co-authored-by: Andrea Scarpino <[email protected]> Co-authored-by: Ed B <[email protected]> Co-authored-by: Corey Hemminger <[email protected]>
Carry #540 due to fork from wrong repo (just for my own sake).
Fixes #492.