Skip to content

User profile troubleshooting#142

Closed
crockettz wants to merge 3 commits into
masterfrom
user_profile_troubleshooting
Closed

User profile troubleshooting#142
crockettz wants to merge 3 commits into
masterfrom
user_profile_troubleshooting

Conversation

@crockettz

Copy link
Copy Markdown
Contributor

Batches the user profiles instead of running them all at once. When it comes across the user profiles that are causing trouble, skips those and continues on. Modified the upload script to account for the changes to the methods_upload script.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the daily user-stats upload pipeline to fetch user profile data in batches (with retry/skip behavior) so that failures in the profile service don’t prevent processing all remaining users.

Changes:

  • Refactors get_profile_info to request profile data in batches, retry failed batches, and optionally re-run a failing batch without known problematic users.
  • Adds exception-message truncation to avoid flooding logs with very large profile-service error payloads.
  • Updates the cron entrypoint to call get_profile_info with explicit batching/retry parameters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
source/daily_cron_jobs/upload_user_stats.py Passes batching/retry parameters into get_profile_info during the daily upload run.
source/daily_cron_jobs/methods_upload_user_stats.py Implements batched profile-service requests with retries, skipping behavior, and safer error logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +38
# rather than just failing to return that one user's profile. Add usernames
# here once you've tracked them down (see
# methods_upload_user_stats_troubleshooting.py) so get_profile_info retries
# their batch without them instead of losing every other user in it.
Comment on lines +335 to +338
matter how many times it's retried as-is. When a batch fails and it
contains one of these users, the batch is NOT retried unchanged.
Instead it's re-run exactly once more with just those users removed
(batch size n - len(bad users in that batch)), so the rest of the
Comment on lines 364 to +365
counter = 0
for obj in resp["result"][0]:
if obj is None:
continue
counter += 1
if obj["user"]["username"] in user_stats_dict:
user_stats_dict[obj["user"]["username"]]["department"] = obj["profile"][
"userdata"
].get("department")
failed_batches = []
Comment on lines +475 to +477
user_stats_dict[obj["user"]["username"]]["research_statement"] = obj["profile"][
"userdata"
].get("country")
@crockettz crockettz closed this Jul 8, 2026
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.

2 participants