Skip to content

Conversation

@orekalt
Copy link
Collaborator

@orekalt orekalt commented Jan 1, 2026

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 -

  • I have tested the changes locally.
  • I have written unit tests where applicable.
  • I have updated documentation where needed.
  • I have added comments to complex code.
  • This PR follows the coding style guidelines.
  • I have updated release notes with new feature

New Kaltura Types

  • I have created new clients
  • I have notified related apps - KMCNG / KMS / EP .... about new clients

New Kaltura Services / Actions

  • I have added a deployment script

Questions

  1. What is the purpose of this PR?

    • Update for alpha script analyzeEmailFieldForPartner
  2. Does this change affect production code or infrastructure?

    • Yes
    • No
  3. If yes, what is the rollback plan?

    • N/A

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.
@orekalt orekalt requested review from Copilot and hilak January 1, 2026 15:25
@orekalt orekalt self-assigned this Jan 1, 2026
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

@github-copilot suggest

Copy link
Contributor

Copilot AI left a 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-users option 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",
Copy link

Copilot AI Jan 1, 2026

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\".

Suggested change
$dup['isAdmin'] ? "true" : "false",
($dup['isAdmin'] ?? false) ? "true" : "false",

Copilot uses AI. Check for mistakes.
$row[] = $metadataRolesByUser[$kuserId][$profileId] ?? 'not-found';
} else {
$row[] = 'not-checked';
$row[] = 'not-checked-no-duplicate';
Copy link

Copilot AI Jan 1, 2026

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.

Copilot uses AI. Check for mistakes.
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-actions
Copy link

github-actions bot commented Jan 5, 2026

@github-copilot suggest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants