Conversation
Summary of ChangesHello, 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 introduces Reo.dev analytics tracking to the documentation site. The primary goal is to gain insights into developer activity and engagement with the documentation, which will help in understanding user behavior and optimizing content. This integration involves adding a custom JavaScript beacon and updating the site's configuration to ensure the tracker loads correctly across all pages. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request adds Reo.dev analytics tracking. The implementation introduces a hardcoded client ID and a minified script into the codebase. My feedback focuses on improving maintainability and security by suggesting the use of environment variables for the client ID and storing readable, un-minified code in the repository.
static/scripts/custom-reo.js
Outdated
| @@ -0,0 +1 @@ | |||
| !function(){var e,t,n;e="3b8cf05627127ba",t=function(){Reo.init({clientID:"3b8cf05627127ba"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}(); | |||
There was a problem hiding this comment.
This file contains a hardcoded client ID and is minified, which presents maintainability and potential security issues.
- Hardcoded ID: Hardcoding configuration values like this client ID makes it difficult to manage different environments (e.g., development vs. production) and to rotate keys if needed. It's a best practice to load such values from environment variables.
- Minified Code: Including minified code in source control harms readability and maintainability. It's better to commit the original, formatted source code.
To address this, I recommend converting this to an inline script within docusaurus.config.js. There, you can use process.env to securely load the client ID from an environment variable and avoid committing minified code.
| !function(){var e,t,n;e="3b8cf05627127ba",t=function(){Reo.init({clientID:"3b8cf05627127ba"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}(); | |
| (function() { | |
| // TODO: This client ID should be loaded from an environment variable, not hardcoded. | |
| const clientId = "3b8cf05627127ba"; | |
| function initReo() { | |
| if (window.Reo) { | |
| window.Reo.init({ clientID: clientId }); | |
| } | |
| } | |
| const script = document.createElement("script"); | |
| script.src = `https://static.reo.dev/${clientId}/reo.js`; | |
| script.async = true; | |
| script.onload = initReo; | |
| document.head.appendChild(script); | |
| })(); |
Integrates Reo.dev tracking beacon to monitor developer activity on the documentation site. Adds the Reo.dev JavaScript snippet and configures Docusaurus to load it on all pages.
https://docs.reo.dev/integrations/developer-docs/docusaurus