You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "No existing tags found. Skipping version-bump check (first release)."
67
+
exit 0
68
+
fi
69
+
LATEST_VERSION="${LATEST_TAG#v}"
70
+
LATEST_VERSION="${LATEST_VERSION%%-*}"
71
+
if [ "$(printf '%s\n' "$LATEST_VERSION" "$PKG_VERSION" | sort -V | tail -1)" != "$PKG_VERSION" ]; then
72
+
echo "::error::Version bump required: package.json version ($PKG_VERSION) is not greater than latest tag ($LATEST_TAG). Please bump the version in package.json."
73
+
exit 1
74
+
fi
75
+
if [ "$PKG_VERSION" = "$LATEST_VERSION" ]; then
76
+
echo "::error::Version bump required: package.json version ($PKG_VERSION) equals latest tag ($LATEST_TAG). Please bump the version in package.json."
77
+
exit 1
78
+
fi
79
+
echo "Version bump check passed: package.json is at $PKG_VERSION (latest tag: $LATEST_TAG)."
# The below action will see the existing tags and will bump the current ones and this is only used to check whether the given tag already exists or not
14
-
# We will be using the previous tag to compare with the current tag in the package.json
15
-
# If both match then no new release would be triggered
|*Purpose:*| Primary Node.js module for [Contentstack DataSync](https://www.contentstack.com/docs/guide/synchronization/contentstack-datasync): coordinates content stores, asset stores, and a listener (webhooks), and pulls stack changes via the **Contentstack Sync API** with a **delivery token**. |
11
+
|*Out of scope (if any):*| Not the standalone CDA or CMA client SDKs; not a generic HTTP client library—sync orchestration and Node **`https`** to the Sync API only. Say **DataSync** / **Sync API**, not “CMA”, for this package’s main behavior. |
description: PR review checklist for DataSync Manager—Sync API terminology, security, tests, optional severity labels
4
+
---
5
+
6
+
# Code review – @contentstack/datasync-manager
7
+
8
+
## When to use
9
+
10
+
- Reviewing a pull request or preparing one for review.
11
+
- You need a consistent checklist for **DataSync** / **Sync API** changes (not CMA).
12
+
13
+
## Instructions
14
+
15
+
### Scope and naming
16
+
17
+
-**DataSync Manager** uses the **Contentstack Sync API** and a **delivery token**. It is **not** the CMA SDK; do not describe it as “management” or “CMA” unless the code path actually uses Management APIs (rare here).
18
+
19
+
### Public surface
20
+
21
+
-**`src/index.ts`**: JSDoc for new or changed exports, matching existing style.
22
+
-**Config**: Document new `contentstack` / `syncManager` options when behavior is user-visible.
23
+
24
+
### Correctness
25
+
26
+
-**Queues and notifications**: `push` / `unshift` / `pop` and `notifications` events (`publish`, `unpublish`, `delete`, `error`) must stay consistent for integrators.
27
+
-**Token lifecycle**: `.tokens`, `.ledger`, `.checkpoint` and **Error 141** recovery in `src/api.ts`—verify edge cases and no infinite loops.
28
+
-**Webhook + fallback polling** (`src/index.ts`): no timer leaks or duplicate `poke()` calls.
29
+
30
+
### Security
31
+
32
+
- HTTPS path/query handling must remain safe from SSRF (`src/api.ts`).
33
+
- No secrets in logs; **Talisman** / **Snyk** expectations stay satisfied.
34
+
35
+
### Dependencies
36
+
37
+
- Prefer minimal, audited dependencies per team policy.
38
+
39
+
### Tests
40
+
41
+
- Add or update **Jest** tests with **nock** for HTTP; follow `test/dummy` patterns.
42
+
- Run **`npm test`** before approving risky changes.
43
+
44
+
### Severity (optional labels)
45
+
46
+
| Label | Examples |
47
+
|-------|----------|
48
+
|**Blocker**| Security regression, data loss risk, infinite retries, broken public API contract |
49
+
|**Major**| Wrong Sync API semantics, missing tests for critical paths, breaking change without version strategy |
0 commit comments