-
Notifications
You must be signed in to change notification settings - Fork 182
Enhance email analysis script with metadata options #13736
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: Venus-22.10.0
Are you sure you want to change the base?
Enhance email analysis script with metadata options #13736
Conversation
Adds the --metadata-all-users option to fetch metadata roles for all processed users, with validation to require --metadata-profile-ids. Improves email field handling by treating empty or invalid emails as missing, normalizes user buckets, and updates report generation to support metadata enrichment for all users. Refactors and cleans up code for consistency and reliability.
|
@github-copilot suggest |
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.
Pull request overview
This PR enhances the email analysis script with metadata enrichment options and improves email handling. It introduces the --metadata-all-users flag to fetch metadata roles for all processed users (not just duplicates) and adds validation requiring --metadata-profile-ids to be specified. The changes also improve email field handling by treating empty or invalid emails as missing, normalizing user buckets accordingly, and updating report generation to support metadata enrichment for all users.
- Adds
--metadata-all-usersoption with validation requiring--metadata-profile-ids - Improves email validation by treating empty/invalid emails as missing and normalizing user buckets
- Updates report generation to support metadata enrichment for all users when enabled
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $dup['createdAt'] ?? '', | ||
| $dup['externalId'] ?? '', | ||
| $dup['isAdmin'] ?? '', | ||
| $dup['isAdmin'] ? "true" : "false", |
Copilot
AI
Jan 1, 2026
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.
Potential undefined index error. The $dup['isAdmin'] key may not exist in the array, which would trigger a PHP notice. Add a null coalescing operator to provide a default value: ($dup['isAdmin'] ?? false) ? \"true\" : \"false\".
| $dup['isAdmin'] ? "true" : "false", | |
| ($dup['isAdmin'] ?? false) ? "true" : "false", |
| $row[] = $metadataRolesByUser[$kuserId][$profileId] ?? 'not-found'; | ||
| } else { | ||
| $row[] = 'not-checked'; | ||
| $row[] = 'not-checked-no-duplicate'; |
Copilot
AI
Jan 1, 2026
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.
The value 'not-checked-no-duplicate' is inconsistent with the new value 'not-checked-no-duplicate' introduced elsewhere. Consider using a consistent naming convention across all metadata status values, such as 'not-checked-no-duplicate' everywhere or defining these as constants for consistency and maintainability.
Updated email exclusion logic to also check puserId against exclusion patterns throughout the script. Refactored filtering of user and email lists to use both email and puserId, and updated related function signatures and documentation for clarity. Improved handling of CSV user data to support richer user information.
|
@github-copilot suggest |
Adds the --metadata-all-users option to fetch metadata roles for all processed users, with validation to require --metadata-profile-ids. Improves email field handling by treating empty or invalid emails as missing, normalizes user buckets, and updates report generation to support metadata enrichment for all users. Refactors and cleans up code for consistency and reliability.
Pull Request Checklist
Please complete the following before submitting:
General notes -
New Kaltura Types
New Kaltura Services / Actions
Questions
What is the purpose of this PR?
Does this change affect production code or infrastructure?
If yes, what is the rollback plan?