Skip to content

Conversation

@orekalt
Copy link
Collaborator

@orekalt orekalt commented Dec 22, 2025

Introduces removeExternalIdFromUser.php, an alpha script for removing external IDs from users of a specified partner, based on a provided CSV list. Supports dry run and real run modes, generates a CSV report of the operation, and includes error handling and logging.

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?

    • Alpha script to remove extrernal Ids from users.
  2. Does this change affect production code or infrastructure?

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

    • N/A

Introduces removeExternalIdFromUser.php, an alpha script for removing external IDs from users of a specified partner, based on a provided CSV list. Supports dry run and real run modes, generates a CSV report of the operation, and includes error handling and logging.
@orekalt orekalt requested review from Copilot and hilak December 22, 2025 18:07
@orekalt orekalt self-assigned this Dec 22, 2025
@github-actions
Copy link

@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 introduces an alpha script to remove external IDs from users of a specified partner. The script reads user IDs from a CSV file, removes their external IDs, and generates a detailed CSV report of the operation.

  • Adds a command-line script with support for dry-run and real-run modes
  • Implements CSV parsing with flexible header detection (case-insensitive 'puserId' column)
  • Generates timestamped CSV reports tracking which users were updated

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

Renamed functions for consistency (removeExternalIDFromuser to removeExternalIdFromUser, writeReportoCsv to writeReportToCsv) and updated variable names for clarity. Improved and expanded PHPDoc comments for better maintainability. Fixed report filename generation and corrected criteria variable names in getPUsersIn.
@github-actions
Copy link

@github-copilot suggest


$puserCriteria = new Criteria();
$puserCriteria->add(kuserPeer::PARTNER_ID, $partnerId, Criteria::EQUAL);
$puserCriteria->add(kuserPeer::STATUS, KuserStatus::DELETED, Criteria::NOT_EQUAL);
Copy link
Contributor

Choose a reason for hiding this comment

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

@orekalt no need to set STATUS criteria- kuserPeer sets this as part of its default criteria.

kuserPeer::setDefaultCriteriaFilter();

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.

3 participants