-
Notifications
You must be signed in to change notification settings - Fork 16
Add github_username to CustomUser for stats tracking (#615) #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add github_username to CustomUser for stats tracking (#615) #618
Conversation
|
Hi @tim-schilling and team! 👋 I'd like to work on this issue. I've reviewed @raffaellasuardini's library and analyzed how to integrate it into SessionAdmin. My approach would be:
Would it be okay if I take this on? Happy to discuss the implementation approach first if needed! |
|
@Moueen-Togarvi yup, yup that sounds good. If you feel like you're making some complex decisions, let us know and we can discuss. Otherwise I think this should be relatively contained. |
|
Thanks |
tim-schilling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Moueen-Togarvi, it looks like you're using an LLM to work on this. That's fine, but please review the code it's generating (tests are different). I mention this because this is a lot of code for something I'm hoping is a very small feature. I've also got some small comments since the codebase is currently under active development, so things have changed.
|
|
||
| class CustomUser(AbstractUser): | ||
| pass | ||
| github_username = models.CharField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be aware we've added this field to the UserProfile model already.
| def collect_stats_view(self, request, session_id): | ||
| """Handle GitHub stats collection for a session.""" | ||
| from .views.sessions import collect_stats_view | ||
|
|
||
| return collect_stats_view(request, session_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having this as an actual link rather than an action is probably best. I just introduced this in #619
| except GithubException as e: | ||
| logger.error(f"GitHub API error for {owner}/{repo_name}: {e}") | ||
| raise | ||
| except Exception as e: | ||
| logger.error(f"Error collecting PRs from {owner}/{repo_name}: {e}") | ||
| raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure these provide a lot of benefit since we have sentry configured for the project. If an error is going to occur, we're still going to get the exception.
No description provided.