Skip to content

Collect and store repository main branch rules  #147

@UlisesGascon

Description

@UlisesGascon

We need to create a function to collect the main branch information regarding protection rules. This information will be collected when running the workflow upsert-github-repositories (upsertGithubRepositories) (ref) and stored in new (not nullable) columns in github_repositories.

Change needed

  • Create a new function fetchProtectionForBranchInRepo (ref). This will consume the protection endpoint GET https://api.github.com/repos/{owner}/{repo}/branches/{branch}/protection (docs)
  • Add the columns default_branch_allow_fork_syncing, default_branch_lock_branch, default_branch_required_conversation_resolution, default_branch_allow_deletions, default_branch_allow_force_pushes, default_branch_required_linear_history, default_branch_enforce_admins, default_branch_required_pr_reviews_dismiss_stale_reviews, default_branch_required_pr_reviews_require_code_owner_reviews, default_branch_required_pr_reviews_require_code_required_approving_review_count, default_branch_required_pr_reviews_require_last_push_approval in the table github_repositories (as NOT NULLABLES)
  • Include a new JSON Schema validation for this new data that we pull from the API (ref)
  • Include sample data in the fixtures (ref)
  • Include that step into the seed process (ref)
  • Include the new function into upsertGithubRepositories (ref)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions