Skip to content

TypeScriptified member attribution unit tests - #31045

Merged
EvanHahn merged 1 commit into
mainfrom
ts-member-attr-tests
Sep 28, 2026
Merged

EvanHahn merged 1 commit into
mainfrom
ts-member-attr-tests

Conversation

@EvanHahn

Copy link
Copy Markdown
Contributor

no ref

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: TryGhost/Ghost/.coderabbit.yaml

Review profile: QUIET

Plan: Essentials

Run ID: 2edeb893-2181-498e-864c-e14fad4461d0

📥 Commits

Reviewing files that changed from the base of the PR and between 086507f and c68d0e2.

📒 Files selected for processing (6)
  • ghost/core/test/unit/server/services/member-attribution/attribution.test.ts
  • ghost/core/test/unit/server/services/member-attribution/history.test.ts
  • ghost/core/test/unit/server/services/member-attribution/outbound-link-tagger.test.ts
  • ghost/core/test/unit/server/services/member-attribution/referrer-translator.test.ts
  • ghost/core/test/unit/server/services/member-attribution/service.test.ts
  • ghost/core/test/unit/server/services/member-attribution/url-translator.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: Setup
  • GitHub Check: Detect Tinybird changes
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (3)
Review whether tests prove changed behaviour, meaningful error/edge paths, and externally observable contracts without coupling to implementation details.

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/unit/server/services/member-attribution/history.test.ts
  • ghost/core/test/unit/server/services/member-attribution/outbound-link-tagger.test.ts
  • ghost/core/test/unit/server/services/member-attribution/attribution.test.ts
  • ghost/core/test/unit/server/services/member-attribution/referrer-translator.test.ts
  • ghost/core/test/unit/server/services/member-attribution/service.test.ts
  • ghost/core/test/unit/server/services/member-attribution/url-translator.test.ts
Review lens: "where does this data become trusted?" Boundary data (HTTP input, external API/SDK responses, env/config, DB/filesystem reads, queue/webhook/event payloads) is `unknown` until validated — Zod by default.

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/unit/server/services/member-attribution/history.test.ts
  • ghost/core/test/unit/server/services/member-attribution/outbound-link-tagger.test.ts
  • ghost/core/test/unit/server/services/member-attribution/attribution.test.ts
  • ghost/core/test/unit/server/services/member-attribution/referrer-translator.test.ts
  • ghost/core/test/unit/server/services/member-attribution/service.test.ts
  • ghost/core/test/unit/server/services/member-attribution/url-translator.test.ts
Prioritise concrete correctness, security, data-integrity, compatibility, and regression risks.

⚙️ CodeRabbit configuration file

Files:

  • ghost/core/test/unit/server/services/member-attribution/history.test.ts
  • ghost/core/test/unit/server/services/member-attribution/outbound-link-tagger.test.ts
  • ghost/core/test/unit/server/services/member-attribution/attribution.test.ts
  • ghost/core/test/unit/server/services/member-attribution/referrer-translator.test.ts
  • ghost/core/test/unit/server/services/member-attribution/service.test.ts
  • ghost/core/test/unit/server/services/member-attribution/url-translator.test.ts
🔇 Additional comments (6)
ghost/core/test/unit/server/services/member-attribution/attribution.test.ts (1)

1-5: LGTM!

Also applies to: 7-38, 41-43, 48-48, 83-83, 89-89, 102-102, 108-108, 111-111, 121-121

ghost/core/test/unit/server/services/member-attribution/history.test.ts (1)

1-1: LGTM!

Also applies to: 3-4

ghost/core/test/unit/server/services/member-attribution/outbound-link-tagger.test.ts (1)

1-1: LGTM!

Also applies to: 3-4, 44-44, 67-67

ghost/core/test/unit/server/services/member-attribution/referrer-translator.test.ts (1)

1-1: LGTM!

Also applies to: 3-30, 40-40

ghost/core/test/unit/server/services/member-attribution/service.test.ts (1)

1-1: LGTM!

Also applies to: 3-21, 25-25, 119-119, 153-153, 169-169, 193-193, 209-209, 221-221, 246-246, 260-260, 314-314, 328-328, 368-368, 382-382, 416-416

ghost/core/test/unit/server/services/member-attribution/url-translator.test.ts (1)

1-1: LGTM!

Also applies to: 3-37, 41-41, 49-49, 57-57, 74-74, 78-78, 81-81, 88-88, 91-91, 178-178, 193-193, 197-197, 248-248, 260-260, 266-266, 272-272, 278-278, 308-308, 311-311, 314-314, 330-330, 339-339, 350-350, 364-364, 368-368, 381-381, 385-385, 388-388


Walkthrough

Six member-attribution unit tests now use TypeScript imports and add types to local interfaces, fixtures, mocks, and callback parameters. The URL-translator tests also assert that successful lookups return non-null results and that the URL service captures a resource before its fields are checked. Test behavior and expectations are otherwise unchanged.

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to c68d0

No concrete merge-blocking risk was identified in these test-only changes. Run the normal unit-test and typecheck workflows before merging.

🚥 Pre-merge checks | ✅ 5 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description, "no ref," is too vague to show how it relates to the changeset. Provide a brief description that states the member attribution unit tests were converted to TypeScript and that test behavior remains unchanged.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: converting the member attribution unit tests to TypeScript.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Type-Safe Boundaries ✅ Passed PASS. The PR changes only six member-attribution test files. The added code contains no any, unchecked as, @ts-nocheck, or @ts-ignore. The local test types and @ts-expect-error imports are t…
New Files Are Typescript ✅ Passed PASS. The review-scoped diff contains six renames from pre-existing .test.js files to .test.ts files. It adds no new .js, .jsx, .cjs, or .mjs file. The check does not fail for modifying or…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit c68d0e2

Command Status Duration Result
nx run-many -t test:unit -p ghost ✅ Succeeded 28s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded <1s View ↗
nx run-many -t lint -p ghost ✅ Succeeded 4s View ↗
nx run-many -t test:types -p ghost ✅ Succeeded 5s View ↗
nx run @tryghost/e2e:test:fixtures ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-28 18:12:48 UTC

@EvanHahn
EvanHahn merged commit 58f1762 into main Sep 28, 2026
42 checks passed
@EvanHahn
EvanHahn deleted the ts-member-attr-tests branch September 28, 2026 18:47
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.

1 participant