Skip to content

Conversation

@jaissica12
Copy link
Contributor

Background

  • Add devPassedAttributes along with the enrichedAttributes for better debugging of selectPlacements

What Has Changed

  • Added devPassedAttributes in selectPlacements
  • Updated roktManager.spec.ts test

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • {Any additional information or context relevant to this PR}

Reference Issue (For employees only. Ignore if you are an outside contributor)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a devPassedAttributes field to the selectPlacements functionality to improve debugging capabilities. The devPassedAttributes field preserves the original, unmapped attributes passed by developers, while attributes contains the transformed attributes after mapping and enrichment.

Changes:

  • Added devPassedAttributes field to the enriched options passed to kit.selectPlacements containing the original unmapped attributes
  • Updated all test expectations in roktManager.spec.ts to verify that devPassedAttributes is correctly passed through
  • Added two new test cases specifically for devPassedAttributes behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/roktManager.ts Added devPassedAttributes: attributes to the enriched options object passed to kit.selectPlacements
test/jest/roktManager.spec.ts Updated existing test expectations to include devPassedAttributes and added two new test cases verifying original attributes are preserved
Comments suppressed due to low confidence (3)

src/roktManager.ts:32

  • The IRoktSelectPlacementsOptions interface should include devPassedAttributes as an optional property to properly type the enriched options object that includes this field. Without this, the code at line 247 adds a property that is not part of the declared interface, creating a type mismatch. Add devPassedAttributes?: IRoktPartnerAttributes; to the interface.
export interface IRoktSelectPlacementsOptions {
    attributes: IRoktPartnerAttributes;
    identifier?: string;
}

src/roktManager.ts:42

  • The IRoktLauncher interface references IRoktSelectPlacementsOptions which should include devPassedAttributes as an optional field. Once the interface is updated, this signature will automatically reflect the correct type.
    selectPlacements: (options: IRoktSelectPlacementsOptions) => Promise<IRoktSelection>;

src/roktManager.ts:67

  • The IRoktKit interface references IRoktSelectPlacementsOptions which should include devPassedAttributes as an optional field. Once the interface is updated, this signature will automatically reflect the correct type.
    selectPlacements: (options: IRoktSelectPlacementsOptions) => Promise<IRoktSelection>;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const enrichedOptions = {
...options,
attributes: enrichedAttributes,
devPassedAttributes: attributes,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Is devPassedAttributes something that exists in the Rokt WSDK? If not, I think debugAttributes sounds more appropriate if these are attributes for debugging or testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed devPassedAttributes to debugAttributes

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
34.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

3 participants