Exercise - Add new property

Completed

In this exercise, you'll extend your connector's schema with additional GitHub-specific properties and reingest the data to see the enhanced information in Microsoft 365.

Learning objective

Add a new property to your connector's schema (such as GitHub issue labels), update the data model and ingestion logic, and rerun the connector to see the enhanced data.

Scenario

Your basic connector is working well, but users want more detailed information about GitHub issues. They want to see issue labels or assignee information to better understand issue context. You'll enhance your connector to capture and index this additional data.

Task 1: Add labels property to the schema

Extend your connector's schema to include GitHub issue labels.

  1. In your VS Code project, open /src/references/schema.json.

  2. Locate the properties array in the schema definition.

  3. Add a new property for labels after the existing properties:

    {
      "name": "labels",
      "type": "stringCollection",
      "isQueryable": true,
      "isSearchable": true,
      "isRetrievable": true
    }
    
  4. Your complete properties array should now include:

    • title
    • url
    • content
    • state
    • number
    • labels (new)
  5. Save the file.

Task 2: Update the data model

Update your TypeScript data model to include the new labels property.

  1. Open /src/models/Item.ts.

  2. Locate the interface definition for your GitHub issue item.

  3. Add a labels property to the interface:

    labels?: string[];
    
  4. Save the file.

Task 3: Modify data transformation logic

Update the data fetching and transformation logic to include labels from the GitHub API.

  1. Open the file in /src/custom/ that handles data transformation (look for GitHub API integration code).

  2. Find the section where GitHub issue data is mapped to your connector's data model.

  3. Add logic to extract and include labels:

    // In the data transformation function
    labels: issue.labels?.map(label => label.name) || []
    
  4. This extracts the label names from GitHub's label objects and creates a string array.

  5. Save the file.

Task 4: Redeploy schema and reingest data

Run your connector again to deploy the updated schema and ingest data with the new property.

  1. Stop any currently running connector instances.

  2. In the VS Code terminal, build your project:

    npm run build
    
  3. Press F5 to start the connector again.

  4. The connector will:

    • Update the existing external connection with the new schema
    • Reingest all GitHub issues with the enhanced data including labels
  5. Monitor the terminal output to see the ingestion progress with the new labels property.

  6. Wait for the process to complete (5-15 minutes).

Task 5: Verify enhanced data in Microsoft 365

Check that your GitHub issues now include label information.

  1. Go to Microsoft 365 Admin Center > Search & intelligence > Data sources.

  2. Find your GitHub Issues Connector and select on it.

  3. Verify that the schema now includes the labels property.

  4. Check that the items count reflects the reingestion.

Task 6: Test enhanced Copilot queries

Test whether Copilot can now use the labels information in its responses.

  1. Open Microsoft 365 Copilot.

  2. Try queries that reference labels:

    • "What Microsoft 365 Agents Toolkit samples issues are labeled as bugs?"
    • "Show me issues with the 'feature request' label in the Microsoft 365 Agents Toolkit samples repository"
    • "What are the most common labels on issues in the Microsoft 365 Agents Toolkit samples repository?"
  3. Observe whether Copilot's responses now include label information and can filter by labels.

Optional challenge: Add assignee property

If you want to go even further, add an assignee property following the same pattern on your own.

  1. Add assignee property to schema.json:

    {
      "name": "assignee",
      "type": "string",
      "isQueryable": true,
      "isSearchable": true,
      "isRetrievable": true
    }
    
  2. Update the data model and transformation logic to include assignee: issue.assignee?.login || "Unassigned".

  3. Redeploy and test queries about issue assignments.

What you've accomplished

You've successfully enhanced your connector with additional GitHub-specific data. Your accomplishments include:

  • Extended the schema - Added new properties to capture more detailed GitHub issue information

  • Updated data model - Modified TypeScript interfaces to support the new data

  • Enhanced transformation logic - Updated code to extract and map additional GitHub API data

  • Re-deployed successfully - Updated the live connector with the new schema and data

  • Verified enhanced functionality - Confirmed that Copilot can now use the additional information

Your connector now provides richer, more useful data about GitHub issues, making it more valuable for users who need detailed issue context in Microsoft 365 Copilot.