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

Update GitHub repositories with git-xargs #1536

Closed
wants to merge 1 commit into from

Conversation

adborden
Copy link
Contributor

@adborden adborden commented Aug 13, 2021

#1513

Use git-xargs to apply changes to GitHub repositories that Tech Portfolio owns.

Testing this out as a replacement for managing GitHub templates in our repos via Terraform. Here's an example of the pull request it would create 18F/ghad#59

What's left?

  • canonical source list of repositories
  • not all templates should be applied universally (see shared_content_ownership)
  • verify the git-xargs binary

Use git-xargs to apply changes to GitHub repositories that Tech Portfolio owns.
@tts-bot
Copy link

tts-bot commented Aug 13, 2021

Terraform plan in terraform

Plan: 1 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:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.repo["aws-admin"].github_repository_file.issue_templates["general.md"] will be updated in-place
  ~ resource "github_repository_file" "issue_templates" {
      ~ content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
          - <!-- Definition of Done. ](https://www.agilealliance.org/glossary/definition-of-done) Should be as objective as possible. -->
          + <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
        id                  = "aws-admin/.github/ISSUE_TEMPLATE/general.md"
        # (9 unchanged attributes hidden)
    }

  # module.repo["ghad"].github_repository_file.issue_templates["general.md"] will be updated in-place
  ~ resource "github_repository_file" "issue_templates" {
      ~ content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
          - <!-- Definition of Done. ](https://www.agilealliance.org/glossary/definition-of-done) Should be as objective as possible. -->
          + <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
        id                  = "ghad/.github/ISSUE_TEMPLATE/general.md"
        # (9 unchanged attributes hidden)
    }

  # module.repo["glossary"].github_repository_file.issue_templates["general.md"] will be created
  + resource "github_repository_file" "issue_templates" {
      + branch              = "master"
      + commit_author       = (known after apply)
      + commit_email        = (known after apply)
      + commit_message      = <<-EOT
            updated from canonical source
            
            https://github.com/18F/tts-tech-portfolio/blob/main/.github/ISSUE_TEMPLATE/general.md
        EOT
      + commit_sha          = (known after apply)
      + content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
            <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
      + file                = ".github/ISSUE_TEMPLATE/general.md"
      + id                  = (known after apply)
      + overwrite_on_create = false
      + repository          = "glossary"
      + sha                 = (known after apply)
    }

  # module.repo["newrelic-terraform"].github_repository_file.issue_templates["general.md"] will be updated in-place
  ~ resource "github_repository_file" "issue_templates" {
      ~ content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
          - <!-- Definition of Done. ](https://www.agilealliance.org/glossary/definition-of-done) Should be as objective as possible. -->
          + <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
        id                  = "newrelic-terraform/.github/ISSUE_TEMPLATE/general.md"
        # (9 unchanged attributes hidden)
    }

  # module.repo["pages-redirects"].github_repository_file.issue_templates["general.md"] will be updated in-place
  ~ resource "github_repository_file" "issue_templates" {
      ~ content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
          - <!-- Definition of Done. ](https://www.agilealliance.org/glossary/definition-of-done) Should be as objective as possible. -->
          + <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
        id                  = "pages-redirects/.github/ISSUE_TEMPLATE/general.md"
        # (9 unchanged attributes hidden)
    }

  # module.repo["private-eye"].github_repository_file.issue_templates["general.md"] will be updated in-place
  ~ resource "github_repository_file" "issue_templates" {
      ~ content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
          - <!-- Definition of Done. ](https://www.agilealliance.org/glossary/definition-of-done) Should be as objective as possible. -->
          + <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
        id                  = "private-eye/.github/ISSUE_TEMPLATE/general.md"
        # (9 unchanged attributes hidden)
    }

  # module.repo["uswds-jekyll"].github_repository_file.issue_templates["general.md"] will be updated in-place
  ~ resource "github_repository_file" "issue_templates" {
      ~ content             = <<-EOT
            ---
            name: General
            about: For general Tech Portfolio work
            title: ""
            labels: "g: initial"
            assignees: ""
            ---
            
            ## Background Information
            
            <!-- Description, links, [user stories](https://www.agilealliance.org/glossary/user-stories/), etc. What is the problem we are trying to solve? If the work is described/tracked elsewhere, feel free to simply link there. Use the [INVEST](https://www.agilealliance.org/glossary/invest) method to assess completeness. -->
            
            ## Implementation Steps
            
            <!-- This is the "how": the steps to get the acceptance criteria fulfilled. They can be filled in and adjusted after the issue is created/groomed. -->
            
            - [ ]
            
            ## Acceptance Criteria
            
          - <!-- Definition of Done. ](https://www.agilealliance.org/glossary/definition-of-done) Should be as objective as possible. -->
          + <!-- [Definition of Done](https://www.agilealliance.org/glossary/definition-of-done). This should be as objective as possible. -->
            
            - [ ]
        EOT
        id                  = "uswds-jekyll/.github/ISSUE_TEMPLATE/general.md"
        # (9 unchanged attributes hidden)
    }

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

Plan generated in plan #145

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