Skip to content

fix(portal): resolve hero avatars by user id#447

Open
gvieira18 wants to merge 4 commits into
4.xfrom
fix/portal-hero-avatars
Open

fix(portal): resolve hero avatars by user id#447
gvieira18 wants to merge 4 commits into
4.xfrom
fix/portal-hero-avatars

Conversation

@gvieira18

@gvieira18 gvieira18 commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Resolve GitHub avatars in the portal hero section via the stable numeric external_account_id (avatars.githubusercontent.com/u/{id}) instead of parsing the metadata username/name, which could be stale or renamed.
  • Filter to identities with a numeric external_account_id present, dropping the ad-hoc metadata handle extraction.
  • Add HeroAvatarsTest feature coverage for the active-user + GitHub-identity avatar resolution.

Coverage (GitHub identities, non-deleted)

Strategy Resolvable avatars
By user id (external_account_id, new) 2643
By username (metadata.username|name, old) 2643
Resolvable by user id only 0
Resolvable by username only 0

Coverage is identical (all 2643 identities carry both), so no users lose their avatar. The change is about stability: numeric user-id URLs survive GitHub username renames, whereas the old username-based URLs break on rename.

Test plan

  • php artisan test --compact --filter=HeroAvatars
  • Visit the portal homepage and confirm hero avatars render for active users

Use the stable GitHub numeric account id to build avatar URLs
instead of parsing the metadata username, which could be stale.
@gvieira18
gvieira18 requested a review from a team July 23, 2026 12:18
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: ca2a91a7-c113-44fa-b435-e470861fe7a5

📥 Commits

Reviewing files that changed from the base of the PR and between 6201d45 and f12e06c.

📒 Files selected for processing (1)
  • app-modules/portal/src/Livewire/HeroSection.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • app-modules/portal/src/Livewire/HeroSection.php

📝 Walkthrough

Walkthrough

HeroSection::fetchAvatars() now generates GitHub CDN avatar URLs from numeric external_account_id values. Feature tests cover numeric IDs, non-empty URLs, avoidance of the github.com domain, and rejection of non-numeric IDs.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: resolving portal hero avatars by numeric user ID.
Description check ✅ Passed The description directly matches the avatar-resolution change and added test coverage.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app-modules/portal/src/Livewire/HeroSection.php`:
- Around line 84-88: Update the query in the HeroSection data-loading chain to
filter numeric external_account_id values before applying limit(10), using a
database-level numeric predicate where supported; remove the reliance on the
post-pluck ctype_digit filter for enforcing the limit so up to 10 valid IDs can
be selected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d70590a-63b7-4111-8b37-c3eb9623f010

📥 Commits

Reviewing files that changed from the base of the PR and between b5a1919 and 6201d45.

📒 Files selected for processing (2)
  • app-modules/portal/src/Livewire/HeroSection.php
  • app-modules/portal/tests/Feature/HeroAvatarsTest.php

Comment thread app-modules/portal/src/Livewire/HeroSection.php Outdated

@fernanduandrade fernanduandrade 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.

Muito boa alteração, garantindo a assertividade da renderização da imagem 🎉

@davicbtoliveira davicbtoliveira 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 ✅

@ewbenigno ewbenigno 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.

LGTM!

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.

4 participants