Sitecore.FakeDb icon indicating copy to clipboard operation
Sitecore.FakeDb copied to clipboard

Proposal: Updates to support Sitecore 9.x

Open sc-alistairdeneys opened this issue 4 years ago • 5 comments

I'd like to submit some contributions to add support for the 9.x Sitecore versions. Unfortunately there have been some breaking changes in the APIs which mean we'll need to handle each major Sitecore version differently.

Looking at the v2 branch, it would appear support for the older Sitecore versions has been removed, as would be necessary to get the library building. Therefore, I propose we increment the major version of FakeDB as necessary to add support for each of the Sitecore 9.x versions. Something like:

  • FakeDB 1.x (current release) for Sitecore 7.5 - 8.2
  • FakeDB 2.x (next immediate release) for Sitecore 9.0 - 9.1
  • FakeDB 3.x for Sitecore 9.2 - 9.3

In addition to the versioning changes, I'd also like to make a few changes to make the project easier to work with:

  • Migrate the projects over to NET SDK format (the format used for .net core projects) as it makes management of NuGet packages so much easier.
  • Switch references over to using the official Sitecore NuGet feeds. All Sitecore 9.x versions are available on the feeds.

I intend to make these contributions myself.

Any concerns with this proposal?

sc-alistairdeneys avatar Oct 08 '19 01:10 sc-alistairdeneys

Hi @sc-alistairdeneys! Thanks for your input!

Versioning approach looks good to me.

Regarding the migration. I'd love to do so but it seems it requires some additional research. Now there is a custom ConfigReader which performs some vital initial configurations. It's like an entry point to the lib! Sounds weird but it did the job for many years and without it nothing works :). And it stops working in SDK projects. Maybe I overlooked smth, but for now that's a stopper.

sshushliapin avatar Oct 08 '19 05:10 sshushliapin

My initial researched didn't show any issues; with an SDK format project everything was still working fine, including all the tests. I'll prep the PR and you can validate @sshushliapin.

sc-alistairdeneys avatar Oct 08 '19 06:10 sc-alistairdeneys

To continue this conversation, will you be supporting 9.3?

mikeedwards83 avatar Dec 02 '19 10:12 mikeedwards83

My initial reaction was to say "yes" for 9.3 support, but then I'm wondering whether we should sit back and see if it's necessary.

The abstractions in Sitecore have got a lot better, to the point that FakeDB shouldn't be required for unit testing on later versions of Sitecore. What do you think @sshushliapin?

I'll continue with adding the 9.x support (looks to be working locally, just need time to check fully) up until version 9.2.

sc-alistairdeneys avatar Dec 02 '19 23:12 sc-alistairdeneys

The abstractions in Sitecore have got a lot better, to the point that FakeDB shouldn't be required for unit testing on later versions of Sitecore. What do you think @sshushliapin?

Yes, it is not required anymore. TBH, I haven't used FakeDb for the past two years...

I do not plan any further development but if it's possible to make it 9.2/9.3 compatible and it will work, then, of course, I'm ready to support this.

sshushliapin avatar Dec 03 '19 06:12 sshushliapin