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

Updated references to playground repo to best-practices #126

Closed
wants to merge 1 commit into from

Conversation

tim-schilling
Copy link
Member

No description provided.

Copy link

github-actions bot commented Dec 1, 2024

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

Plan: 2 to import, 12 to add, 2 to change, 14 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
-   destroy

Terraform will perform the following actions:

  # github_repository.this["best-practices"] will be updated in-place
  # (imported from "best-practices")
!~  resource "github_repository" "this" {
        allow_auto_merge            = false
        allow_merge_commit          = false
        allow_rebase_merge          = false
        allow_squash_merge          = true
        allow_update_branch         = true
+       archive_on_destroy          = true
        archived                    = false
        auto_init                   = false
        default_branch              = "main"
        delete_branch_on_merge      = true
        description                 = "A sample project with best practices for Django Commons projects."
        etag                        = "W/\"97a745b27d2d943232f02fc89a75e020bcfe018213a587651dbc0745429dd9f3\""
        full_name                   = "django-commons/django-commons-playground"
        git_clone_url               = "git://github.com/django-commons/django-commons-playground.git"
        has_discussions             = true
        has_downloads               = true
        has_issues                  = true
        has_projects                = true
        has_wiki                    = false
        homepage_url                = null
        html_url                    = "https://github.com/django-commons/django-commons-playground"
        http_clone_url              = "https://github.com/django-commons/django-commons-playground.git"
        id                          = "best-practices"
        is_template                 = false
        merge_commit_message        = "PR_TITLE"
        merge_commit_title          = "MERGE_MESSAGE"
        name                        = "best-practices"
        node_id                     = "************"
        primary_language            = "Python"
        private                     = false
        repo_id                     = 775949742
        squash_merge_commit_message = "COMMIT_MESSAGES"
        squash_merge_commit_title   = "COMMIT_OR_PR_TITLE"
        ssh_clone_url               = "[email protected]:django-commons/django-commons-playground.git"
        svn_url                     = "https://github.com/django-commons/django-commons-playground"
        topics                      = [
            "django",
            "python",
            "template",
        ]
        visibility                  = "public"
        vulnerability_alerts        = true
        web_commit_signoff_required = false

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

  # github_repository.this["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_repository" "this" {
-       allow_auto_merge            = false -> null
-       allow_merge_commit          = false -> null
-       allow_rebase_merge          = false -> null
-       allow_squash_merge          = true -> null
-       allow_update_branch         = true -> null
-       archive_on_destroy          = true -> null
-       archived                    = false -> null
-       auto_init                   = false -> null
-       default_branch              = "main" -> null
-       delete_branch_on_merge      = true -> null
-       description                 = "A sample project with best practices for Django Commons projects." -> null
-       etag                        = "W/\"50374c21e34aa7bda8450fd944231e0cba5e451c2665ddb3280696bef7b4d5c4\"" -> null
-       full_name                   = "django-commons/django-commons-playground" -> null
-       git_clone_url               = "git://github.com/django-commons/django-commons-playground.git" -> null
-       has_discussions             = true -> null
-       has_downloads               = true -> null
-       has_issues                  = true -> null
-       has_projects                = true -> null
-       has_wiki                    = false -> null
-       html_url                    = "https://github.com/django-commons/django-commons-playground" -> null
-       http_clone_url              = "https://github.com/django-commons/django-commons-playground.git" -> null
-       id                          = "django-commons-playground" -> null
-       is_template                 = false -> null
-       merge_commit_message        = "PR_TITLE" -> null
-       merge_commit_title          = "MERGE_MESSAGE" -> null
-       name                        = "django-commons-playground" -> null
-       node_id                     = "R_kgDOLkANrg" -> null
-       primary_language            = "Python" -> null
-       private                     = false -> null
-       repo_id                     = 775949742 -> null
-       squash_merge_commit_message = "COMMIT_MESSAGES" -> null
-       squash_merge_commit_title   = "COMMIT_OR_PR_TITLE" -> null
-       ssh_clone_url               = "[email protected]:django-commons/django-commons-playground.git" -> null
-       svn_url                     = "https://github.com/django-commons/django-commons-playground" -> null
-       topics                      = [
-           "django",
-           "python",
-           "template",
        ] -> null
-       visibility                  = "public" -> null
-       vulnerability_alerts        = true -> null
-       web_commit_signoff_required = false -> null
#        (1 unchanged attribute hidden)

-       security_and_analysis {
-           secret_scanning {
-               status = "disabled" -> null
            }
-           secret_scanning_push_protection {
-               status = "disabled" -> null
            }
        }
    }

  # github_repository_collaborators.this["best-practices"] will be updated in-place
  # (imported from "best-practices")
!~  resource "github_repository_collaborators" "this" {
        id             = "best-practices"
        invitation_ids = {}
        repository     = "best-practices"

-       team {
-           permission = "admin" -> null
-           team_id    = "django-commons-playground-admins" -> null
        }
-       team {
-           permission = "maintain" -> null
-           team_id    = "django-commons-playground-committers" -> null
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
-       team {
-           permission = "triage" -> null
-           team_id    = "django-commons-playground" -> null
        }
+       team {
+           permission = "admin"
+           team_id    = (known after apply)
        }
+       team {
+           permission = "maintain"
+           team_id    = (known after apply)
        }
+       team {
+           permission = "triage"
+           team_id    = (known after apply)
        }
    }

  # github_repository_collaborators.this["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_repository_collaborators" "this" {
-       id             = "django-commons-playground" -> null
-       invitation_ids = {} -> null
-       repository     = "django-commons-playground" -> null

-       team {
-           permission = "admin" -> null
-           team_id    = "django-commons-playground-admins" -> null
        }
-       team {
-           permission = "maintain" -> null
-           team_id    = "django-commons-playground-committers" -> null
        }
-       team {
-           permission = "pull" -> null
-           team_id    = "security-team" -> null
        }
-       team {
-           permission = "triage" -> null
-           team_id    = "django-commons-playground" -> null
        }
    }

  # github_repository_environment.pypi["best-practices"] will be created
+   resource "github_repository_environment" "pypi" {
+       can_admins_bypass   = true
+       environment         = "pypi"
+       id                  = (known after apply)
+       prevent_self_review = false
+       repository          = "best-practices"

+       reviewers {
+           teams = (known after apply)
        }
    }

  # github_repository_environment.pypi["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_repository_environment" "pypi" {
-       can_admins_bypass   = true -> null
-       environment         = "pypi" -> null
-       id                  = "django-commons-playground:pypi" -> null
-       prevent_self_review = false -> null
-       repository          = "django-commons-playground" -> null
-       wait_timer          = 0 -> null

-       reviewers {
-           teams = [
-               9757650,
            ] -> null
-           users = [] -> null
        }
    }

  # github_repository_environment.testpypi["best-practices"] will be created
+   resource "github_repository_environment" "testpypi" {
+       can_admins_bypass   = true
+       environment         = "testpypi"
+       id                  = (known after apply)
+       prevent_self_review = false
+       repository          = "best-practices"
    }

  # github_repository_environment.testpypi["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_repository_environment" "testpypi" {
-       can_admins_bypass = true -> null
-       environment       = "testpypi" -> null
-       id                = "django-commons-playground:testpypi" -> null
-       repository        = "django-commons-playground" -> null
-       wait_timer        = 0 -> null
    }

  # github_team.repo_admin_team["best-practices"] will be created
+   resource "github_team" "repo_admin_team" {
+       create_default_maintainer = false
+       description               = "Admin team for the best-practices repository"
+       etag                      = (known after apply)
+       id                        = (known after apply)
+       members_count             = (known after apply)
+       name                      = "best-practices-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_admin_team["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team" "repo_admin_team" {
-       create_default_maintainer = false -> null
-       description               = "Admin team for the django-commons-playground repository" -> null
-       etag                      = "W/\"6f9be4dd6a8735eca2df2fa08b75391d942190ba4a273dbc6521f31626d22a4c\"" -> null
-       id                        = "9757650" -> null
-       members_count             = 5 -> null
-       name                      = "django-commons-playground-admins" -> null
-       node_id                   = "T_kwDOCaaRBM4AlOPS" -> null
-       parent_team_id            = "9757678" -> null
-       parent_team_read_id       = "9757678" -> null
-       parent_team_read_slug     = "django-commons-playground" -> null
-       privacy                   = "closed" -> null
-       slug                      = "django-commons-playground-admins" -> null
#        (1 unchanged attribute hidden)
    }

  # github_team.repo_committer_team["best-practices"] will be created
+   resource "github_team" "repo_committer_team" {
+       create_default_maintainer = false
+       description               = "Committers team for the best-practices repository"
+       etag                      = (known after apply)
+       id                        = (known after apply)
+       members_count             = (known after apply)
+       name                      = "best-practices-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_committer_team["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team" "repo_committer_team" {
-       create_default_maintainer = false -> null
-       description               = "Committers team for the django-commons-playground repository" -> null
-       etag                      = "W/\"591346b91ac69367466a0db922d88fb1830314f88185d953404396e65b596ae7\"" -> null
-       id                        = "9757668" -> null
-       members_count             = 1 -> null
-       name                      = "django-commons-playground-committers" -> null
-       node_id                   = "T_kwDOCaaRBM4AlOPk" -> null
-       parent_team_id            = "9757678" -> null
-       parent_team_read_id       = "9757678" -> null
-       parent_team_read_slug     = "django-commons-playground" -> null
-       privacy                   = "closed" -> null
-       slug                      = "django-commons-playground-committers" -> null
#        (1 unchanged attribute hidden)
    }

  # github_team.repo_team["best-practices"] will be created
+   resource "github_team" "repo_team" {
+       create_default_maintainer = false
+       description               = "Main team for the best-practices repository"
+       etag                      = (known after apply)
+       id                        = (known after apply)
+       members_count             = (known after apply)
+       name                      = "best-practices"
+       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.repo_team["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team" "repo_team" {
-       create_default_maintainer = false -> null
-       description               = "Main team for the django-commons-playground repository" -> null
-       etag                      = "W/\"ad3ed3b83016b2a05f17f228a9a8348f30a30b2314fc5e3924a86a2bce255869\"" -> null
-       id                        = "9757678" -> null
-       members_count             = 6 -> null
-       name                      = "django-commons-playground" -> null
-       node_id                   = "T_kwDOCaaRBM4AlOPu" -> null
-       privacy                   = "closed" -> null
-       slug                      = "django-commons-playground" -> null
#        (4 unchanged attributes hidden)
    }

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

+       members {
+           role     = "maintainer"
+           username = "Stormheg"
        }
+       members {
+           role     = "maintainer"
+           username = "cunla"
        }
+       members {
+           role     = "maintainer"
+           username = "ryancheley"
        }
+       members {
+           role     = "maintainer"
+           username = "tim-schilling"
        }
+       members {
+           role     = "maintainer"
+           username = "williln"
        }
    }

  # github_team_members.repo_admin_members["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_members" "repo_admin_members" {
-       id      = "django-commons-playground-admins" -> null
-       team_id = "django-commons-playground-admins" -> null

-       members {
-           role     = "maintainer" -> null
-           username = "Stormheg" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "cunla" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "ryancheley" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "tim-schilling" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "williln" -> null
        }
    }

  # github_team_members.repo_committer_team_members["best-practices"] will be created
+   resource "github_team_members" "repo_committer_team_members" {
+       id      = (known after apply)
+       team_id = (known after apply)

+       members {
+           role     = "member"
+           username = "priyapahwa"
        }
    }

  # github_team_members.repo_committer_team_members["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_members" "repo_committer_team_members" {
-       id      = "django-commons-playground-committers" -> null
-       team_id = "django-commons-playground-committers" -> null

-       members {
-           role     = "member" -> null
-           username = "priyapahwa" -> null
        }
    }

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

+       members {
+           role     = "maintainer"
+           username = "Stormheg"
        }
+       members {
+           role     = "maintainer"
+           username = "cunla"
        }
+       members {
+           role     = "maintainer"
+           username = "ryancheley"
        }
+       members {
+           role     = "maintainer"
+           username = "tim-schilling"
        }
+       members {
+           role     = "maintainer"
+           username = "williln"
        }
+       members {
+           role     = "member"
+           username = "priyapahwa"
        }
    }

  # github_team_members.repo_team_members["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_members" "repo_team_members" {
-       id      = "django-commons-playground" -> null
-       team_id = "django-commons-playground" -> null

-       members {
-           role     = "maintainer" -> null
-           username = "Stormheg" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "cunla" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "ryancheley" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "tim-schilling" -> null
        }
-       members {
-           role     = "maintainer" -> null
-           username = "williln" -> null
        }
-       members {
-           role     = "member" -> null
-           username = "priyapahwa" -> null
        }
    }

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

  # github_team_repository.repo_admin_team_access["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_repository" "repo_admin_team_access" {
-       etag       = "W/\"ee80b225c4d3972eee9b22992a8b09766c674e9671646dd5405b593ef2d0b53f\"" -> null
-       id         = "9757650:django-commons-playground" -> null
-       permission = "admin" -> null
-       repository = "django-commons-playground" -> null
-       team_id    = "django-commons-playground-admins" -> null
    }

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

  # github_team_repository.repo_committer_team_access["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_repository" "repo_committer_team_access" {
-       etag       = "W/\"9e65957de9acd7b54aae03ec005214653eea22bd1b17f3d31c195b9df2c654a9\"" -> null
-       id         = "9757668:django-commons-playground" -> null
-       permission = "maintain" -> null
-       repository = "django-commons-playground" -> null
-       team_id    = "django-commons-playground-committers" -> null
    }

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

  # github_team_repository.repo_team_access["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_repository" "repo_team_access" {
-       etag       = "W/\"07f9466fe712be1ad361ffda7abb8a97a20b36be7c1a627dc72729d1ecfd1cd9\"" -> null
-       id         = "9757678:django-commons-playground" -> null
-       permission = "triage" -> null
-       repository = "django-commons-playground" -> null
-       team_id    = "django-commons-playground" -> null
    }

  # github_team_settings.this["best-practices"] 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
        }
    }

  # github_team_settings.this["django-commons-playground"] will be destroyed
  # (because key ["django-commons-playground"] is not in for_each map)
-   resource "github_team_settings" "this" {
-       id        = "T_kwDOCaaRBM4AlOPu" -> null
-       team_id   = "django-commons-playground" -> null
-       team_slug = "django-commons-playground" -> null
-       team_uid  = "T_kwDOCaaRBM4AlOPu" -> null

-       review_request_delegation {
-           algorithm    = "LOAD_BALANCE" -> null
-           member_count = 2 -> null
-           notify       = false -> null
        }
    }

Plan: 2 to import, 12 to add, 2 to change, 14 to destroy.

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

@tim-schilling
Copy link
Member Author

@cunla something tells me if we apply this we're going to run into problems.

@ryancheley
Copy link
Member

Is it possible to create a new repo with the name we want and then remove the old one? I agree with @tim-schilling that running this looks like it will cause some issues, though my sense is more of a gut feeling than specific experience or knowledge of what this change will do.

@cunla
Copy link
Member

cunla commented Dec 3, 2024

I am not sure that's the way to go with this. It doesn't say it will make changes to the repo but destroy and create (when it changes things, it shows ~).

I will update the repo manually and the tf state manually.

@cunla
Copy link
Member

cunla commented Dec 3, 2024

I updated the repo and teams manually (though not the team's descriptions) - Here is the PR: #127

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.

3 participants