Skip to content

Platform engineering demo skillset for Copilot Extensions

Notifications You must be signed in to change notification settings

kbridgford/pe-skillset

Repository files navigation

Platform Engineering Copilot Extension - Skillset

This is a small use-case demonstrator for customers to see the capabilities of extensions told through the story of Platform Engineering. It either shows how simple and powerful skillsets can be, or can serve to demonstrate to customer platform engineering teams for example those using a internal developer platform (such as backstage) where extensions can play a part in their Copilot deployments.

A short example of how the extension can be used can be seen below:

GoldenPathsExtension.mp4

The demo shows a scenario where ficticiously this extension serves data from something like an internal developer platform (like backstage) which hosts all the golden paths allowed within a customers enterprise and gets developers started easily and repeatably and within enterprise policies setup to use enteprise specific tooling. In this case it wraps the demo around some small data held in a goldenpaths.json file served from the extension skill API.

Setup

To demo the skillset, you simply need to open the repo in a Codespace and run the code from the terminal with the following command:

npm start

When you run the express based API, you will need to ensure that Codespaces allows access to the endpoint publicly.

It is worth copying into the clipboard the endpoint URL as you will need it when you setup your GitHub App for this skillset. You can grab this from the copy button on the forwarded URL column of the ports tab inside codespace as below:

image

You will see that the API has these endpoints:

endpoint description
/ root endpoint - just there as something to hit, largely not needed
/callback extensions can have a callback URL after authorized, this is just a placeholder
/getgoldenpaths returns a list of golden paths for a given repo
/getgoldenpath returns a single golden path for a given repo
/getterraformstandards returns some demo terraform standards that can be used in the generation of golden paths to conform to some example organization standards

These endpoint you need to configure in a new GitHub App (https://github.com/settings/apps). Give your app a name (e.g. platform-exngineering-extension) - this will be the name used in Copilot Chat i.e. @platform-engineering-extension once you're setup so choose wisely or rename something customer specific for more impact.

The homepage URL can be set to your extension endpoint copied from before.

Similarly, the call back URL can be set to your extension endpoint copied from before and adding /callback to the end.

For some reason Webhook is defaulted to active so deselect this.

Then for App permissions you only need one which is in Account permissions called Copilot Chat.

image

** Worth noting for other extensions/skills you may want Copilot Editor Context, but not for this demo **

For demoing you probably only want this installed on your account so leave at the default but if installing into an org you can put in Any Account before you click the Create GitHub App button.

Now we need to setup the skillset so use the below image as a guide of how to fill out the Copilot tab.

image

Here you can see again you can fill in the callback url with your extension endpoint and /callback. before you add the skills.

For the skills the screen shot shows the name and inference descriptions, buy you'll need the endpoint URL using the ones we discussed earlier to point at each endpoint in the API. and will need to add some json to represent the parameters that will be passed to the API.

The parameters for the getgoldenpaths skill are:

{
 "type": "object",
 "properties": {
   "status": {
     "type": "string",
     "description": "filter golden paths by type (Container, Serverless or Other)",
     "enum": ["Container", "Serverless", "Other"]
   }
 }
}

The parameters for the getgoldenpath skill are:

{
  "type": "object",
  "properties": {
    "PathID": {
      "type": "string",
      "description": "This gets a path id that will be a P followed by a number, for example P0001"
    }
  }
}

The parameter for the getterraformstandards skill is the simplest as it doesn't have any but you still need to setup an empty object:

{ "type": "object" }

With the skills all added and saved, one final step to do is to install the app on your account. You can do this by clicking the Install button on the left hand side of the GitHub App page and accepting the permissions.

image

Head to your IDE or Copilot in GitHub.com and call the extension using the @ symbol followed by the name you gave your app. You can then use the skills you setup to get golden paths, drill into a golden path or generate terraform for a path conforming to standards.

Happy Demoing! 🚀

About

Platform engineering demo skillset for Copilot Extensions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published