Max updates super3 2025 12 25#184
Conversation
…time.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT'),
…ned in the outer scope, making it inaccessible and might confuse
…cape=False detected
…urns, or none of them JS-0045
Summary of ChangesHello @BaseMax, 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 focuses on improving the project's web presence and maintainability. it introduces a robust mechanism for generating and exposing a sitemap to search engines, alongside better integration of the existing RSS feed. concurrently, it streamlines the project's CSS dependencies by removing specific Bootstrap grid and reboot stylesheets. 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. 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
|
|
Here's the code health analysis summary for commits Analysis Summary
|
There was a problem hiding this comment.
Code Review
This pull request introduces sitemap generation, updates the README, and removes some unused Bootstrap files. The core logic for generating the sitemap has a potential security vulnerability due to manual XML construction and also a functional issue where it creates an incomplete sitemap. I've provided two high-severity comments with suggestions to address these issues in render.py.
I am having trouble creating individual review comments. Click here to see my feedback.
render.py (40-43)
Manually constructing XML with f-strings is not robust and can be a security risk if the urls list ever contains user-provided data (XML injection). It can also lead to malformed XML if a URL contains special characters like &, <, or >. As a minimal fix, you should escape the URL content using html.escape(). For a more robust solution, consider using a dedicated XML library like xml.etree.ElementTree.
Note: You will need to add import html at the top of the file.
urlset = "\n".join(
f" <url>\n <loc>{html.escape(url)}</loc>\n </url>" for url in urls
)
sitemap = f"""<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n{urlset}\n</urlset>\n"""
render.py (274-277)
The generated sitemap currently only includes the main page URL and the RSS feed URL. For better SEO and discoverability, the sitemap should include the URLs for all the individual user profiles. You can achieve this by iterating through the users list and adding their html_url to the sitemap_urls.
Additionally, "sitemap.xml" is a "magic string". It's better to define this as a constant at the top of the file for maintainability.
sitemap_filename = "sitemap.xml"
sitemap_urls = {f"{DEPLOY_BASEURL}/", f"{DEPLOY_BASEURL}/feed.xml"}
sitemap_urls.update(user["html_url"] for user in users if user.get("html_url"))
generate_sitemap_xml(list(sitemap_urls), sitemap_filename)
No description provided.