Skip to content

Commit 6dd0dfd

Browse files
Merge branch 'main' into feature/fork-ci-split
Resolves CONTRIBUTING.md conflict by placing the new fork-CI documentation (### How CI works for pull requests from forks, ### Working on the pipeline split itself) under ## Contribution flow, ahead of the new ## Changelog entry section that was added to main in PR #5864. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2 parents 56b2adf + 85a417e commit 6dd0dfd

37 files changed

Lines changed: 1991 additions & 1648 deletions

.github/agents/release-copilot-agent.agent.md

Lines changed: 0 additions & 902 deletions
This file was deleted.

.github/copilot-instructions.md

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,64 @@ Purpose: quick, actionable context so an AI coding assistant can be immediately
4848
- `[v4] Client Encryption: Refactors code to external project`
4949
- `[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future`
5050
- Keep changes minimal and focused; prefer small, targeted edits and follow existing code style.
51+
- **Changelog entry required**: Every PR that modifies the shipped package
52+
source (anything under `Microsoft.Azure.Cosmos/src/**`, equivalent paths
53+
for FaultInjection / Encryption packages) must also add a bullet under
54+
`### Unreleased` in `changelog.md`, in one of the four subsections
55+
`Features Added` / `Breaking Changes` / `Bugs Fixed` / `Other Changes`.
56+
Write the entry in **customer-facing language** — not the PR title
57+
verbatim. If the change has zero customer-observable impact (test-only,
58+
doc-only, CI-only, purely internal refactor), check the "No changelog
59+
entry required" box in the PR template and justify briefly. If a
60+
preview-only change might affect default-config semantics for any
61+
customer in the next two minor releases, it does **not** qualify as
62+
purely internal — it goes under `Other Changes` (or `Bugs Fixed` /
63+
`Breaking Changes` as appropriate).
64+
- **Changelog classifier** (apply when uncertain whether an entry is required):
65+
66+
1. Does the PR diff touch any of:
67+
- `Microsoft.Azure.Cosmos/src/**`
68+
- `Microsoft.Azure.Cosmos/FaultInjection/src/**`
69+
- any other shipped-package source tree?
70+
71+
*No* ⇒ no entry required. Done.
72+
*Yes* ⇒ continue.
73+
74+
2. Could a customer observe the change by upgrading the SDK and
75+
running their existing workload (no code change on their side)?
76+
Consider: behavior, return values, error shape, latency,
77+
memory/CPU profile, allocation patterns, surfaced types, public
78+
API.
79+
80+
*Yes***entry required**. Pick the subsection:
81+
- New customer-opt-in functionality ⇒ `Features Added`
82+
- Behavior change that could break customer expectations on upgrade ⇒ `Breaking Changes`
83+
- Customer-observable defect fixed ⇒ `Bugs Fixed`
84+
- Performance / dependency / observable-but-not-categorized ⇒ `Other Changes`
85+
86+
*No* (test-only, CI-only, doc-only, pure internal refactor that
87+
passes the next test) ⇒ no entry required. Document the omission
88+
in the PR description.
89+
90+
3. **Preview-feature carve-out.** If the change is to a preview-only
91+
code path *and* it could affect default-config semantics for any
92+
customer in the next two minor releases, treat it as customer-
93+
observable and require an entry under `Other Changes`. PR #5310
94+
(PPAF dynamic enablement preview that affected default-config
95+
memory) is the canonical example.
96+
97+
4. **Unsure after applying steps 1–3?** Default to **leaving a
98+
non-blocking comment** on the PR asking the reviewer to confirm:
99+
100+
> "Changelog classifier outcome is ambiguous for this diff
101+
> (touches shipped src but customer impact unclear). Defaulting
102+
> to **no entry**; please verify and add one if needed."
103+
104+
Do **not** silently skip an entry on an ambiguous case — the
105+
comment is the signal.
106+
107+
This rubric is mirrored in `CONTRIBUTING.md` (the human-author
108+
audience). The two must stay in sync.
51109
- When suggesting build/test changes, reference the relevant MSBuild property or pipeline YAML (point to `Directory.Build.props` or `templates/*`).
52110
- Do not change version numbers or packaging settings without explicit instruction — these are centrally managed.
53111
- If adding or modifying tests that require the emulator, include/update relevant CI/template steps and document required environment variables.
@@ -60,10 +118,7 @@ Purpose: quick, actionable context so an AI coding assistant can be immediately
60118
- **IssueFixAgent** (`.github/agents/issue-fix-agent.agent.md`) — Comprehensive workflow for triaging and fixing GitHub issues. Use `@IssueFixAgent` in VS Code Copilot Chat or follow the plan manually.
61119
- Includes: environment setup, issue investigation, fix implementation, testing requirements, PR workflow, and learnings capture.
62120
- Start with: `@IssueFixAgent investigate issue #XXXX` or see Quick Start in the agent file.
63-
- **ReleaseCopilotAgent** (`.github/agents/release-copilot-agent.agent.md`) — Guides the team through full releases and hotfix releases of the Cosmos DB .NET SDK. Automates changelog generation, version bumping, API contract file generation (GenAPI), and PR creation.
64-
- Three modes: **Minor Mode** (full GA + Preview release), **Hotfix Mode** (cherry-pick patch release on any previous version), and **Add Missed PRs** (add PRs that were missed in a previous changelog).
65-
- In VS Code Copilot Chat: `@ReleaseCopilotAgent start minor`, `@ReleaseCopilotAgent start hotfix`, or `@ReleaseCopilotAgent add missed PRs`.
66-
- In the Copilot CLI: describe the task naturally (e.g., "I want to start a minor release", "start hotfix", or "I need to add missed PRs to a release"). The agent instructions are loaded automatically via this file.
121+
- **Release flows** for the Cosmos DB .NET SDK + Microsoft.Azure.Cosmos.FaultInjection package live in the [cosmos-sdk-copilot-toolkit](https://github.com/Azure/cosmos-sdk-copilot-toolkit) under skills `cosmos-release-dotnet` (main SDK: minor / hotfix / add-missed-PRs modes) and `cosmos-release-dotnet-faultinjection` (FaultInjection package). The in-repo `release-copilot-agent.agent.md` was retired to avoid drift; both skills are the canonical source. In the Copilot CLI: describe the task naturally ("start a minor release", "release fault injection beta", etc.) — the routing agent loads the right skill automatically.
67122
- **MsdataDirectSyncAgent** (`.github/agents/msdata-direct-sync-agent.agent.md`) — Orchestrates syncing the msdata/direct branch with the latest v3 main and msdata direct codebase.
68123
- In VS Code Copilot Chat: `@MsdataDirectSyncAgent sync msdata/direct`.
69124
- In the Copilot CLI: describe the task naturally (e.g., "sync the msdata/direct branch with main").
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Changelog Check (soft, non-blocking)
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
6+
paths:
7+
- 'Microsoft.Azure.Cosmos/src/**'
8+
- 'Microsoft.Azure.Cosmos/FaultInjection/src/**'
9+
- 'changelog.md'
10+
- 'Microsoft.Azure.Cosmos/FaultInjection/changelog.md'
11+
12+
permissions:
13+
pull-requests: write
14+
contents: read
15+
16+
jobs:
17+
changelog-soft-check:
18+
runs-on: ubuntu-latest
19+
if: "!contains(github.event.pull_request.labels.*.name, 'no-changelog-needed')"
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Detect which packages were touched
27+
id: detect
28+
run: |
29+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
30+
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
31+
CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
32+
33+
MAIN_SRC=$(echo "$CHANGED" | grep -E '^Microsoft\.Azure\.Cosmos/src/' || true)
34+
FI_SRC=$(echo "$CHANGED" | grep -E '^Microsoft\.Azure\.Cosmos/FaultInjection/src/' || true)
35+
MAIN_CL=$(echo "$CHANGED" | grep -E '^changelog\.md$' || true)
36+
FI_CL=$(echo "$CHANGED" | grep -E '^Microsoft\.Azure\.Cosmos/FaultInjection/changelog\.md$' || true)
37+
38+
MAIN_MISSING=$([[ -n "$MAIN_SRC" && -z "$MAIN_CL" ]] && echo "true" || echo "false")
39+
FI_MISSING=$([[ -n "$FI_SRC" && -z "$FI_CL" ]] && echo "true" || echo "false")
40+
41+
echo "main_missing=$MAIN_MISSING" >> "$GITHUB_OUTPUT"
42+
echo "fi_missing=$FI_MISSING" >> "$GITHUB_OUTPUT"
43+
44+
- name: Post (or update) soft-check comment
45+
if: steps.detect.outputs.main_missing == 'true' || steps.detect.outputs.fi_missing == 'true'
46+
uses: marocchino/sticky-pull-request-comment@v2
47+
with:
48+
header: changelog-soft-check
49+
message: |
50+
## :memo: Changelog reminder (non-blocking)
51+
52+
This PR touches shipped source but does not appear to update the
53+
corresponding `changelog.md`.
54+
55+
Touched (and missing entry for):
56+
${{ steps.detect.outputs.main_missing == 'true' && '- `Microsoft.Azure.Cosmos/src/**` ⇒ expected an entry in `changelog.md` (`### Unreleased`)' || '' }}
57+
${{ steps.detect.outputs.fi_missing == 'true' && '- `Microsoft.Azure.Cosmos/FaultInjection/src/**` ⇒ expected an entry in `Microsoft.Azure.Cosmos/FaultInjection/changelog.md` (`### Unreleased`)' || '' }}
58+
59+
### How to decide
60+
61+
Use the rubric in `.github/copilot-instructions.md` ("Changelog
62+
classifier") or in `CONTRIBUTING.md` ("Changelog entry"). Quick
63+
version:
64+
65+
- Customer-observable change (behavior, perf, memory, API) ⇒ **add an entry**, even if the PR is `[Internal]`.
66+
- Test-only / CI-only / doc-only / pure-internal-refactor with zero customer-observable effect ⇒ no entry, add the `no-changelog-needed` label to silence this check.
67+
- **Unsure?** Default to adding a one-line entry under `#### Other Changes`. Reviewer will adjust.
68+
69+
This check is **non-blocking** — merge is not gated on it. The
70+
reviewer is responsible for the final classification.

.github/workflows/prlint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
on-failed-regex-create-review: true
2121
on-failed-regex-comment: >
2222
Please follow the required format: \"[Internal] Category: (Adds|Fixes|Refactors|Removes) Description\"<br /><br />
23-
Internal should be used for PRs that have no customer impact. This flag is used to help generate the changelog to know which PRs should be included.
23+
The `[Internal]` prefix is a review hint indicating no customer-observable impact (test pipelines, CI, doc-only changes, pure internal refactors). It does **not** affect changelog generation — the changelog is maintained per-PR in `### Unreleased` of `changelog.md`. See CONTRIBUTING.md for the full `[Internal]` definition and the preview-feature carve-out.
2424
Examples:<br />
25-
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics<br/>
26-
PartitionKey: Fixes null reference when using default(PartitionKey)<br/>
25+
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics<br/>
26+
PartitionKey: Fixes null reference when using default(PartitionKey)<br/>
2727
[v4] Client Encryption: Refactors code to external project<br/>
2828
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.<br/>

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,6 @@ ASALocalRun/
331331

332332
# Visual Studio Code files
333333
.vscode/
334+
335+
# Coding Agent Harness session artifacts (local-only)
336+
.coding-harness/

CONTRIBUTING.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,109 @@ and surfaced through [`azure-pipelines-live-account.yml`](azure-pipelines-live-a
138138
plus the trusted internal pipelines (`azure-pipelines-official.yml`,
139139
`azure-pipelines-rolling.yml`).
140140

141+
## Changelog entry
142+
143+
Every pull request that changes shipped behavior must add a changelog
144+
entry. This is the same pattern used by the Cosmos DB SDKs for Java
145+
(`azure-sdk-for-java/sdk/cosmos/azure-cosmos/CHANGELOG.md`) and Python
146+
(`azure-sdk-for-python/sdk/cosmos/azure-cosmos/CHANGELOG.md`).
147+
148+
### Where to add it
149+
150+
`changelog.md` has a `### Unreleased` section at the top of the "Release
151+
notes" block. Underneath are four subsections:
152+
153+
- `#### Features Added` — new functionality customers can opt into.
154+
- `#### Breaking Changes` — anything that could break a customer's
155+
build, behavior, or expectations on upgrade.
156+
- `#### Bugs Fixed` — defects fixed in shipped behavior.
157+
- `#### Other Changes` — behavioral or performance changes that
158+
customers should know about but that aren't features or bugs.
159+
Refactors with observable effects, dependency bumps with
160+
customer-visible behavior changes, etc.
161+
162+
Add your bullet under the matching subsection.
163+
164+
If your PR touches `Microsoft.Azure.Cosmos/FaultInjection/src/**` instead
165+
of (or in addition to) the main SDK source, add your bullet to
166+
`Microsoft.Azure.Cosmos/FaultInjection/changelog.md` under its own
167+
`### Unreleased` section.
168+
169+
### How to write it
170+
171+
- One line per change.
172+
- Customer-facing language. The audience is the developer running
173+
`dotnet add package Microsoft.Azure.Cosmos`, not a teammate
174+
reviewing your PR.
175+
- Reference the PR by number with a link:
176+
`See [PR 1234](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1234).`
177+
- The PR title and the changelog entry are **not the same thing**. The
178+
title is engineering shorthand; the entry is a release-note line.
179+
180+
Example:
181+
182+
| PR title (engineering) | Changelog entry (customer-facing) |
183+
|---|---|
184+
| `DocumentClient: Adds tests for PartitionKeyRangeLocation disposal` | `Fixes per-CosmosClient memory and CPU leak introduced in 3.53.0 by disposing GlobalPartitionEndpointManagerCore. See [PR 5778](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5778).` |
185+
186+
### Default verb → subsection mapping
187+
188+
When the change has no other obvious classification, use the verb in your
189+
PR title as a starting point:
190+
191+
| PR title verb | Default subsection |
192+
|---|---|
193+
| `Adds` (customer-visible) | Features Added |
194+
| `Adds` (internal refactor, no observable effect) | Other Changes (often omit) |
195+
| `Fixes` (customer-visible defect) | Bugs Fixed |
196+
| `Removes` (public API removal) | Breaking Changes |
197+
| `Removes` (internal/private code) | Other Changes (often omit) |
198+
| `Refactors` | Other Changes (omit if no observable effect) |
199+
200+
The verb regex enforced by `.github/workflows/prlint.yml` still governs
201+
the PR title, but the PR title no longer drives the changelog content.
202+
203+
### When the `[Internal]` prefix is appropriate
204+
205+
`[Internal]` in the PR title is reserved for changes with **no
206+
customer-observable impact**:
207+
208+
- Test-pipeline / CI / build-tooling changes.
209+
- Internal refactors that do not change runtime behavior, allocations,
210+
memory profile, CPU profile, or surfaced types.
211+
- Documentation-only changes inside the repo (not changelog).
212+
213+
`[Internal]` is **not** appropriate for:
214+
215+
- Any change to `Microsoft.Azure.Cosmos/src/**` that a customer could
216+
observe by running their workload under different SDK versions, even
217+
if the change is to an "internal" type. PR #5310 (PPAF dynamic
218+
enablement, which changed `DocumentClient` reference semantics from
219+
weak to strong) is the canonical anti-example — the change was
220+
preview-internal but had load-bearing customer-observable effects.
221+
222+
**Preview-feature carve-out:** if a preview-only change might affect
223+
default-config semantics for any customer in the next two minor
224+
releases, it does not qualify as `[Internal]` — it goes under
225+
`Other Changes` (or `Bugs Fixed` / `Breaking Changes` as appropriate).
226+
227+
### What reviewers verify
228+
229+
When reviewing a PR, check:
230+
231+
1. The "Changelog" section of the PR description is filled in.
232+
2. If an entry was added: it is in the right subsection, the language
233+
is customer-facing, and the bullet links to the PR.
234+
3. If the author chose "No changelog entry required": the justification
235+
is genuine (test-only, doc-only, CI-only, or pure internal refactor
236+
with no customer-observable effect).
237+
238+
### Conflicts in `### Unreleased`
239+
240+
If two PRs add bullets to the same subsection of `### Unreleased` you
241+
may see a merge conflict. Take both bullets — the order is not
242+
significant.
243+
141244
### Test failures
142245

143246
If the Pull Request is experiencing test failures, these will appear as failed checks:

Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,14 +768,15 @@ public override Task<IEnumerable<string>> GetPartitionKeyRangesAsync(
768768
{
769769
return this.Container.GetPartitionKeyRangesAsync(feedRange, cancellationToken);
770770
}
771+
#endif
771772

773+
#if ENCRYPTIONPREVIEW || SDKPROJECTREF
772774
public override ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes<T>(string processorName, ChangeFeedHandler<ChangeFeedItem<T>> onChangesDelegate)
773775
{
774-
throw new NotImplementedException();
776+
return this.Container.GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes(
777+
processorName,
778+
onChangesDelegate);
775779
}
776-
#endif
777-
778-
#if SDKPROJECTREF
779780

780781
public override Task<bool> IsFeedRangePartOfAsync(
781782
Cosmos.FeedRange x,

Microsoft.Azure.Cosmos/FaultInjection/changelog.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,34 @@ This project is in beta. The API and functionality may change when the project i
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
### <a name="unreleased-faultinjection"/> Unreleased
9+
10+
#### Features Added
11+
12+
#### Breaking Changes
13+
14+
#### Bugs Fixed
15+
16+
#### Other Changes
17+
818
### <a name="1.0.0-beta.1"/> [1.0.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.FaultInjection/1.0.0-beta.1) - 2026-04-30
919

10-
#### Added
20+
#### Features Added
1121
- [#4867](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4867) FaultInjection: Adds method to add FaultInjection using CosmosClientBuilder
1222
- [#4989](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4989) Metadata Requests: Adds Metadata request support for FaultInjection
1323
- [#5264](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5264) ThinClient Compatibility: Adds compatibility with Thin Client Proxy
1424
- [#5510](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5510) Unauthorized Errors: Adds Unauthorized status codes
1525
- [#5677](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5677) FaultInjection: Adds XML documentation, stylecop.json, and updates test packages
1626
- [#5679](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5679) FaultInjection: Adds comprehensive unit test coverage
1727

18-
#### Fixed
28+
#### Bugs Fixed
1929
- [#5676](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5676) FaultInjection: Fixes naming typos and XML documentation
2030
- [#5675](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5675) FaultInjection: Fixes critical bugs for release 2
2131
- [#5678](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/5678) FaultInjection: Refactors code quality improvements
2232

2333
### <a name="1.0.0-beta.0"/> [1.0.0-beta.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.FaultInjection/1.0.0-beta.0) - 2024-11-15
2434

25-
#### Added
35+
#### Features Added
2636

2737
- Support for fault injection in the Cosmos SDK.
2838
- Support for fault injection in Direct Mode.

Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ internal ChangeFeedMode()
5353
/// but no events for deletes or intermediary updates would be included.
5454
/// </remarks>
5555
/// <returns>A <see cref="ChangeFeedMode"/> to receive notifications for insertions, updates, and delete operations.</returns>
56-
#if PREVIEW
57-
public
58-
#else
59-
internal
60-
#endif
61-
static ChangeFeedMode AllVersionsAndDeletes => ChangeFeedModeFullFidelity.Instance;
56+
public static ChangeFeedMode AllVersionsAndDeletes => ChangeFeedModeFullFidelity.Instance;
6257
}
6358
}

0 commit comments

Comments
 (0)