Jon Rumsey

An online markdown blog and knowledge repository.


Project maintained by nojronatron Hosted on GitHub Pages — Theme by mattgraham

GitHub Copilot

This will be a collection of information collected while attending presentations, events, and etc. The first event was an overview of GitHub Copilot at a basic level. Additional topics go into GH Copilot more deeply, providing demonstration, how-tos, and other information.

Table of Contents

Testing With GitHub Copilot

A Microsoft Reactor session.

Presenter: Ochuko Ebenezar Onojakpor, Sr. Technical Writer

Testing is all about checking to ensure something works as defined and expected.

Copilot can help:

Testing Challenges:

Types of Testing:

Write Unit Tests with Copilot

Copilot Spark and Copilot Workspace

GitHub Next is a team that looks at long-bets on technology. Created Spark and Workspace.

Spark:

Workspace:

Copilot Study Guide Series 1

Presenter: Ari LiVigni, Sr. Cloud Solutions Architect, GitHub

GitHub Copilot Plans and Features

Online Refs: https://aka.ms/S-1370

Subscription Plans

Features

IDE Features

Copilot Capabilities Within the IDE

Chat Participants

AI Domain experts that can answer questions:

Slash Commands:

Chat Variables:

Copilot CLI

Copilot Features in GitHub.com

Marketplace Features

GitHub Knowledge Bases

Copilot Study Guide Series 2

Developer use cases for AI with GitHub Copilot

Presenters:

Key Topics:

Stream of Takeaways

This presentation was a combination of summary slides and lots of live coding.

Takeaways and interesting points:

About Github Copilot Enterprise

Enterprise Primary Features

Knowledge Bases:

Custom Models:

Docset:

Code Review:

Enterprise Feature Set

Note: Copilot Code Review is more than just using /explain or free-form chatting with Copilot using an Individual or Business license.

Enabling and Configuring Enterprise Features

Requires:

Steps:

  1. Setup Business account.
  2. Setup Enterprise account (free trial available).
  3. Enable Copilot Enterprise "at the enterprise level".
  4. Configure Copilot Enterprise settings for each GitHub Organization in the enterprise.

Enforcing Policies:

User Access:

Enable/Disable Specific User Access:

Pull Request Summaries:

GitHub Copilot Basics - MSFT Reactor

Presenter: Liam Champton @liamchampton

Presenter: Kory - Cloud Advocate @koreyspace

GitHub Copilot is an AI-powered utility that can help you code, debug, and refactor your solutions.

Note: GitHub and Microsoft are working to develop "Co-Pilots" for many scenarios, other than coding.

Codespaces

Launch And Use Codespaces

In GitHub:

  1. Click Code button
  2. Select Codespaces
  3. Create new

Plans:

There was also mention of the time-limited constraint of 120 hours per month.

Dotfiles

Environment variable files like .env

Templates in Codespaces

Quickstart templates designed to get up-and-running quickly:

Templates are OSS and there is an open invitation to contribute!

Benefits

About Frameworks

Codespaces reduces setup and installation time.

Codespaces also helps with framework setup because n+1 workspaces are just clones of the initial setup!

Cloud Development Challenges

Configure and name the policy and apply it to Codespaces projects to:

Codespaces Environment Benefits

Configurable, customized environment!

Since Codespaces uses a virtual machine behind the scenes, code can be built and executed in the same window.

Multi-window layouts support viewing multiple files within the environment window e.g.: Explorer, README.md, some-file.js, and a Terminal window.

Can open a repository using other IDEs:

Processes That Kick-Off When Creating New

  1. VM and storage are assigned to new Codespace.
  2. Container is created.
  3. Connection to Codespace is made.
  4. Post-creation setup is made.

Components:

Compare With GitHub.dev

Differences from Codespaces:

Codespaces Resources

As of March 2024: Prepare for GitHub Certification Exams.

intro-codespaces repository.

Self-guided Codespaces walkthroughs.

What Can Copilot Do

Copilot Chat:

Demo Notes:

About Prompts, Tokens, and Context:

The GitHub Next Team and Project

VSCodeDay was an event in April 2023, focused on VS Code and some of the Microsoft and GitHub improvements and integrations. The following notes result from watching some of the VS Code Day 2023 presentations.

Whats New WIth Github Next

Presenter: Amelia Wattenberger, Principal Research Engineer, GitHub Next

Amelia created VSCode Extension: Footsteps, as a result of an interview challenge (homework) in 2020. This is published in the Marketplace.

Note: VS Code Extensions might be built in TypeScript.

Check out Your First Extension.

Summary Notes

CoPilot: AI pair-programmer.

GitHub Next team is a prototyping team "build prototypes, not products".

CoPilot started as a set of Panels:

Get familiar with VSCode Primitives to help improve Extension creation process.

GitHub Next is working on LLM-based solutions like:

VSCode Primitives

Contextual Toolbar: CodeLens as an example. Tools that appear in-line or above a code block or segment.

Line Decoration: Colorization, highlighting, etc of line(s) of code. Usually signals something such as in Footsteps extension, it highlights code you've recently edited.

Diagnostic panel: Problems View as an example. Other tools can be put in the Diagnostic Panel, usually related to logging, errors, results from actions, etc.

Webview Panel: The list of tools like Explorer, Extensions like ThunderClient or Azure, the Extensions add/remove tool, Profile/Login status icon, and the Settings icon.

Pragmatic Techniques To Get The Most Out Of GitHub Copilot

Presenters

Allison Weins: Senior Product Manager, GitHub

Burke Holland: Principal Cloud Advocate, Microsoft

Limitations

Single, Specific, Short

Examples via Demos

Provide Effective Intents

Relevent Inputs and Context

Remember: Prompts are limited, so as not to overwhelm the network, or the cloud-based processing.

Highlight Suggestions

  1. Highlight code and the suggestions lightbulb will appear.
  2. Click the lightbulb and Copilot will provide suggestions for the highlighted code.
  3. You have the option to accept or reject the suggestion.

MS Dev Labs Adventures with GitHub Copilot in VSCode

These are notes from a livestream hosted by:

Copilot Adventures

Repo set up with challenges to solve using GitHub Copilot.

There are beginner, intermediate, and advanced level challenges.

CoPilot Chat

Press CTRL + i to launch CoPilot Chat in VSCode or CodeSpaces.

Plaintext inputs:

Slash Commands:

How can GH CoPilot help me?

GitHub Copilot and Infrastructure As Code

Presentation: How to Accelerate Infrastructure As Code Adoption - MSFT Reactor

Presenter: Adil Touati - Sr. Cloud Solution Architect, Montreal CA. GitHub

About GitHub Copilot

Copilot and Copilot Chat:

Advice:

Copilot For IaC - In Action

Use prompt-engineering concepts.

Use #<filename> to reference all related files when prompting Copilot. Lots of files can be referenced.

Highlight code, press CTRL + I and the Inline Prompt will automatically use the highlighted code as part of the question context.

Building Automation With GitHub

Microsoft Reactor session notes from "Building Automation With GitHub"

Presenters:

This session is part of preparation for GitHub Cloud Certification.

There will be more sessions June 12th, 19th, and 26th.

Some notes:

Responsible AI with GitHub Copilot

Goals:

Responsible AI And Governance

Risks of AI:

Governance Over AI:

MSFT and GitHub's Six Principles of Responsible AI:

Key Takeaways

  1. Ensure AI systems are safe, trustworthy, and ethical.
  2. Create AI systems that are easy to understand.
  3. Ensure AI systems perform equally well across all demographic groups.
  4. Address potential biases by reviewing training data, test with balanced samples, and use adversarial debiasing techniques.
  5. Ensure AI systems are transparent, with easy to understand AI processing and decisions.
  6. Ensure generated code aligns with project-specific conventions and requirements.
  7. Fairness, Inclusiveness, Accountability.

Advanced GitHub Copilot Features

List of Advanced Features:

Note: \fix et al are known as implicit prompts.

Note: @workspace uses open files in the editor as additional context.

Note: Github Copilot can also be launched using the Command Palette, providing access to many Copilot functions.

IDE, Chat, and Command Line Techniques

Completion Supported languages

Currently fully supported:

Copilot will understand and could help with most other languages and frameworks - the above are the supported ones.

Suggestions

Copilot Chat

Copilot Chat for Command Line

Offers intelligent suggestions and simplifying tasks:

Common Commands include:

Alias Configuratin:

Organizational Settings:

Copilot Data Handling

Improving Copilot Chat Responses

Management and Customization with Copilot

Copilot Policy and Customization Features

Individual, Business, and Enterprise license Copilot has varying Managemetn and Customization features.

Management Policies:

Customization Features:

Consider these factors when deciding on a plan for your organization:

Safeguarding Code and Data:

Matching Public Code Feature

  1. Go to the Organization's GitHub page.
  2. Open the profile.
  3. Click Enterprise Settings (or Organizational Settings).
  4. Click Copilot.
  5. Select 'Suggestions' drop-down.
  6. Select 'Matching Public Code'
  7. Click 'block'.
  8. Click Save.

Content Exclusions

Can be set at the Repository level (go to Repository Settings), or the Organizational level (load the Organization page and open Settings).

Impacts of exclusing public code:

Balance security and functionality when excluding content:

Troublshoot Common Copilot Issues

Missing Code Suggestions:

Content Exclusion Issues:

Triggering Copilot Suggestions:

Streamline Dev Productivity With Copilot

Boost Dev Productivity

Key areas where Copilot can help with developer productivity:

Minimize Context Switching, and avoid disrupting workflow and reduced focus:

Enhance documentation writing:

Automate 'boring' work:

Personalized code completion:

Align with Developer Preferences

Code Generation and completion:

Unit Tests and Documentation:

Refactoring:

Debugging Assistance:

Data Science Support:

Remember SDLC?

Requirements Analysis:

Design and Development:

Testing and QA:

Deployment:

Maintenance and Support:

Copilot Limitations in SDLC

Code quality and correctness:

Language and framework specificity:

Dependency on training data:

Complex problem solving:

Measuring Productivity Gains

Use the REST API for GitHub Copilot usage metrics!

Code example [Learn.Microsoft.com]:

curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer {TOKEN}" https://api.github.com/enterprises/{ENTERPRISE}/GitHub Copilot/usage

Implement a measurement framework:

  1. Evaluate: Review leading indicators like developer satisfaction and task completion rates. Collect average daily usage and total acceptance rate statisics.
  2. Adopt: Monitor productivity metrics and 'enablement indicators'. Areas where usage training is necessary will become apparent.
  3. Optimization: Use REST API usage metrics to fine-tune Copilot impact.
  4. Sustained Effeciency: Continually evaluate effectiveness using ongoing API monitoring.

Github Copilot Developer Survey advice:

Developing Unit Tests Using Copilot

Copilot Tools is VS Code

Five different ways to interact with Copilot:

Support for Unit Tests using C#:

Enable a Test Framework in VS Code

  1. Create a project (or solution or projects) that has a UnitTest project (use dotnet new xunit ... for example).
  2. Open Command Palette.
  3. Select DotNet: Generate Assets for Build and Debug.

Develop Tests Using Copilot

Open the code file that contains code that will be tested and Copilot will help with these tasks:

Try the following tactics to have Copilot write tests:

Run and Manage Test in VS Code

Run, debug test cases, view test results, and manage test cases using Test Explorer:

References

General Links from 'Level Up Your App Development Using GitHub Copilot and Codespaces' MSFT Reactor Session.

Check out GitHub Next for information on what the GitHub Next team is working on.

Developing Your First Extension.

GitHub CLI supports Github Copilot! See Github Copilot CLI Installer.

Return to Conted Index

Return to Root Readme