このガイドは、エンジニアリング システムの改善を推進するための戦略とメトリックを推奨する GitHub の「Engineering System Success Playbook (エンジニアリング システム サクセス プレイブック)」(ESSP) からヒントを得ています。
Copilot のロールアウトを開始する場合は、目標を定義し、それに応じてロールアウトを計画し、スタッフに目標を明確に伝えることをお勧めします。 「GitHub Copilot を使って会社のエンジニアリング目標を達成する」をご覧ください。
1. Identify barriers to success
ESSP が推奨する最初の手順は、会社の改善を妨げている障害を明確に理解することです。 現在のベースライン、目的とする将来の状態、進歩を妨げる障壁を理解することで、的を絞った効果的な変更を行うことができます。
Teams often experience delays in merging pull requests due to lengthy review cycles. These delays often stem from:
- Complex code changes that are difficult to understand
- Inconsistent code formatting that makes reviews challenging
- A general lack of context provided with the changes
- Social factors that contribute to slow or hard-to-address reviews
Reviewers can also easily miss small errors that may lead to production issues.
This leads to bottlenecks in the development process and slows down the overall delivery and quality of features.
2. Evaluate your options
次の手順は、手順 1 で特定した障壁に対処するための解決策を評価し、同意することです。 このガイドでは、GitHub Copilot で特定した目標に与える影響に焦点を当てます。 新しいツールの導入を成功させるには、カルチャやプロセスの変更も必要であることに留意してください。
パイロット グループで新しいツールとプロセスの試験を実施し、フィードバックを収集して成功を測定します。 試用版で使うトレーニング リソースとメトリックについては、「3. 変更を実装する」と「監視するメトリック」セクションを参照してください。
How Copilot can help
GitHub Copilot offers a suite of features designed to accelerate the pull request review process, enhance code quality, and improve collaboration, ultimately leading to faster merge times.
By leveraging Copilot's capabilities, teams can streamline their workflows, reduce friction, and ensure consistent, high-quality code.
Generates complete and helpful PR summaries
Copilot can automatically generate clear and concise PR summaries, saving developers time and ensuring that the purpose and changes of the PR are easily understood by reviewers. This reduces the likelihood of misunderstandings and speeds up the review process.
Assists reviewers during their review process
GitHub Copilot can be used as a powerful PR review companion.
- Copilot can help explain complex code changes so that reviewers more quickly understand what the PR is contributing.
- Copilot can provide repository-wide, context-aware suggestions and potential code improvements directly within the pull request review interface on GitHub, helping reviewers catch potential issues and offer constructive feedback more efficiently.
- Copilot can help reviewers draft and write clear, consistent, and effective review comments.
Reviews based on organization guidelines
- Copilot can review code changes in your IDE before opening a pull request, or be assigned as reviewer to a pull request.
- With rulesets, you can set up Copilot to systematically review pull requests based on custom criteria.
- With coding guidelines for reviews (Copilot Enterprise only), Copilot can enforce organizational coding standards and best practices, automatically flagging potential violations and suggesting fixes.
These features ensure consistency across the codebase and help you catch errors early in the development process, reducing the need for manual code reviews and saving time for developers and reviewers.
Suggests code fixes
Based on a pull request review comment, Copilot can help pull request authors quickly implement the required code changes to resolve the review.
Cultural considerations
GitHub Copilot のロールアウトに加えて、目標を達成できない可能性のある社会的または文化的要因にも対処する必要があります。
次の例は、ESSP の "アンチパターン" に関するセクションから抜粋したものです。
- Teams might wait too long to release, deploying large batches of code at once. This could be caused by a fear of destabilization with frequent releases, a lack of CI/CD pipeline maturity, or strict compliance requirements.
- Developers might spend too long perfecting code or adding unnecessary features. This could be caused by a culture of perfectionism or a lack of effective prioritization.
- Developers might build overly complex solutions for simple problems. This could be caused by a desire to future-proof unnecessarily, or pressure to add value through complexity.
3. Implement changes
障害を克服するための適切なアプローチを特定したら、特定したソリューションを拡大します。 新しいツールやプロセスのロールアウトを成功させるには、ロールアウトの各部分に所有権を割り当て、目標について率直にコミュニケーションを取り、効果的なトレーニングを提供し、成果を測定することが重要です。
このセクションでは、開発者向けのシナリオ例、ベスト プラクティス、リソースについて説明します。 このセクションを使って、従業員が目標に沿った方法で Copilot を使用できるように、コミュニケーションとトレーニング セッションを計画することをお勧めします。
- Create helpful pull request summaries
- Use Copilot as a review assistant
- Add Copilot as a reviewer
- Get help implementing review comments
- Best practices for developers
- Resources
Create helpful pull request summaries
- When creating a pull request, click the Copilot icon in the "Add a description" field, then click Summary.
- Copilot will scan through the pull request and provide an overview of the changes made in prose, as well as a bulleted list of changes with the files that they impact.
- Check you're happy with Copilot's description.
- When reviewers come to your pull request, they'll have all the context they need to leave a review.
Use Copilot as a review assistant
When jumping into a pull request as a reviewer, you can use Copilot to speed up your review.
-
Use Copilot to understand the changes in the pull request.
-
Ask Copilot to summarize the changes made to a file, particularly helpful for longer diffs. You can pick a specific file from the diff by clicking on the top-right corner of the file.
-
For changes in specific lines, highlight the lines you want to better understand and ask Copilot to explain the changes to you. You can highlight a set of lines by clicking on the uppermost line number first, holding your SHIFT key, and then clicking on the lowermost line of the diff.
-
-
Collaborate on your PR review with Copilot. Don't forget to attach the specific file diffs to the conversation before prompting Copilot.
-
You can ask Copilot for its own opinion on the PR changes by asking:
Provide your judgement as a PR Reviewer, both for functional and non-functional aspects that these changes bring
. Note how this prompt asks Copilot to consider both functional and non-functional aspects of the code. -
For your own PR review comments, ask Copilot for a second opinion:
As my peer reviewer on this pull request, give me your feedback on my own review: YOUR-REVIEW-COMMENT. Do you think it's pertinent? Am I missing something?
-
-
Collaborate with Copilot to draft and refine your review comments.
- After planning the review with Copilot, you can ask to list the comments that you should provide:
Make a list of review comments to add to the PR and tell me exactly in which file diff and lines each comment should be added
. - You can also ask Copilot to create a first draft of a review comment you have in mind or refine a comment before you post it:
Help me draft review comments as discussed
orRefine this review comment to make it clear, concise, and actionable
.
- After planning the review with Copilot, you can ask to list the comments that you should provide:
Add Copilot as a reviewer
To reduce review times and merge pull requests faster, use Copilot code reviews systematically: first in the IDE before opening the pull request, then on the PR in GitHub.
Using Copilot code review does not replace the need for human code review. However, following the steps above can help humans complete their reviews faster.
- Developers should request a review of all their changes using Copilot code review before opening a pull request.
- Administrators should set up repository or organization rulesets to automatically add Copilot as a reviewer on any pull request targeting protected branches.
- Team leads should capture their team's standard style and rules and set them as coding guidelines for the organization so that Copilot can leverage them in reviews.
- Ensure your coding guidelines capture a minimum set of styling recommendations that make code more readable, which will help during the pull request review process.
- To reduce the amount of PR review comments due to styling issues, set the same recommendations in Copilot instructions at the repository and organization level. This way, the code generated by Copilot will conform to these guidelines.
Get help implementing review comments
Pull request authors can speed up resolution of PR review comments by quickly implementing fixes with Copilot's assistance.
- For any review comments left by Copilot itself, either commit the proposed fix directly, or edit it in Copilot Workspace before committing.
- For any review comments left by peers, navigate to the file diff related to the PR review comment and attach the diff to a Copilot Chat conversation. Then, copy paste the review comment with a prompt like this:
Suggest a fix for this review comment:
- If you are using VS Code, ask GitHub Copilot in agent mode to implement the required changes from the review comment.
Best practices for developers
Developers should:
- Request Copilot's review in your IDE before pushing to catch and resolve issues early.
- Use Copilot to plan and refine your own PR review comments to help PR authors understand and resolve issues.
- Attach relevant diff context, including specific lines of code, to your conversations with Copilot.
Developers should not:
- Apply Copilot's suggestions without testing.
- Rely solely on Copilot for reviews.
- Neglect code readability.
Resources
- GitHub Copilot で pull request の概要を作成する
- GitHub Copilot コード レビューの使用
- GitHub Copilot コード レビューのコーディング ガイドラインの構成
- Copilot を使って自動コード レビューを構成する
- GitHub Copilot に対する organization カスタム指示の追加
Metrics to watch
新しいツールの試用版を評価し、完全なロールアウトによって一貫した改善が実現されていることを確認するには、結果を監視し、必要に応じて調整を行う必要があります。 一般に、品質、速度、開発者の満足度という主要なゾーンを考慮し、これらのゾーンがどのように連携してビジネス成果に貢献するかを検討することをお勧めします。
この特定の目標に対する Copilot の影響を評価するために、検討することをお勧めするメトリックをいくつか示します。
- Developer satisfaction: Use developer surveys to measure satisfaction with engineering tooling.
- Pull requests merged per developer: You can use GitHub's
pull request
webhook, ensuringaction
isclosed
and themerged
property insidepull request
object istrue
. - Pull requests lead time: Measure the average length of time between PR creation and merge.