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

fix:GH pages support + manage repo-collaborators #98

Merged
merged 5 commits into from
Nov 5, 2024
Merged

Conversation

cunla
Copy link
Member

@cunla cunla commented Nov 1, 2024

This looks like a big change but it is not really, just better organization:

  • Support for GitHub pages for repositories => fix Support GitHub pages in the terraform management repo controls#62
  • Fix the way we deal with repositories created from a template.
  • Ensure all repository collaborators are managed by the terraform (i.e., remove manually added users from repository collaborators, see plan results here)
  • Update django-commons-playground description and topics.
  • Remove template from django-tailwind-cli (it is not from a template)
  • Replace duplicate { for k, v in var.repositories : k => v if v.is_django_commons_repo == false } with local.project_repositories defined once.

@cunla cunla requested a review from a team November 1, 2024 13:21
@cunla cunla changed the title fix:support for GH-pages in repo fix:GH pages support + manage repo-collaborators Nov 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

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

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

Terraform will perform the following actions:

  # github_repository.this["django-commons-playground"] will be updated in-place
!~  resource "github_repository" "this" {
!~      description                 = "A sample project to test things out" -> "A sample project with best practices for Django Commons projects."
        id                          = "django-commons-playground"
        name                        = "django-commons-playground"
!~      topics                      = [
+           "django",
+           "python",
+           "template",
        ]
#        (35 unchanged attributes hidden)

#        (1 unchanged block hidden)
    }

  # github_repository_collaborators.this["django-commons-playground"] will be imported
    resource "github_repository_collaborators" "this" {
        id             = "django-commons-playground"
        invitation_ids = {}
        repository     = "django-commons-playground"

        team {
            permission = "admin"
            team_id    = "********************************"
        }
        team {
            permission = "maintain"
            team_id    = "************************************"
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
        team {
            permission = "triage"
            team_id    = "*************************"
        }
    }

  # github_repository_collaborators.this["django-debug-toolbar"] will be updated in-place
  # (imported from "django-debug-toolbar")
!~  resource "github_repository_collaborators" "this" {
        id             = "django-debug-toolbar"
!~      invitation_ids = {} -> (known after apply)
        repository     = "django-debug-toolbar"

        team {
            permission = "admin"
            team_id    = "***************************"
        }
        team {
            permission = "maintain"
            team_id    = "*******************************"
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
        team {
            permission = "triage"
            team_id    = "********************"
        }

-       user {
-           permission = "admin" -> null
-           username   = "tim-schilling" -> null
        }
-       user {
-           permission = "push" -> null
-           username   = "jezdez" -> null
        }
    }

  # github_repository_collaborators.this["django-fsm-2"] will be updated in-place
  # (imported from "django-fsm-2")
!~  resource "github_repository_collaborators" "this" {
        id             = "django-fsm-2"
!~      invitation_ids = {} -> (known after apply)
        repository     = "django-fsm-2"

        team {
            permission = "admin"
            team_id    = "*******************"
        }
        team {
            permission = "maintain"
            team_id    = "***********************"
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
        team {
            permission = "triage"
            team_id    = "************"
        }

-       user {
-           permission = "admin" -> null
-           username   = "pfouque" -> null
        }
-       user {
-           permission = "push" -> null
-           username   = "adamchainz" -> null
        }
    }

  # github_repository_collaborators.this["django-tailwind-cli"] will be updated in-place
  # (imported from "django-tailwind-cli")
!~  resource "github_repository_collaborators" "this" {
        id             = "django-tailwind-cli"
!~      invitation_ids = {} -> (known after apply)
        repository     = "django-tailwind-cli"

        team {
            permission = "admin"
            team_id    = "**************************"
        }
        team {
            permission = "maintain"
            team_id    = "******************************"
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
        team {
            permission = "triage"
            team_id    = "*******************"
        }

-       user {
-           permission = "admin" -> null
-           username   = "oliverandrich" -> null
        }
    }

  # github_repository_collaborators.this["django-tasks-scheduler"] will be imported
    resource "github_repository_collaborators" "this" {
        id             = "django-tasks-scheduler"
        invitation_ids = {}
        repository     = "django-tasks-scheduler"

        team {
            permission = "admin"
            team_id    = "*****************************"
        }
        team {
            permission = "maintain"
            team_id    = "*********************************"
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
        team {
            permission = "triage"
            team_id    = "**********************"
        }
    }

  # github_repository_collaborators.this["django-typer"] will be updated in-place
  # (imported from "django-typer")
!~  resource "github_repository_collaborators" "this" {
        id             = "django-typer"
!~      invitation_ids = {} -> (known after apply)
        repository     = "django-typer"

        team {
            permission = "admin"
            team_id    = "*******************"
        }
        team {
            permission = "maintain"
            team_id    = "***********************"
        }
        team {
            permission = "pull"
            team_id    = "*************"
        }
        team {
            permission = "triage"
            team_id    = "************"
        }

-       user {
-           permission = "admin" -> null
-           username   = "bckohan" -> null
        }
    }

  # github_repository_collaborators.this["drf-excel"] will be updated in-place
!~  resource "github_repository_collaborators" "this" {
        id             = "drf-excel"
!~      invitation_ids = {} -> (known after apply)
#        (1 unchanged attribute hidden)

-       user {
-           permission = "admin" -> null
-           username   = "FlipperPA" -> null
        }
-       user {
-           permission = "admin" -> null
-           username   = "browniebroke" -> null
        }
-       user {
-           permission = "maintain" -> null
-           username   = "rptmat57" -> null
        }

#        (4 unchanged blocks hidden)
    }

Plan: 6 to import, 0 to add, 6 to change, 0 to destroy.

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

Comment on lines 35 to +37
"django-commons-playground" = {
description = "A sample project to test things out"
topics = []
description = "A sample project with best practices for Django Commons projects."
topics = ["template", "django", "python"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this change, but I'm definitely in favor of renaming this repo or creating a new one that's more explicitly, best-practices

terraform/resources-collaborators.tf Outdated Show resolved Hide resolved
@cunla cunla merged commit 4a10081 into main Nov 5, 2024
2 checks passed
@cunla cunla deleted the support-github-pages branch November 5, 2024 13:05
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.

Support GitHub pages in the terraform management repo
2 participants