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

Fixes sync workflow and syncs YAML with GH #44

Merged
merged 4 commits into from
Aug 24, 2022
Merged

Fixes sync workflow and syncs YAML with GH #44

merged 4 commits into from
Aug 24, 2022

Conversation

galargh
Copy link
Contributor

@galargh galargh commented Aug 24, 2022

I noticed #43 wasn't properly applied. That's because it tried to create a repository that already existed. To pull existing resources under GitHub Management, one has to run the Sync workflow and merge the PR that it creates. That's what I did here. FYI, we want to put sync runs on weekly schedule soon - ipdxco/github-as-code#56

One more thing that I did here was to fix the sync script itself (715f4b3). As it turns out it didn't handle files during repo renames properly.

Finally, I did restore the changes that were supposed to be applied/preserved:

github/ipfs.yml Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Aug 24, 2022

Before merge, verify that all the following plans are correct. They will be applied as-is after the merge.

Terraform plans

ipfs

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  - destroy

Terraform will perform the following actions:

  # github_branch_protection.this["js-kubo-rpc-client:master"] will be created
  + resource "github_branch_protection" "this" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = false
      + id                              = (known after apply)
      + pattern                         = "master"
      + repository_id                   = "R_kgDOH19pZQ"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = false
    }

  # github_branch_protection.this["js-kubo-rpc-client:release"] will be created
  + resource "github_branch_protection" "this" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = false
      + id                              = (known after apply)
      + pattern                         = "release"
      + repository_id                   = "R_kgDOH19pZQ"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = false
    }

  # github_branch_protection.this["js-kubo-rpc-client:release-*"] will be created
  + resource "github_branch_protection" "this" {
      + allows_deletions                = false
      + allows_force_pushes             = false
      + enforce_admins                  = false
      + id                              = (known after apply)
      + pattern                         = "release-*"
      + repository_id                   = "R_kgDOH19pZQ"
      + require_conversation_resolution = false
      + require_signed_commits          = false
      + required_linear_history         = false
    }

  # github_membership.this["reidlw"] will be created
  + resource "github_membership" "this" {
      + etag     = (known after apply)
      + id       = (known after apply)
      + role     = "member"
      + username = "reidlw"
    }

  # github_repository_collaborator.this["js-kubo-rpc-client:SgtPooki"] will be destroyed
  # (because key ["js-kubo-rpc-client:SgtPooki"] is not in for_each map)
  - resource "github_repository_collaborator" "this" {
      - id         = "js-kubo-rpc-client:SgtPooki" -> null
      - permission = "admin" -> null
      - repository = "js-kubo-rpc-client" -> null
      - username   = "SgtPooki" -> null
    }

  # github_repository_file.this["js.ipfs.tech/.github/workflows/stale.yml"] will be created
  + resource "github_repository_file" "this" {
      + branch              = "master"
      + commit_author       = (known after apply)
      + commit_email        = (known after apply)
      + commit_message      = "chore: Update .github/workflows/stale.yml [skip ci]"
      + commit_sha          = (known after apply)
      + content             = <<-EOT
            name: Close and mark stale issue
            
            on:
              schedule:
              - cron: '0 0 * * *'
            
            jobs:
              stale:
            
                runs-on: ubuntu-latest
                permissions:
                  issues: write
                  pull-requests: write
            
                steps:
                - uses: actions/stale@v3
                  with:
                    repo-token: ${{ secrets.GITHUB_TOKEN }}
                    stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
                    close-issue-message: 'This issue was closed because it is missing author input.'
                    stale-issue-label: 'kind/stale'
                    any-of-labels: 'need/author-input'
                    exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
                    days-before-issue-stale: 6
                    days-before-issue-close: 7
                    enable-statistics: true
        EOT
      + file                = ".github/workflows/stale.yml"
      + id                  = (known after apply)
      + overwrite_on_create = true
      + repository          = "js.ipfs.tech"
      + sha                 = (known after apply)
    }

  # github_team_membership.this["w3dt-stewards:reidlw"] will be created
  + resource "github_team_membership" "this" {
      + etag     = (known after apply)
      + id       = (known after apply)
      + role     = "member"
      + team_id  = "4656983"
      + username = "reidlw"
    }

  # github_team_repository.this["Maintainers:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "push"
      + repository = "js-kubo-rpc-client"
      + team_id    = "3729031"
    }

  # github_team_repository.this["Merge - Go:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "push"
      + repository = "js-kubo-rpc-client"
      + team_id    = "3364102"
    }

  # github_team_repository.this["Repos - Go:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "push"
      + repository = "js-kubo-rpc-client"
      + team_id    = "3232508"
    }

  # github_team_repository.this["admin:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "admin"
      + repository = "js-kubo-rpc-client"
      + team_id    = "1516991"
    }

  # github_team_repository.this["contributors:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "pull"
      + repository = "js-kubo-rpc-client"
      + team_id    = "1376970"
    }

  # github_team_repository.this["ipdx:github-mgmt"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "maintain"
      + repository = "github-mgmt"
      + team_id    = "6349983"
    }

  # github_team_repository.this["ipdx:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "admin"
      + repository = "js-kubo-rpc-client"
      + team_id    = "6349983"
    }

  # github_team_repository.this["w3dt-stewards:js-kubo-rpc-client"] will be created
  + resource "github_team_repository" "this" {
      + etag       = (known after apply)
      + id         = (known after apply)
      + permission = "admin"
      + repository = "js-kubo-rpc-client"
      + team_id    = "4656983"
    }

Plan: 14 to add, 0 to change, 1 to destroy.

github/ipfs.yml Outdated Show resolved Hide resolved
github/ipfs.yml Outdated Show resolved Hide resolved
github/ipfs.yml Outdated Show resolved Hide resolved
github/ipfs.yml Outdated Show resolved Hide resolved
@galargh galargh marked this pull request as ready for review August 24, 2022 11:34
@galargh galargh requested a review from a team as a code owner August 24, 2022 11:34
@galargh
Copy link
Contributor Author

galargh commented Aug 24, 2022

Proceeding with this since it only applies maintenance changes/previously approved changes.

@galargh galargh merged commit 33d95e2 into master Aug 24, 2022
@galargh galargh deleted the check-file branch August 24, 2022 11:38
@galargh
Copy link
Contributor Author

galargh commented Aug 24, 2022

@reidlw I should have a new invite to the org in your email now. You should accept it within 7 days.

@BigLep
Copy link
Contributor

BigLep commented Aug 24, 2022

Thanks for handling @galargh and finding ways to make this more robust.

@galargh galargh mentioned this pull request Sep 6, 2022
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.

2 participants