Manual Legacy License creation does not take custom email, company and name info, PART 2

Bug

Summary

This is effectively the same bug as #6187 (closed), but appears to occur now through a different code path.

When manually creating a Legacy License in the customersDot admin at /admin/license/new_license, any values entered in the fields for email, company and name won't be reflected in the created license when a subscription ID is entered, but instead pull the values from the associated Sold To BillingAccountContact attached to the Subscription and BillingAccount.

The custom values are correctly saved into the database entry, and will appear when viewing the license from within cDot (/admin/license/1234567) or a rails session (License.find 1234567), but the encrypted license file itself is generated with the undesired values, confirmable by decoding the license blob at /admin/license/validate_license, or applying it to a GitLab system.

RailsAdmin::CreateLicenseService initializes a new License here, and then, after creation of the License, generate_license_file is triggered, itself then calling the relatively newish model Encrypted::License, which appears to always prefer values taken from the BillingAccountContact over any supplied values.

Steps to reproduce

  1. Have a subscription associated to a BillingAccount with a valid Sold To BillingAccountContact
  2. Create a new legacy license at /admin/license/new_license
    • Select License type == Legacy License
  3. Enter any custom values into Name, Company, and/or Email
  4. Ensure Zuora subscription ID matches the ID of your subscription from step 1
  5. Create license and observe that the license is shown in cDot with your entered custom values, but installing it or decoding it locally will show Name, Company, and/or Email match that of your Sold To BillingAccountContact instead

What is the current bug behavior?

License is silently encoded with unintentional values; cDot hides the true values of the license by retrieving them from the License model database entry rather than what's encoded in the file

What is the expected correct behavior?

Entered values should persist into license file

Workarounds

Modify the Sold To BillingAccountContact temporarily prior to creating the license, then revert


Support Priority Score: (1, -, -, 2, -, -, -, -, -, -, -) => 3