Skip to content

Add monthly featured developer showcase#187

Merged
BaseMax merged 9 commits into
john-bampton:mainfrom
Aashish-Jha-11:feature/monthly-featured-user-clean
Dec 26, 2025
Merged

Add monthly featured developer showcase#187
BaseMax merged 9 commits into
john-bampton:mainfrom
Aashish-Jha-11:feature/monthly-featured-user-clean

Conversation

@Aashish-Jha-11

Copy link
Copy Markdown
Contributor

Implements issue #122 - Clean implementation from latest main.

What's Changed:

  • Engagement scoring algorithm (followers 40%, stars 30%, repos 15%, sponsors 10%, activity 5%)
  • Featured user section with gradient banner
  • Auto-generates featured.json during fetch
  • First featured: Sindresorhus (score: 294,003)

Files: fetch.py, generate_featured.py (new), layouts/layout.html, docs/styles.css, docs/script.js, docs/featured.json

Tested: ✅ Python compiles, responsive design, existing features preserved

- Add engagement scoring algorithm (followers, stars, repos, sponsors, activity)
- Auto-select top user each month based on calculated score
- Add featured user section with gradient banner in layout
- Display avatar, stats, location, and top languages
- Responsive design for mobile/tablet/desktop
- Add generate_featured.py to regenerate featured user on demand
- Generate featured.json with sindresorhus as first featured developer
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Aashish-Jha-11, 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 a significant new feature: a monthly featured developer showcase. It encompasses both backend logic for selecting and generating the featured user's data based on an engagement score, and frontend components to beautifully display this information on the website. The goal is to highlight active and influential developers, enhancing user engagement and providing a dynamic element to the site.

Highlights

  • Monthly Featured Developer Showcase: Introduces a new section to highlight a "Featured Developer of the Month" on the website, complete with their profile details, stats, and top languages.
  • Engagement Scoring Algorithm: Implements a Python-based algorithm to calculate an engagement score for developers, considering followers (40%), stars (30%), repositories (15%), sponsors (10%), and recent activity (5%).
  • Automated Featured User Selection: The fetch.py script now automatically selects the top-scoring developer and generates a featured.json file, ensuring the featured user is always up-to-date.
  • Dedicated Regeneration Script: A new generate_featured.py script allows for standalone regeneration of the featured.json file using existing cached user data, without needing to re-fetch all user data.
  • Frontend Integration and Styling: The frontend (docs/script.js, layouts/layout.html, docs/styles.css) has been updated to fetch and display the featured user data in a visually appealing section with a gradient banner and responsive design.

🧠 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 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.

@deepsource-io

deepsource-io Bot commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

Here's the code health analysis summary for commits df55d45..f437f49. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Python LogoPython✅ Success
🎯 2 occurences resolved
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

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

Copy link
Copy Markdown
Contributor

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 introduces a monthly featured developer showcase, which is a great addition. The implementation includes a scoring algorithm, a new UI section, and scripts to generate the featured user data. The concurrent data fetching in initializeApp is a good performance improvement.

My review focuses on improving the Python code's structure and robustness. I've pointed out several instances of local imports that should be moved to the top of the file per PEP 8, a case of code duplication between two scripts that can be refactored, the use of 'magic numbers' that should be constants, and an opportunity to make error handling more specific. In the JavaScript, I've suggested a safer way to clear DOM elements. These changes will enhance the code's maintainability and adherence to best practices.

Comment thread generate_featured.py Outdated
Comment thread docs/script.js Outdated
Comment thread fetch.py Outdated
Comment thread fetch.py
Comment thread fetch.py Outdated
Comment thread fetch.py Outdated
Comment thread fetch.py Outdated
Comment thread generate_featured.py
@BaseMax

BaseMax commented Dec 25, 2025

Copy link
Copy Markdown
Member

Please fix the following issues as well.

js:

image
It is considered a best practice to avoid the use of any console methods in JavaScript code that will run on the browser.

NOTE: If your repository contains a server side project, you can add "nodejs" to the environment property of analyzer meta in .deepsource.toml. This will prevent this issue from getting raised. Documentation for the analyzer meta can be found [here](https://docs.deepsource.com/docs/analyzers-javascript#meta). Alternatively, you can silence this issue for your repository [as shown here](https://deepsource.com/blog/releases-issue-actions).

If a specific console call is meant to stay for other reasons, you can add [a skipcq comment](https://docs.deepsource.com/docs/issues-ignore-rules#silencing-a-specific-issue) to that line. This will inform other developers about the reason behind the log's presence, and prevent DeepSource from flagging it.

Usually, console methods are only used for debugging, and can leak internal info to the client. Removing the console call will fix this issue.

python:

image
Formatting the message manually before passing it to a logging call does unnecessary work if logging is disabled. Consider using the logging module's built-in formatting features to avoid that.

If your logging level is set to "WARNING", but the logging call is:

logging.debug("Data: %s", data)
In the above example, there will be no logging as the level debug is below warning. The conversion of the data object to a string will be skipped by the logging module resulting in improved performance.

logging.debug(f"Data: {data}")
In the code shown above, the conversion of the data object to a string will happen regardless of whether the message is logged or not (which is based on the log level).

Bad practice
import logging
import inspect
logging.basicConfig(level=logging.INFO)
logging.debug(f"Entered function {inspect.stack[0][3]}"))
Recommended
import logging
import inspect
logging.basicConfig(level=logging.INFO)
logging.debug("Entered function %s", inspect.stack[0][3])

@BaseMax

BaseMax commented Dec 25, 2025

Copy link
Copy Markdown
Member
image

- Remove console.log and console.error from loadFeaturedUser (JS-0002)
- Convert all logging f-strings to parameter substitution (PYL-W1203)
- Featured user loading now fails silently if not available
@BaseMax

BaseMax commented Dec 26, 2025

Copy link
Copy Markdown
Member

Fully ready?

@Aashish-Jha-11

Copy link
Copy Markdown
Contributor Author

@BaseMax Yes

@BaseMax

BaseMax commented Dec 26, 2025

Copy link
Copy Markdown
Member

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces a 'Featured Developer of the Month' showcase. It adds a new scoring algorithm to select a featured user, generates a featured.json file with their data, and displays it in a new UI section on the main page. The changes are well-structured, but there are opportunities for improvement in the Python scripts regarding code duplication, module structure, and adherence to PEP 8 guidelines for imports. The new JavaScript function for rendering the featured user could also be refactored for better maintainability.

Comment thread generate_featured.py Outdated
Comment thread docs/script.js
Comment thread fetch.py Outdated
Comment thread fetch.py
Comment thread fetch.py
Comment thread fetch.py Outdated
Comment thread generate_featured.py Outdated

@BaseMax BaseMax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, asking gemini to check it again.

@BaseMax

BaseMax commented Dec 26, 2025

Copy link
Copy Markdown
Member

Please finish all of above feedback as well and then tag @jbampton, he will take care and merge it.
Best

- Refactored loadFeaturedUser() into smaller, focused functions:
  - renderFeaturedUser() for DOM updates
  - getFeaturedUserElements() for element retrieval
  - updateFeaturedAvatar(), updateFeaturedInfo(), updateFeaturedStats(), updateFeaturedLanguages() for specific updates
- Moved datetime imports to top of file (PEP 8)
- Created constants for engagement score weights and thresholds
- Fixed DRY violation in generate_featured.py by importing save_featured_user
- Changed broad Exception to specific (IOError, OSError)
- Added final newline to featured.json output

All code quality improvements address Gemini bot's code review on PR john-bampton#187.
- Remove duplicate return statement (PYL-W0101)
- Use OSError instead of overlapping (IOError, OSError) (PYL-W0714)
@jbampton jbampton self-assigned this Dec 26, 2025

@BaseMax BaseMax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@BaseMax BaseMax merged commit 4f2d253 into john-bampton:main Dec 26, 2025
6 checks passed
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