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

Collect and store repository main branch rules #147

Open
6 tasks
UlisesGascon opened this issue Dec 14, 2024 · 1 comment
Open
6 tasks

Collect and store repository main branch rules #147

UlisesGascon opened this issue Dec 14, 2024 · 1 comment

Comments

@UlisesGascon
Copy link
Member

UlisesGascon commented Dec 14, 2024

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)
@UlisesGascon
Copy link
Member Author

We need to research also for #98 as we need some data from the payload too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant