Skip to content

Add TypeScript change feed sample#10

Merged
seesharprun merged 10 commits intomainfrom
copilot/implement-typescript-change-feed-sample
Mar 19, 2026
Merged

Add TypeScript change feed sample#10
seesharprun merged 10 commits intomainfrom
copilot/implement-typescript-change-feed-sample

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

Implements the first JavaScript/TypeScript sample in the repo: a self-contained change feed demo using @azure/cosmos v4.

New files

  • javascript/201-change-feed/src/index.ts — ES module with top-level await; connects via key auth, creates cosmicworks DB + products container, upserts two items, then drains the change feed from the beginning using getChangeFeedIterator / ChangeFeedStartFrom.Beginning(), stopping on 304 Not Modified
  • javascript/201-change-feed/package.json"dev" script runs via npx ts-node --esm; no tsconfig.json; all dependencies use floating major-version ranges (^4, ^5, etc.)
  • javascript/201-change-feed/readme.md — run instructions
  • javascript/.gitignore — official Node.js template from github/gitignore

Key snippet

const iterator = container.items.getChangeFeedIterator<Product>({
  changeFeedStartFrom: ChangeFeedStartFrom.Beginning(),
});

while (iterator.hasMoreResults) {
  const { result, statusCode } = await iterator.readNext();
  if (statusCode === 304) break; // caught up
  for (const item of result) {
    console.log(`Changed item:\t${item.id} | ${item.name} | Qty: ${item.quantity}`);
  }
}

Placed under javascript/ (the directory the existing validate-javascript CI job scans) with prefix 201 (Feature usage range).

Original prompt

Start implementation

[Chronological Review: The conversation began with the user requesting a review of a user story and a Teams chat to develop a game plan for a monorepo. The user then defined a numbering standard for samples, requested a breakdown of work into manageable pieces, and delegated tasks to cloud agents for creating validation workflows and code samples. The user also emphasized the need for succinct project updates and the importance of linking to pull requests for details. The conversation progressed to updating comments on Azure DevOps work items, with the user requesting previews of comments before posting and adjustments to verbosity. The user also directed updates to agent specifications and simplifications of tool lists. The most recent requests involved reviewing a work item and planning the implementation of a TypeScript change feed sample.]

[Intent Mapping: The user explicitly requested to review a work item and develop a plan for implementing a TypeScript change feed sample. They indicated that once the plan is ready, they would delegate the implementation to a cloud agent, highlighting the need for proper context.]

[Technical Inventory: The conversation involved various tools and commands, including:

  • Azure DevOps for work item management and comments.
  • GitHub for repository management and code samples.
  • Semantic search for reviewing changes and agent runs.
  • Delegation of tasks to cloud agents for specific implementations and workflows.]

[Code Archaeology: The user referenced specific files and repositories, including the Azure DevOps work item and the agent specification file located at C:\Users\sidandrews.copilot\agents\azure-devops-work-item-manager.agent.md. They also discussed the need for links to code samples in the public repository.]

[Progress Assessment: The user has made significant progress in defining project structure, delegating tasks, and refining communication strategies. They have outlined specific tasks for cloud agents and are preparing to implement a TypeScript sample.]

[Context Validation: All necessary context for continuing work on the TypeScript change feed sample is captured, including the user’s goals for succinctness in updates and the need for proper delegation.]

[Recent Commands Analysis: The last agent commands included:

  • 'semantic_search' to review the work item and gather context for the TypeScript change feed sample.
  • The user requested to review the work item at the provided Azure DevOps link and develop a plan for implementation.
  • The agent was actively working on gathering context and preparing to assist in planning the implementation of the TypeScript sample when the token budget was exceeded.]
1. Conversation Overview: - Primary Objectives: The user aims to implement a TypeScript change feed sample based on a specific work item and has been delegating tasks to cloud agents for various components of the project. - Session Context: The conversation has evolved from initial project planning to detailed task delegation and refinement of communication strategies, focusing on succinctness and clarity in updates. - User Intent Evolution: The user has shifted from broad project planning to specific implementation details, emphasizing the need for proper context and delegation.
  1. Technical Foundation:
  • Azure DevOps: Used for managing work items and comments.
  • GitHub: Referenced for code samples and repository management.
  • Semantic Search: Utilized for reviewing changes and agent runs.
  1. Codebase Status:
  • Agent Specification File: C:\Users\sidandrews.copilot\agents\azure-devops-work-item-manager.agent.md
  • Purpose: To manage Azure DevOps work items and comments.
  • Current State: The user has requested updates to the agent's specification for handling comments and verbosity.
  1. Problem Resolution:
  • Issues Encountered: The user expressed concerns about verbosity in project updates and the need for succinct communication.
  • Solutions Implemented: The user has directed updates to agent specifications and emphasized linking to detailed pull requests for further information.
  1. Progress Tracking:
  • Completed Tasks: The user has defined a numbering standard for samples and delegated tasks to cloud agents.
  • Partially Complete Work: The plan for the TypeScript change feed sample is in development, awaiting further context.
  1. Active Work State:
  • Current Focus: The user is preparing to develop a plan for implementing the TypeScript change feed sample based on the Azure DevOps work item.
  • Recent Context: The user has been refining project updates and delegating tasks to cloud agents while ensuring proper context for future implementations.
  1. Recent Operations:
  • Last Agent Commands: 'semantic_search' to gather context for the TypeScript change feed sample.
  • Tool Results Summary: The agent was actively reviewing the work item and preparing to assist in planning the implementation when the token...

Created from VS Code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement TypeScript change feed sample Add TypeScript change feed sample Mar 19, 2026
Copilot AI requested a review from seesharprun March 19, 2026 12:56
… top-level await

Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
Copilot AI requested a review from seesharprun March 19, 2026 13:30
@seesharprun seesharprun marked this pull request as ready for review March 19, 2026 13:31
Copilot AI review requested due to automatic review settings March 19, 2026 13:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the first JavaScript/TypeScript sample under javascript/, demonstrating how to read an Azure Cosmos DB for NoSQL change feed using @azure/cosmos v4.

Changes:

  • Introduces a TypeScript change feed demo that creates a DB/container, upserts items, and drains the change feed from the beginning.
  • Adds npm project files (package.json + lockfile) to run the sample via ts-node in ESM mode.
  • Adds a javascript/.gitignore suitable for Node.js projects and a README with run instructions.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
javascript/201-change-feed/src/index.ts Implements the change feed demo logic (create resources, upsert items, iterate change feed).
javascript/201-change-feed/readme.md Documents prerequisites and run steps for the sample.
javascript/201-change-feed/package.json Defines the npm project metadata, dependencies, and run script.
javascript/201-change-feed/package-lock.json Locks dependency versions for reproducible installs.
javascript/.gitignore Adds Node.js-specific ignore rules under the javascript/ tree.
Files not reviewed (1)
  • javascript/201-change-feed/package-lock.json: Language not supported

seesharprun and others added 4 commits March 19, 2026 09:53
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sidney Andrews <sidandrews@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sidney Andrews <sidandrews@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sidney Andrews <sidandrews@microsoft.com>
@seesharprun seesharprun enabled auto-merge (squash) March 19, 2026 15:04
@seesharprun seesharprun disabled auto-merge March 19, 2026 15:04
@seesharprun seesharprun merged commit 9566f89 into main Mar 19, 2026
@seesharprun seesharprun deleted the copilot/implement-typescript-change-feed-sample branch March 19, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants