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

Formalize GitHub configurations for pathogen repos #25

Open
joverlee521 opened this issue Jul 15, 2024 · 5 comments
Open

Formalize GitHub configurations for pathogen repos #25

joverlee521 opened this issue Jul 15, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@joverlee521
Copy link
Contributor

joverlee521 commented Jul 15, 2024

Context

Prompted by nextstrain/yellow-fever#7 (comment) and nextstrain/rabies#2 (comment).

Description

We should decide on a default set of GitHub configs that can be formalized in Terraform and applied across pathogen repos that we track in infra. We already add GitHub topic labels through Terraform, seems like a good place to add other configs.

Decide on default configs

Refer to available github_repository arguments.

  • delete_branch_on_merge
  • others?
@joverlee521 joverlee521 added the enhancement New feature or request label Jul 15, 2024
@victorlin
Copy link
Member

victorlin commented Jul 15, 2024

Another one I can think of is labels (mentioned by @tsibley). Both that and "automatically delete head branches" seem applicable to not just pathogen repos but all repos under @nextstrain. Is there a simple way to specify all repos instead of listing every single repo in locals.tf?

@joverlee521
Copy link
Contributor Author

Ah, thanks! I vaguely remember this coming up before but couldn't find the thread.

At least github_issue_labels looks like a resource that applied across the entire GitHub organization.

From what I can see, the github_repository resource is only applied per repo...

@tsibley
Copy link
Member

tsibley commented Jul 17, 2024

Is there a simple way to specify all repos instead of listing every single repo in locals.tf?

You bring in the repos dynamically as a Terraform data source, e.g. here with github_repositories

data "github_repositories" "nextstrain" {
  query = "org:nextstrain"
}

and then apply the per-repo resource (e.g. github_issue_labels) over that dynamic list, e.g.

resource "github_issue_labels" "nextstrain" {
  for_each = data.github_repositories.nextstrain.full_names
  repository = each.key
  …
}

A similar pattern is already used for getting the existing topics for repos in local.pathogen_repos.

@tsibley
Copy link
Member

tsibley commented Jul 17, 2024

At least github_issue_labels looks like a resource that applied across the entire GitHub organization.

It's per-repo, see the arguments and the required repository arg.

@joverlee521
Copy link
Contributor Author

Ah, thanks for the tip + correction @tsibley! So seems pretty do-able!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants