|
| 1 | +--- |
| 2 | +name: code-review |
| 3 | +description: Use when reviewing or preparing a pull request for contentstack-management-dotnet. |
| 4 | +--- |
| 5 | + |
| 6 | +# Code review – Contentstack Management .NET SDK |
| 7 | + |
| 8 | +## When to use |
| 9 | + |
| 10 | +- Before requesting review or merging a PR. |
| 11 | +- When auditing changes for API safety, tests, and repo policies. |
| 12 | + |
| 13 | +## Instructions |
| 14 | + |
| 15 | +### Branch and merge expectations |
| 16 | + |
| 17 | +- **Typical PRs** should target **`development`**. Use **`main`** as the base branch only for **hotfixes**. |
| 18 | +- **When the base is `main`:** only PRs from **`staging`** are allowed (enforced by [`.github/workflows/check-branch.yml`](../../.github/workflows/check-branch.yml)). Confirm head/base match team intent before approving. |
| 19 | + |
| 20 | +### Summary checklist |
| 21 | + |
| 22 | +- **Purpose:** Change matches the ticket/PR description; no unrelated refactors. |
| 23 | +- **Tests:** Unit tests updated or added for behavior changes; run `sh ./Scripts/run-unit-test-case.sh` locally for core changes. Integration tests only when behavior depends on live API—coordinate credentials. |
| 24 | +- **API compatibility:** Public surface (`ContentstackClient`, options, models) changes are intentional and versioned appropriately; avoid breaking changes without major bump and changelog. |
| 25 | +- **Security:** No secrets, tokens, or keys in source or commits; `appsettings.json` with real data must not be committed. |
| 26 | +- **Signing:** If assembly signing is affected, confirm `CSManagementSDK.snk` usage matches [`../framework/SKILL.md`](../framework/SKILL.md). |
| 27 | +- **Style:** Follow [`../csharp-style/SKILL.md`](../csharp-style/SKILL.md); match surrounding code. |
| 28 | +- **Documentation:** User-visible behavior changes reflected in `README.md` or package release notes when needed. |
| 29 | + |
| 30 | +For markdown blocks to paste into PRs, copy from **PR review checklist (copy-paste)** below. |
| 31 | + |
| 32 | +### Severity (optional labels) |
| 33 | + |
| 34 | +- **Blocker:** Build or CI broken; security issue; violates branch policy. |
| 35 | +- **Major:** Missing tests for risky logic; breaking API without process. |
| 36 | +- **Minor:** Naming nits, non-user-facing cleanup. |
| 37 | + |
| 38 | +### PR review checklist (copy-paste) |
| 39 | + |
| 40 | +Copy sections into a PR comment when useful. This checklist is for **this** repo (`HttpClient` + pipeline + MSTest), **not** the Content Delivery .NET SDK. |
| 41 | + |
| 42 | +#### Branch policy |
| 43 | + |
| 44 | +```markdown |
| 45 | +- [ ] **Default:** PR targets **`development`** unless this is a documented **hotfix** to **`main`** |
| 46 | +- [ ] If base is **`main`**: head branch is **`staging`** (see `.github/workflows/check-branch.yml`) |
| 47 | +``` |
| 48 | + |
| 49 | +#### Breaking changes |
| 50 | + |
| 51 | +```markdown |
| 52 | +- [ ] No public method/property removed or narrowed without deprecation / major version plan |
| 53 | +- [ ] `JsonProperty` / JSON names for API-facing models unchanged unless intentional and documented |
| 54 | +- [ ] New required `ContentstackClientOptions` fields have safe defaults or are optional |
| 55 | +- [ ] Strong naming: assembly signing still consistent if keys or `csproj` changed |
| 56 | +``` |
| 57 | + |
| 58 | +#### HTTP and pipeline |
| 59 | + |
| 60 | +```markdown |
| 61 | +- [ ] New or changed HTTP calls go through existing client/pipeline (`ContentstackClient` → `IContentstackService` → pipeline), not ad-hoc `HttpClient` usage inside services without justification |
| 62 | +- [ ] Retry-sensitive changes reviewed alongside `RetryHandler` / `DefaultRetryPolicy` and unit tests under `Contentstack.Management.Core.Unit.Tests/Runtime/Pipeline/` |
| 63 | +- [ ] Headers, query params, and path segments align with CMA docs; no hardcoded production URLs where options.Host should be used |
| 64 | +``` |
| 65 | + |
| 66 | +#### Services and query API |
| 67 | + |
| 68 | +```markdown |
| 69 | +- [ ] `IContentstackService` implementations set `ResourcePath`, `HttpMethod`, `Parameters` / `QueryResources` / `PathResources` / `Content` consistently with sibling services |
| 70 | +- [ ] New fluent `Query` methods only add to `ParameterCollection` with correct API parameter names |
| 71 | +``` |
| 72 | + |
| 73 | +#### Tests |
| 74 | + |
| 75 | +```markdown |
| 76 | +- [ ] Unit tests use MSTest; `sh ./Scripts/run-unit-test-case.sh` passes for core changes |
| 77 | +- [ ] Integration tests only when needed; no secrets committed (`appsettings.json` stays local) |
| 78 | +``` |
| 79 | + |
| 80 | +#### Security and hygiene |
| 81 | + |
| 82 | +```markdown |
| 83 | +- [ ] No API keys, tokens, or passwords in source or test data checked into git |
| 84 | +- [ ] OAuth / token handling does not log secrets |
| 85 | +``` |
| 86 | + |
| 87 | +#### Documentation |
| 88 | + |
| 89 | +```markdown |
| 90 | +- [ ] User-visible behavior reflected in `README.md` or release notes when appropriate |
| 91 | +- [ ] `skills/` updated if agent/contributor workflow changed |
| 92 | +``` |
0 commit comments