Adds branch protection and webhook count#8
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances the migration validator tool by adding support for validating two new repository metrics: branch protection rules count and webhooks count. These metrics help ensure that repository security configurations and integrations are properly migrated between source and target repositories.
Key changes include:
- Added branch protection rules and webhooks fields to the RepositoryData struct
- Implemented new API methods to fetch these metrics using GraphQL and REST APIs
- Updated validation logic to compare these metrics between repositories
- Enhanced CSV export to include the new metrics in output
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/validator/validator.go | Added BranchProtectionRules and Webhooks fields to RepositoryData struct and implemented retrieval/validation logic |
| internal/validator/validator_test.go | Updated test data to include the new metrics in all test scenarios |
| internal/api/api.go | Implemented GetBranchProtectionRulesCount and GetWebhookCount methods for fetching metrics |
| internal/api/api_test.go | Added comprehensive tests for the new API methods |
| internal/export/export.go | Updated CSV export to include branch protection rules and webhooks counts |
| README.md | Updated documentation to reflect the new metrics in output examples and feature descriptions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This pull request adds support for validating and exporting two new repository metrics: the count of branch protection rules and the count of webhooks. These metrics are now retrieved from both source and target repositories, compared during validation, included in the CSV export, and covered by new and expanded tests. Documentation has also been updated to reflect these additions.
Checklist
Additional Context
Repository metrics enhancements:
BranchProtectionRulesandWebhooksfields to theRepositoryDatastruct, and updated both the source and target repository data retrieval methods to fetch and store these new metrics. [1] [2] [3]GetBranchProtectionRulesCount(GraphQL) andGetWebhookCount(REST) methods ininternal/api/api.goto retrieve these metrics from GitHub.Validation and reporting:
Export and documentation:
README.mdwith documentation and example output for the new metrics. [1] [2]