Skip to content

Comments

Add trackingToken to Device request object#603

Open
oschwald wants to merge 1 commit intomainfrom
greg/eng-4049
Open

Add trackingToken to Device request object#603
oschwald wants to merge 1 commit intomainfrom
greg/eng-4049

Conversation

@oschwald
Copy link
Member

Summary

  • Add optional trackingToken field to Device request object for explicit device linking via the Device Tracking Add-on

ENG-4049

Test plan

  • Unit tests pass (226 tests)
  • New field serializes to tracking_token via @JsonProperty
  • Backward compatible (field is optional, null excluded from JSON)
  • Checkstyle passes

🤖 Generated with Claude Code

This adds the optional trackingToken field to the Device request
object for explicit device linking via the Device Tracking Add-on.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @oschwald, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Device request object by integrating an optional trackingToken field. This addition facilitates explicit device linking, particularly for use with the Device Tracking Add-on, ensuring that the system can better associate transactions with specific devices. The changes maintain backward compatibility and include necessary updates to documentation and tests.

Highlights

  • New Feature: trackingToken: Introduced an optional trackingToken field to the Device request object to support explicit device linking via the Device Tracking Add-on.
  • API Update: The Device.Builder now includes a trackingToken method, and the Device class has a corresponding getter, which serializes to tracking_token in JSON.
  • Documentation & Testing: Updated CHANGELOG.md and README.md with the new feature, and added a unit test for the trackingToken functionality.
Changelog
  • CHANGELOG.md
    • Added trackingToken to the Device request object. This is the token generated by the Device Tracking Add-on for explicit device linking.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds an optional trackingToken field to the Device request object. The changes are well-implemented, including updates to the Device class, its builder, the CHANGELOG.md, README.md, and a new unit test. I have one minor suggestion to improve code consistency in the new builder method.

Comment on lines +111 to +114
public Device.Builder trackingToken(String val) {
trackingToken = val;
return this;
}

Choose a reason for hiding this comment

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

medium

For consistency with other builder methods in this class (e.g., sessionId(String sessionId)) and for better code clarity, it's recommended to use a more descriptive parameter name than val. Using this. is also recommended for consistency when the parameter name is the same as the field name.

Additionally, please update the corresponding Javadoc @param tag on line 107 from @param val to @param trackingToken.

Suggested change
public Device.Builder trackingToken(String val) {
trackingToken = val;
return this;
}
public Device.Builder trackingToken(String trackingToken) {
this.trackingToken = trackingToken;
return this;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant