Skip to content

SUP-52881 Add admin console UI to copy static conversion profile from… - #14062

Open
bw-kaltura wants to merge 2 commits into
West-23.5.0from
West-23.3.0-SUP-52881
Open

SUP-52881 Add admin console UI to copy static conversion profile from…#14062
bw-kaltura wants to merge 2 commits into
West-23.5.0from
West-23.3.0-SUP-52881

Conversation

@bw-kaltura

Copy link
Copy Markdown
Collaborator

… partner 0

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?

    • Enter your answer here
  2. Does this change affect production code or infrastructure?

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

    • Enter your answer here

@github-actions

Copy link
Copy Markdown

@github-copilot suggest

…ice instead of shelling out

Replaces the shell_exec call to copyConversionProfile.php with a proper
adminConsole plugin service/action (conversionProfileAdmin.copyFromPartnerZero),
following the same pattern used for entry restoration. Seeds the required
API action permission for partner -2 via a deployment script.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

@github-copilot suggest

@bw-kaltura
bw-kaltura requested a review from shahbaa123 August 5, 2026 09:14
@bw-kaltura
bw-kaltura changed the base branch from West-23.3.0 to West-23.5.0 August 5, 2026 09:39
@shahbaa123

Copy link
Copy Markdown
Collaborator

🤖 AI PR Review

🚦 Verdict: 🔴 CRITICAL

The new API action can be invoked with only a generic baseline permission (unlike every comparable sibling admin-console action, which pairs the generic permission with a dedicated one), turning what was historically an approval-gated, T3-only operation into a broadly callable self-service action.


📌 Context Summary & Code Archaeology

This PR replaces a manual T3-only script (alpha/scripts/utils/copyConversionProfile.php) with a self-service Admin Console tool to clone a static conversion profile from partner 0 to a destination partner. Historically, running that script required a T3 engineer, and in practice this operation has needed additional organizational sign-off before execution, since cloning/enabling a transcoding profile can affect a customer's storage/flavor footprint. The new code path removes the manual/human gate and exposes the same capability as a first-class API action (conversionProfileAdmin.copyFromPartnerZero) plus an Admin Console form.

There is also an existing, more complete utility for this exact operation: myPartnerUtils::copyConversionProfiles() (in alpha/apps/kaltura/lib/myPartnerUtils.class.php), already used by other partner-setup flows.


📋 Actionable Feedback

  1. BLOCKER — New mutating action has a weaker permission requirement than every comparable sibling. File: deployment/permissions/service.adminconsole.conversionprofileadmin.ini. All existing mutating actions in the sibling admin-console permission files pair the generic PARTNER_-2_GROUP_*_PERMISSION with a dedicated, specific permission — e.g. adminconsole_uiconfadmin.add/update/delete require SYSTEM_ADMIN_WIDGET, and adminconsole_entryadmin.restoredeletedentry requires RESTORE_DELETED_ENTRY in addition to the generic one. The new copyfrompartnerzero action is granted with only PARTNER_-2_GROUP_*_PERMISSION — no dedicated permission. This means any session holding just the baseline permission can invoke this cross-partner, data-mutating action directly via the API, regardless of the stricter access.index.copy-conversion-profile = SYSTEM_ADMIN_PUBLISHER_CONFIG ACL added for the Admin Console web page (that ACL only protects the web controller action, not the underlying API service action, which remains independently callable). Recommend adding a dedicated permission constant to this ini entry, mirroring the sibling pattern.

  2. MAJOR — Duplicates an existing, more complete utility instead of reusing it. File: plugins/admin_console/services/ConversionProfileAdminService.php, copyFromPartnerZeroAction(). myPartnerUtils::copyConversionProfiles() already implements "copy conversion profile(s) between partners," and does two things this new code does not:

    • It uses the generic conversionProfile2->copy() (full-column copy) rather than manually re-setting a hand-picked subset of fields (PartnerId, SystemName, Name, Description, ConditionalProfiles, Status, Type), so it won't silently miss a column added to the model later.
    • When copying each flavorParamsConversionProfile relation, it verifies the referenced flavor params actually belong to partner 0 before copying the relation (if ($flavorParams && $flavorParams->getPartnerId() === 0)). The new action copies every relation unconditionally, without that ownership guard.

    The new action should be built on top of (or reconciled with) this existing utility rather than re-deriving similar-but-narrower logic a third time (the original CLI script being the second).

  3. MAJOR — Per-item copy failures are not surfaced to the caller. File: plugins/admin_console/services/ConversionProfileAdminService.php, copyFromPartnerZeroAction(). Each flavorParamsConversionProfile copy is wrapped in its own try/catch that only logs (KalturaLog::err) and continues; the action still returns a normal, "successful" KalturaConversionProfile response even if some flavor params failed to copy. In the new self-service Admin Console flow, the operator has no way to learn about a partial copy short of checking server logs — the UI will show an unqualified success message either way.

  4. MINOR — Missing trailing newline at EOF. admin_console/forms/CopyConversionProfile.php, admin_console/views/scripts/index/copy-conversion-profile.phtml, and plugins/admin_console/services/ConversionProfileAdminService.php all end without a newline.

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