Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Monday, 30 November 2020

HelixCheck - update v 1.0.1

I've just released a quick update to my GitHub Action - HelixCheck.

New release includes additional input parameter named excluded-projects which can be used to exclude projects that we don't want to be analysed. Example setup:

name: Helix Check

on:
  push:
    branches: [ develop, master ]
  pull_request:
    branches: [ develop, master ]

jobs:
  check_job:
    name: Helix check
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Helix Check
        uses: ethisysltd/helix-check@v1.0.1
        id: check
        with:
          solution-file: 'Helixbase.sln'
          project-name: 'Helixbase'
          website-folder: 'website'
          excluded-projects: 'Helixbase.Foundation.NotFollowingHelix,Helixbase.Feature.RatherNotFollowingHelix'
      
      - name: Get the check result
        run: echo "Check result - ${{ steps.check.outputs.result }}"
      
      - name: Get the output time
        run: echo "The time was - ${{ steps.check.outputs.time }}"

Value of that parameter should be a string with comma-delimited names of projects. I couldn't use YAML's multiline collections syntax here because of GitHub Actions limitations.

Ideally this parameter shouldn't be used, as Helix project setup should be clean, but I've got some requests to add this. And, as usual, in real world solutions there can be legacy projects which might be a work in progress of refactoring, so there it goes!

If used, there will be additional warning added to the output, which won't affect the result outcome but will add more visibility of the setup gotchas:

This action can be found in GitHub marketplace here: https://github.com/marketplace/actions/helix-check

Code repo is available here: https://github.com/ethisysltd/helix-check


Thursday, 23 July 2020

HelixCheck - GitHub action

Recently I've prepared a GitHub action that checks solution structure to see if it is Helix compliant and follow guidelines of folders structure.

It is available on GitHub marketplace and ready to be used with Sitecore projects following Helix principles - https://github.com/marketplace/actions/helix-check.


If you're not familiar with GitHub actions you can read more about it here https://github.com/features/actions or in technical documentation - https://docs.github.com/en/actions.

General rules

Action tries to reflect Helix rules from documentation - https://helix.sitecore.net/

Projects references:
  • Feature layer projects can only reference Foundation
  • Foundation layer projects can only reference other Foundations
  • Project layer projects can reference Feature and Foundation but not other Projects
Folders structure and naming convention:
  • There are layer folders specified in the solution
    • Feature
    • Foundation
    • Project
  • Projects are placed in correct folders, for example:
    • src\Feature\ORM\website\Helixbase.Foundation.ORM.csproj - incorrect
    • src\Foundation\ORM\website\Helixbase.Foundation.ORM.csproj - correct

    Configuration

    Example workflow:

    name: Helix Check
    
    on:
      push:
        branches: [ develop, master ]
      pull_request:
        branches: [ develop, master ]
    
    jobs:
      check_job:
        name: Helix check
        runs-on: ubuntu-latest
    
        steps:
          - name: Checkout
            uses: actions/checkout@v2
    
          - name: Helix Check
            uses: ethisysltd/helix-check@v1.0
            id: check
            with:
              solution-file: 'Helixbase.sln'
              project-name: 'Helixbase'
              website-folder: 'website'
          
          - name: Get the check result
            run: echo "Check result - ${{ steps.check.outputs.result }}"
          
          - name: Get the output time
            run: echo "The time was - ${{ steps.check.outputs.time }}"

    It should be placed inside folder .github\workflows\ and named something like helix-check.yml

    Action is configured by these inputs:

    Input Description Usage
    solution-file Path to the solution that will be analyzed. Required
    project-name The name of your project. Required
    website-folder The name of the folder that always contain website project file.
    Default "website", earlier "code" was used.
    Optional

    While using the action makes sure you've checked the readme.md inside repo, as it will always be most up to date - https://github.com/ethisysltd/helix-check.

    In the action repository I've put example Helix solutions for tests - Helixbase by Neil Shack.
    If there are no issues found, simple log message is shown.

    Solution file: example-solution/valid/Helixbase.sln
    Project name: Helixbase
    Solution file exists.
    
    Solution is Helix compliant.


    I've managed to add a copy of that one and mess it up really badly so you can see result of analysis:

    Solution file: example-solution/invalid/Helixbase-Invalid.sln
    Project name: Helixbase
    Solution file exists.
    
    ##[warning]Issues with project Helixbase.Foundation.ORM
     Folder incorrect: src\Feature\ORM\code\Helixbase.Foundation.ORM.csproj
    
    ##[warning]Issues with project Helixbase.Feature.Hero
     Folder incorrect: src\Foundation\Hero\code\Helixbase.Feature.Hero.csproj
    
    ##[warning]Issues with project Helixbase.Project.Helixbase
     Incorrect references:
      - Helixbase.Project.Common
    
    ##[warning]Issues with project Helixbase.Feature.VersionTrim
     Incorrect references:
      - Helixbase.Project.Common
      - Helixbase.Feature.ShowTitles
    
    ##[warning]Issues with project Helixbase.Foundation.Core
     Incorrect references:
      - Helixbase.Feature.Redirects
      - Helixbase.Project.Common

    ##[error]Solution is not Helix compliant.

    Action is released to the Marketplace under https://github.com/marketplace/actions/helix-check. I will be adding additional checks soon, feel free to give me a shout if you find any issues or bugs.

    Cheers!

    Tuesday, 28 February 2017

    Sitecore development basics - Tools overview

    As a Sitecore beginner it is very hard to get to know with all the tools used in Sitecore development process. Especially that you don't even know that some of them even exist. In this article I will try to collect must-haves that every Sitecore developer should know and use.

    Object mapping

    Object mapping frameworks are very useful in Sitecore. Using some objects based on transparent classes with full Intellisense support is more comfy than using Items with fields explicitly.

    Glass.Mapper is the most popular ORM for Sitecore. It gives the availability to map Sitecore items to strongly typed objects, then they can be used in general code and unit tests as well. Glass is well optimized and easy to use.

    Glass.Mapper has its own website - http://glass.lu/.
    Tutorials can be found there also - http://glass.lu/Mapper/Sc/Tutorials.
     


     

    Fortis is a tool similar to Glass but it is more like a wrapper than the mapper. It encapsulates Sitecore items with interfaces. Code is available here: https://github.com/Fortis-Collection/fortis and more info about usage here: http://fortis.ws/quick-start/ and here: http://fortis.ws/about/


    Synthesis takes different approach than the two ones described earlier. It generates code based on templates in Sitecore instead of mapping fields or wrapping items. It is also very fast. Synthesis code is available on GitHub - https://github.com/kamsar/Synthesis and more info on wiki there https://github.com/kamsar/Synthesis/wiki

    Serialization

    Data serialization is a must in Sitecore projects. Solution must have a way to transfer templates, layouts and other types of items to different environments. It also should be automated for e.g deployments. Luckily there are some cool tools that solve this problem.

    Team Development for Sitecore (TDS) is a tool from Hedgehog Development that gives availability to put and manage Sitecore items from the Visual Studio. Beside the serialization features it has a lot of other functionalities like code generation, .update package generation, delta deployments and many more. It is easy to use as well.

    Official website - http://www.teamdevelopmentforsitecore.com/
    Documentation - http://hedgehogdevelopment.github.io/tds/


    Unicorn - tool from Connective DX, created by Kam Figy. Solves the same problems as TDS but in a bit different way. Whole serialization setup is configured in config patches and also there is a web console to fire the synchronization. Worth to mention are also Rainbow - new serialization engine using yaml files for items (they merge excellently) and also transparent sync. And off course it is free to use.

    Repo at GitHub - https://github.com/kamsar/Unicorn
    Kam's blog - http://kamsar.net/ - highly recommended source for new versions information.


    Sitecore Courier is a tool that can build Sitecore update packages automatically. It can analyze serialized items and pack only changed ones. It comes with console runner, so builing packages is even easier. You can find it at Sitecore Marketplace: https://marketplace.sitecore.net/en/Modules/Sitecore_Courier.aspx and the code is located at GitHub: https://github.com/adoprog/Sitecore-Courier. More info can be found at blog by Alexander Doroshenko: http://sitecoresnippets.blogspot.com/2012/10/sitecore-courier-effortless-packaging.html



    Continuous Integration


    Sitecore Ship is a tool that gives availability to install Sitecore update packages remotely. As TDS and Unicorn have their own hooks for integrating with CI systems, Sitecore Ship fills a lack of it in Sitecore Courier. Full code is available on GitHub: https://github.com/kevinobee/Sitecore.Ship. Api documentation is here: http://docs.sitecoreship.apiary.io/. There are also PowerShell functions by Patrick Perrone https://github.com/patrickperrone/Sitecore.Ship-PowerShell-Functions




    Sitecore Package Deployer from Hedgehog Development is a similar tool to Sitecore Ship. Instead of deploying packages sent by HTTP it deploys them from file system. More info you can find on TDS website: https://www.teamdevelopmentforsitecore.com/Blog/sitecore-package-deployer. Full codebase is available at GitHub: https://github.com/HedgehogDevelopment/SitecorePackageDeployer - you can find there installer also - built as .update package.

    Data migration

    Sometimes we need to transfer data between some Sitecore instances. It might be for update UAT environment with production content or maybe for Sitecore upgrade purposes, with approach of setting fresh new Sitecore instance.

    RAZL is another nice tool from Hedgehog Development. It's purpose is to add availability to compare databases of two Sitecore instances and look for differences. It also adds option to move and synchronize data between instances.


    Content Migrator Sidekick App by Jeff Darchuk is a tool for moving data between instances. It's core is Rainbow - serialization engine designed by Kam Figy for Unicorn. It needs a Sidekick installed first: https://jeffdarchuk.com/2016/10/03/sitecore-sidekick/. More info you can find at Jeff's blog: https://jeffdarchuk.com/2016/10/24/sitecore-sidekick-content-migrator/.


    Coast for Sitecore is a module that was designed to give an easy copy-paste functionality for moving items between Sitecore instances. Here is more info about that: https://www.geekhive.com/buzz/post/2016/11/introducing-coast-for-sitecore/. Now, there is a version 3.0: https://www.geekhive.com/buzz/post/2017/02/introducing-coast-for-sitecore-version-3-0/. You can find it on Sitecore Marketplace: https://marketplace.sitecore.net/en/Modules/S/Sitecore_Coast.aspx.

    Visual Studio plugins


     Sitecore Rocks was designed to integrate whole Sitecore stuff with Visual Studio. You can connect with your instance, edit items and manage just like in the Content Editor. It can really increase developer productivity. Plugin is available here: https://marketplace.visualstudio.com/items?itemName=JakobChristensen.SitecoreRocks and code on GitHub: https://github.com/JakobChristensen/Sitecore.Rocks

    Unit testing

    FakeDb is a unit testing framework for Sitecore. It enables creating fake Sitecore database, so then it can be used in tests. It can be found on GitHub: https://github.com/sergeyshushlyapin/Sitecore.FakeDb. There is also a pretty nice documentation: https://github.com/sergeyshushlyapin/Sitecore.FakeDb/wiki


    AutoSitecore is a bunch of AutoFixture customizations prepared to use new testability features in Sitecore 8.2. It was created by Dan Soloway and it is available here https://github.com/dsolovay/AutoSitecore


    Solution architecture


    Helix, as the documentation says, is a set of overall design principles and conventions for Sitecore development. You might heard of this from Habitat project, which was the introduction to that approach. Helix was prepared to structurize all of that principals. Full documentation is here: http://helix.sitecore.net/. Full code of Habitat is here: https://github.com/sitecore/habitat.

    Ignition - this is a development accelerator designed by team at Perficient. You can read more about that at Perficient website http://blogs.perficient.com/microsoft/2016/06/sitecore-developers-start-your-ignition/. Whole code is available on GitHub https://github.com/sitecoreignition/SitecoreIgnition. Here is also quick start guide: https://www.youtube.com/watch?v=rtd1XkWFKhw.






    Sitecore official modules

    Web Forms For Marketers (WFFM)
    Module that adds availability to create forms in Sitecore and use them to collect user information and store it for analytics purposes. Official documentation is here: https://doc.sitecore.net/web_forms_for_marketers/

    Email Experience Manager (EXM)
    EXM is a module that enables creating e-mail campaigns. Official documentation: https://doc.sitecore.net/email_experience_manager

    Federated Experience Manager (FXM)
    FXM module is used to integrate non-Sitecore sites with existing Sitecore instance. You can track user information and collect that to extend whole user profile in Sitecore. Official documentation: https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/federated_experience_manager

    Sitecore Experience Accelerator (SXA) 
    SXA provides reusable layouts and components for rapid website development. Official documentation: https://doc.sitecore.net/sitecore_experience_accelerator

    Sitecore marketplace modules

    Sitecore PowerShell Extensions - this module gives you the power of PowerShell inside Sitecore. It is incredibly useful and fast for advanced usage. A lot of examples can be found on blog by Adam Najmanowicz: http://blog.najmanowicz.com/sitecore-powershell-console/. You can download it from Sitecore Marketplace: https://marketplace.sitecore.net/en/Modules/Sitecore_PowerShell_console.aspx.



    Front-End development

    Feydra is another great tool from Hedgehog development. It gives front-end developers availability to work directly on virtualized Sitecore instance using their own tools. They can commit changes without intervention of back-end developers. More info about Feydra can be found here: http://www.teamdevelopmentforsitecore.com/Feydra.


    Other stuff

    Dianoga is a tool from Kam Figy that optimizes images for the media library. Full code is available here: https://github.com/kamsar/Dianoga.

    Sitecore Instance Manager (SIM) is a great app that will help you manage your Sitecore instances. You can rapidly install new fresh instance with just few clicks. That is really helpful while investigating if some bugs are present in clean Sitecore or just in your code. You can download it from Marketplace: https://marketplace.sitecore.net/en/Modules/Sitecore_Instance_Manager.aspx and the code is available on GitHub: https://github.com/Sitecore/Sitecore-Instance-Manager

    Sitecore Log Analyzer (SCLA) is a tool for analyzing Sitecore logs. It is very handy in situation when you need to find some entries but logs are splitted. You can search by dates and entry types. You can download it from Marketplace: https://marketplace.sitecore.net/en/Modules/Sitecore_Log_Analyzer.aspx

    Sitecore Support Package Generator (SSPG) was designed for helping developers collecting all crucial data needed to investigate problem by Sitecore Support. It is very useful - it can take all required Sitecore and IIS logs, pack it and send right to Support. It is available at Sitecore Marketplace: https://marketplace.sitecore.net/en/Modules/Sitecore_Support_Package_Generator.aspx

    Summary

    Off course this list is just a quick overview of available Sitecore tools, but I hope it will give you more information how efficiently develop Sitecore applications. Happy Sitecoring!