London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Nuget package source mapping with Optimizely

Vote:
 

Package source mapping is a smart concept when you have multiple package sources - which all Optimizely projects have by default.

It's been working pretty good for a while but with the latest releases we've had to tweak our config. 

This because the Optimizely.SDK (experimentation) nuget is distributed on nuget.org, but the new Optimizely packages (e.g. Optimizely.PaymentService.Client), which comes transitively with EPiServer.Commerce, are distributed on nuget.optimizely.com.

So this mapping does not work anymore:

<packageSourceMapping>
    <packageSource key="Optimizely">
        <package pattern="EPiServer.*" />
    </packageSource>
    <packageSource key="nuget.org">
        <package pattern="*" />
    </packageSource>
</packageSourceMapping>

...instead we need to resort to this "hacky" config, which seems to work for the moment....

<packageSourceMapping>
    <packageSource key="Optimizely">
        <package pattern="EPiServer.*" />
        <package pattern="Optimizely.*" />
    </packageSource>
    <packageSource key="nuget.org">
        <package pattern="Optimizely.SDK" />
        <package pattern="*" />
    </packageSource>
</packageSourceMapping>

I guess this stems from the confusion between the product formerly known as Optimizely and the company formerly known as Episerver.

Just wondering if anybody else is using package source mapping with Optimizely?

#337090
Mar 03, 2025 13:50
Vote:
 

While the idea of this is tempting because there is a more sustainable approach where multiple package sources are concerned, the complications here would need lots of patterns as not everything that comes from the Optimizely nuget feeds starts with EPiServer or Optimizely.

In practice all of my nuget.config packages are relatively simple:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="optimizelyV3" value="https://api.nuget.optimizely.com/v3/index.json" />
    <add key="optimizelyV2" value="https://nuget.optimizely.com/feed/packages.svc" />
  </packageSources>
</configuration>
#337871
Apr 17, 2025 14:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.