feat(codeTracking): add custom apiEndpoint and token configuration#172
feat(codeTracking): add custom apiEndpoint and token configuration#172
Conversation
Allow users to configure a separate API endpoint and token for coding activity heartbeats under [codeTracking]. When set, heartbeat data will use these values instead of the global configuration, enabling users to send coding activity to a different server or authenticate separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @AnnatarHe, 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 Highlights
Using Gemini Code AssistThe 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
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 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
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a useful feature to allow custom API endpoints and tokens for code tracking heartbeats, overriding the global configuration. The implementation looks solid, with good separation of concerns where the config is read and then used. The changes are well-documented in CONFIG.md and thoroughly tested with new unit tests covering various scenarios, including full, partial, and local override configurations. I've made a few minor suggestions to improve code formatting and test comment clarity, but overall this is a great addition.
| enabled = true | ||
| apiEndpoint = 'https://api.custom.com'`, | ||
| expectedAPIEndpoint: "https://api.custom.com", | ||
| expectedToken: "", // empty, should fall back to global |
There was a problem hiding this comment.
This comment is slightly misleading. This test correctly verifies that config.CodeTracking.Token is empty when not provided in the config. However, it doesn't test the fallback behavior itself, which happens in SendHeartbeatsToServer. A clearer comment might be // empty, as it's not set in this config to avoid confusion about the scope of this test case.
| [codeTracking] | ||
| enabled = true | ||
| token = 'custom-token'`, | ||
| expectedAPIEndpoint: "", // empty, should fall back to global |
There was a problem hiding this comment.
Similar to the previous test case, this comment could be misinterpreted. This test verifies that config.CodeTracking.APIEndpoint is empty, but the fallback to the global endpoint is handled elsewhere. To improve clarity, consider rewording the comment to something like // empty, as it's not set in this config.
| Enabled *bool `toml:"enabled"` | ||
| Enabled *bool `toml:"enabled"` | ||
| APIEndpoint string `toml:"apiEndpoint"` // Custom API endpoint for heartbeats | ||
| Token string `toml:"token"` // Custom token for heartbeats |
There was a problem hiding this comment.
For consistency with the surrounding code and Go formatting conventions, it's better to have a single space between the struct tag and the line comment. The extra spaces here seem to be a minor formatting artifact.
| Token string `toml:"token"` // Custom token for heartbeats | |
| Token string `toml:"token"` // Custom token for heartbeats |
Summary
apiEndpointandtokenfields to[codeTracking]configurationTest plan
🤖 Generated with Claude Code