Repository navigation
Populate group properties - #176
Conversation
✅ Deploy Preview for detsys-ts-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRenames exported type Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/correlation.ts (1)
10-23:⚠️ Potential issue | 🟠 MajorAdd a compatibility alias for the renamed public type.
CorrelationPropertiesis exported from the package root (line 1234 of src/index.ts), making this a breaking change for downstream imports. Without a deprecated alias, consumers importingAnonymizedCorrelationHasheswill experience failures. If this is not a semver-major release, add a compatibility alias:Compatibility alias
export type CorrelationProperties = { ... }; +export type AnonymizedCorrelationHashes = CorrelationProperties;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/correlation.ts` around lines 10 - 23, Add a deprecated compatibility alias for the renamed type so existing consumers keep working: declare and export a new type alias named AnonymizedCorrelationHashes = CorrelationProperties in the same module where CorrelationProperties is defined (src/correlation.ts) and ensure it is exported from the package root (re-export from src/index.ts if needed); mark it as deprecated in a comment so maintainers know to remove it in a major version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/index.ts`:
- Around line 662-675: recordGroup currently only emits a $groupidentify for
github_organization, leaving the github_repository entry in identity.$groups
unused; update recordGroup to also check identity.$groups["github_repository"]
and the appropriate env var (process.env["GITHUB_REPOSITORY"] or repo name), and
emit a second recordEvent("$groupidentify", { $group_type: "github_repository",
$group_key: <repo_hash>, $group_set: { name: <repo_name> } }) when both values
exist, preserving the existing org emission logic (refer to recordGroup,
identity.$groups, github_organization, github_repository, and recordEvent to
locate where to add this).
---
Outside diff comments:
In `@src/correlation.ts`:
- Around line 10-23: Add a deprecated compatibility alias for the renamed type
so existing consumers keep working: declare and export a new type alias named
AnonymizedCorrelationHashes = CorrelationProperties in the same module where
CorrelationProperties is defined (src/correlation.ts) and ensure it is exported
from the package root (re-export from src/index.ts if needed); mark it as
deprecated in a comment so maintainers know to remove it in a major version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a25ae09a-ea34-4380-82d1-9b8aeb2aa440
⛔ Files ignored due to path filters (3)
dist/index.d.mtsis excluded by!**/dist/**dist/index.mjsis excluded by!**/dist/**dist/index.mjs.mapis excluded by!**/dist/**,!**/*.map
📒 Files selected for processing (2)
src/correlation.tssrc/index.ts
ee36f3f to
c986e4f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/index.ts`:
- Line 531: The recordGroup method is declared async returning
Promise<undefined> but has no await or explicit return, causing a TS mismatch;
make recordGroup synchronous by removing the async keyword and changing its
signature from async recordGroup(): Promise<undefined> to recordGroup(): void,
and update any related type annotations or callers if they expect a Promise
(adjust call sites to handle a void return instead of awaiting it).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c078bd63-58f7-4e98-926d-48cec73d0c7a
⛔ Files ignored due to path filters (3)
dist/index.d.mtsis excluded by!**/dist/**dist/index.mjsis excluded by!**/dist/**dist/index.mjs.mapis excluded by!**/dist/**,!**/*.map
📒 Files selected for processing (1)
src/index.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/index.ts`:
- Around line 446-450: The declared type for the context used by recordEvent is
invalid because Record only accepts two type parameters; update the context type
(the variable named context used/declared around recordEvent) so the third
Record is merged into the value union — i.e. make the value type a union that
includes primitive types and a nested Record<string, boolean | string | number |
undefined> — so the declaration becomes a single Record<string, (boolean |
string | number | undefined | Record<string, boolean | string | number |
undefined>)> and leave the initializer as {}.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 206f1cc2-1ae5-455e-8021-a31adf0e7822
⛔ Files ignored due to path filters (2)
dist/index.d.mtsis excluded by!**/dist/**dist/index.mjs.mapis excluded by!**/dist/**,!**/*.map
📒 Files selected for processing (1)
src/index.ts
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/index.ts (1)
669-684:⚠️ Potential issue | 🟠 Major | ⚡ Quick winEmit
$groupidentifyforgithub_repositoryas well.At Line 670 and Line 673, this method only reports
github_organization.identify()also populatesidentity.$groups["github_repository"], so repository group properties are still left unpopulated.Suggested patch
private async recordGroup(): Promise<undefined> { const ghorg_hash = this.identity.$groups["github_organization"]; const ghorg_name = process.env["GITHUB_REPOSITORY_OWNER"]; if (ghorg_hash !== undefined && ghorg_name !== undefined) { this.recordEvent("$groupidentify", { $group_type: "github_organization", $group_key: ghorg_hash, $group_set: { name: ghorg_name, }, }); } + const ghrepo_hash = this.identity.$groups["github_repository"]; + const ghrepo_name = process.env["GITHUB_REPOSITORY"]; + + if (ghrepo_hash !== undefined && ghrepo_name !== undefined) { + this.recordEvent("$groupidentify", { + $group_type: "github_repository", + $group_key: ghrepo_hash, + $group_set: { + name: ghrepo_name, + }, + }); + } + return undefined; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/index.ts` around lines 669 - 684, recordGroup() currently only emits a $groupidentify for github_organization; also check identity.$groups["github_repository"] and emit a second $groupidentify for that group: retrieve the repo group key from identity.$groups["github_repository"], get the repository name from process.env["GITHUB_REPOSITORY"] (or extract the repo segment if you prefer owner/repo), and call this.recordEvent("$groupidentify", { $group_type: "github_repository", $group_key: repo_hash, $group_set: { name: repoName } }); ensure this runs alongside the existing github_organization logic in the same recordGroup() method.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/index.ts`:
- Around line 669-684: recordGroup() currently only emits a $groupidentify for
github_organization; also check identity.$groups["github_repository"] and emit a
second $groupidentify for that group: retrieve the repo group key from
identity.$groups["github_repository"], get the repository name from
process.env["GITHUB_REPOSITORY"] (or extract the repo segment if you prefer
owner/repo), and call this.recordEvent("$groupidentify", { $group_type:
"github_repository", $group_key: repo_hash, $group_set: { name: repoName } });
ensure this runs alongside the existing github_organization logic in the same
recordGroup() method.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5811b45f-a555-46c4-a05f-efb0e69f7d97
⛔ Files ignored due to path filters (2)
dist/index.d.mtsis excluded by!**/dist/**dist/index.mjs.mapis excluded by!**/dist/**,!**/*.map
📒 Files selected for processing (1)
src/index.ts
151b754 to
27b169d
Compare
Description
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Refactor