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

Import repo action - try #39

Merged
merged 7 commits into from
Sep 2, 2024
Merged

Import repo action - try #39

merged 7 commits into from
Sep 2, 2024

Conversation

cunla
Copy link
Member

@cunla cunla commented Aug 18, 2024

#33

Ok, my terraform skills are improving :)
I added the import section, so now repositories should be imported automatically.
Look at the plan here.

I will update the readme accordingly.

cunla and others added 2 commits August 18, 2024 14:09
Files changed:
M	terraform/production/repositories.tfvars
Copy link

github-actions bot commented Aug 18, 2024

Terraform plan in terraform
With var files: terraform/production/org.tfvars terraform/production/repositories.tfvars
With variables: github_token = (sensitive value)

Plan: 1 to import, 9 to add, 2 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+   create
!~  update in-place

Terraform will perform the following actions:

  # github_repository.this["django-tasks-scheduler"] will be updated in-place
!~  resource "github_repository" "this" {
        id                          = "django-tasks-scheduler"
!~      merge_commit_message        = "PR_TITLE" -> "PR_BODY"
!~      merge_commit_title          = "MERGE_MESSAGE" -> "PR_TITLE"
        name                        = "django-tasks-scheduler"
#        (35 unchanged attributes hidden)

#        (1 unchanged block hidden)
    }

  # github_repository.this["playground2"] will be updated in-place
  # (imported from "playground2")
!~  resource "github_repository" "this" {
        allow_auto_merge            = false
!~      allow_merge_commit          = true -> false
!~      allow_rebase_merge          = true -> false
        allow_squash_merge          = true
!~      allow_update_branch         = false -> true
+       archive_on_destroy          = true
        archived                    = false
        auto_init                   = false
        default_branch              = "main"
!~      delete_branch_on_merge      = false -> true
!~      description                 = "Repository for tests" -> "Tests"
        etag                        = "W/\"626cfac159561f6ba67c99df22ce4ad5e931dd1ff724c652aa32e81d11cb6647\""
        full_name                   = "django-commons/playground2"
        git_clone_url               = "git://github.com/django-commons/playground2.git"
!~      has_discussions             = false -> true
        has_downloads               = true
        has_issues                  = true
        has_projects                = true
!~      has_wiki                    = true -> false
        homepage_url                = null
        html_url                    = "https://github.com/django-commons/playground2"
        http_clone_url              = "https://github.com/django-commons/playground2.git"
        id                          = "playground2"
        is_template                 = false
!~      merge_commit_message        = "PR_TITLE" -> "PR_BODY"
!~      merge_commit_title          = "MERGE_MESSAGE" -> "PR_TITLE"
        name                        = "playground2"
        node_id                     = "************"
        primary_language            = null
        private                     = false
        repo_id                     = 844211742
!~      squash_merge_commit_message = "COMMIT_MESSAGES" -> "PR_BODY"
!~      squash_merge_commit_title   = "COMMIT_OR_PR_TITLE" -> "PR_TITLE"
        ssh_clone_url               = "[email protected]:django-commons/playground2.git"
        svn_url                     = "https://github.com/django-commons/playground2"
        topics                      = []
        visibility                  = "public"
        vulnerability_alerts        = true
        web_commit_signoff_required = false

        security_and_analysis {
            secret_scanning {
                status = "disabled"
            }
            secret_scanning_push_protection {
                status = "disabled"
            }
        }
    }

  # github_team.repo_admin_team["playground2"] will be created
+   resource "github_team" "repo_admin_team" {
+       create_default_maintainer = false
+       description               = "Admin team for the playground2 repository"
+       etag                      = (known after apply)
+       id                        = (known after apply)
+       members_count             = (known after apply)
+       name                      = "playground2-admins"
+       node_id                   = (known after apply)
+       parent_team_id            = (known after apply)
+       parent_team_read_id       = (known after apply)
+       parent_team_read_slug     = (known after apply)
+       privacy                   = "closed"
+       slug                      = (known after apply)
    }

  # github_team.repo_committer_team["playground2"] will be created
+   resource "github_team" "repo_committer_team" {
+       create_default_maintainer = false
+       description               = "Committers team for the playground2 repository"
+       etag                      = (known after apply)
+       id                        = (known after apply)
+       members_count             = (known after apply)
+       name                      = "playground2-committers"
+       node_id                   = (known after apply)
+       parent_team_id            = (known after apply)
+       parent_team_read_id       = (known after apply)
+       parent_team_read_slug     = (known after apply)
+       privacy                   = "closed"
+       slug                      = (known after apply)
    }

  # github_team.repo_team["playground2"] will be created
+   resource "github_team" "repo_team" {
+       create_default_maintainer = false
+       description               = "Main team for the playground2 repository"
+       etag                      = (known after apply)
+       id                        = (known after apply)
+       members_count             = (known after apply)
+       name                      = "playground2"
+       node_id                   = (known after apply)
+       parent_team_read_id       = (known after apply)
+       parent_team_read_slug     = (known after apply)
+       privacy                   = "closed"
+       slug                      = (known after apply)
    }

  # github_team_members.repo_admin_members["playground2"] will be created
+   resource "github_team_members" "repo_admin_members" {
+       id      = (known after apply)
+       team_id = (known after apply)

+       members {
+           role     = "maintainer"
+           username = "cunla"
        }
    }

  # github_team_members.repo_team_members["playground2"] will be created
+   resource "github_team_members" "repo_team_members" {
+       id      = (known after apply)
+       team_id = (known after apply)

+       members {
+           role     = "maintainer"
+           username = "cunla"
        }
    }

  # github_team_repository.repo_admin_team_access["playground2"] will be created
+   resource "github_team_repository" "repo_admin_team_access" {
+       etag       = (known after apply)
+       id         = (known after apply)
+       permission = "admin"
+       repository = "playground2"
+       team_id    = (known after apply)
    }

  # github_team_repository.repo_committer_team_access["playground2"] will be created
+   resource "github_team_repository" "repo_committer_team_access" {
+       etag       = (known after apply)
+       id         = (known after apply)
+       permission = "maintain"
+       repository = "playground2"
+       team_id    = (known after apply)
    }

  # github_team_repository.repo_team_access["playground2"] will be created
+   resource "github_team_repository" "repo_team_access" {
+       etag       = (known after apply)
+       id         = (known after apply)
+       permission = "triage"
+       repository = "playground2"
+       team_id    = (known after apply)
    }

  # github_team_settings.this["playground2"] will be created
+   resource "github_team_settings" "this" {
+       id        = (known after apply)
+       team_id   = (known after apply)
+       team_slug = (known after apply)
+       team_uid  = (known after apply)

+       review_request_delegation {
+           algorithm    = "LOAD_BALANCE"
+           member_count = 2
+           notify       = false
        }
    }

Plan: 1 to import, 9 to add, 2 to change, 0 to destroy.

📝 Plan generated in Plan org changes and list them in a PR #71

cunla and others added 3 commits August 18, 2024 14:18
Files changed:
M	terraform/production/repositories.tfvars
@cunla cunla merged commit 4022113 into main Sep 2, 2024
2 checks passed
@cunla cunla deleted the import-repo branch September 2, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant