Development/Workflow improvements

Discussion in 'Developers' Forum' started by MaddinXx, Aug 1, 2013.

  1. MaddinXx

    MaddinXx Member HowtoForge Supporter

    Hiho

    Please let me use this topic to share some ideas I have/had that could help improving the ISPConfig development/workflow and the ISPConfig software quality in general.

    I'm totally aware of the fact that most of the following tips are rather radical, e.g. you are a fan of this-way or you aren't...that's fine. It might then however still be good to see what could be done (regardless if it's useful in your view).

    1. Refactor Releases
    Refactor releases are meant to clean up code, e.g. improve the code quality. Refactor releases will never add new functionality or focus on bug fixing - the goal is just to improve existing code and make it easier, more reusable etc.

    Since the release cycle of ISPConfig is rather slow (which is good) I would recommend to make every 3th or 4th release a refactor release. This may feel like lost time, but it isn't. In the end it can safe a lot of further work/time when refactoring often and good.

    What would be typical refactoring works:
    • complete phpDoc
    • apply global coding standard (e.g. CheckStyle)
    • try to remove duplicate content by better organizing the code
    • write tests for things that don't have any..
    • etc.

    Priority: High

    2. Testing / CI Builds
    As far as I've seen ISPConfig has no tests (unit tests etc.). I know writing tests is pure pain and it does work without - but it would for sure be better to have test integration.

    Why are tests so good?
    As more and more people work on the code, chances are big that updating one part (e.g. fixing a bug there) may lead to other bugs in other parts of the software. Without tests, it's hard to detect such problems.
    But imagine you could run the test suite and see: "Ah, I've destroyed something over there...bad me". That would be great, wouldn't it?

    Tests could then be run e.g. nightly on a CI server.

    Priority: Low-Medium

    3. API focused
    A lot software projects (Gitlab to name one) built there web interfaces around the software's API. That way, there is one central "core" (the API) that needs to be updated (and is always the most up-to-data version (where the API gets often forgotten elsewhere)). This allows great flexibility...but please read more about this concept yourself as this one is absolutely a radical one.

    Priority: Low

    There might of course be more such guides/ideas that could improve ISPConfig - but that are the ones that came to my mind. Please add your's as well if you have any.

    PS: This topic is not about critic, telling something is bad or something other negative. It's just about: "Hey, wouldn't this be a good idea to further improve the development process?"

    Thanks
    & love to hear what you think
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thanks for your suggestions to improve the ISPConfig development.

    1) ISPConfig has already major and minor releases were major releases include the major changes in the api and also the big improvements while the minor release contain mostly bugfixes. And we have coding standards and clean code.

    2) If you want to write a test framework for ispconfig, feel free to do that.

    3) ISPConfig uses a form centric development approach and has a great api for that, such form centric frameworks are used by many large systems and projects as they allow a secure and rapid development. The remote api gets all it's information form the same form files, so its up date automatically as well.
     
    Last edited: Aug 1, 2013
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The more I think about it, the more i like the approach with the test framework. It will get a bit complicated as it will involve automating different clients like ftp, imap, pop3 etc. to test the configurations build by ispconfig but it should be possible to do that.

    We started to add phpdoc comments in some files already but there is still a lot of work. So help in this area is always welcome.

    And please dont get me wrong, I really appreciate your work on ispconfig and thoughts about improving the ispconfig development. My main focus is to keep this project on track for the ispconfig users, keep ispconfig stable and secure. I'am always working to improve the development enviroment as well but I prefer to do this in small steps.
     
  4. MaddinXx

    MaddinXx Member HowtoForge Supporter

    Hey till

    I just wrote down some tools that might be simple enough to use (without rewriting the whole ISPConfig code) but still add revenue:

    Code:
    ## Composer (http://getcomposer.org/)
    
        > curl -sS https://getcomposer.org/installer | php
    
    ## PHP CS Fixer (https://github.com/fabpot/PHP-CS-Fixer)
    
    > php composer.phar create-project fabpot/php-cs-fixer:dev-master
    
        ./php-cs-fixer/php-cs-fixer fix .
    
    ## PHP Analyzer (https://github.com/scrutinizer-ci/php-analyzer)
    
    > php composer.phar create-project scrutinizer/php-analyzer:dev-master
    
        ./php-analyzer/bin/phpalizer run .
    
    ## APIGen (https://github.com/apigen/apigen)
    
    > php composer.phar create-project apigen/apigen:dev-master
    
        php ./apigen/apigen.php -s helper_scripts -s interface -s server -s install -s remoting_client -d dist/APIGen --title "ISPConfig3 API Documentation" --todo --download --report
    php-cs-fixer ensures all source code has the same formatting. It's just a wrapper/addition to phpcs (which has a lot of config options) - but it might already be good if everyone committing would run this tool first.

    php-analyzer..not much to say, title says it all.

    And finally ApiGen, which generated nice API documentations (like phpDoc, but I like it better).

    I suggest you to take the time and try those tools..they are really nice.

    PS: I integrated a lot of CI/automation stuff in one of my projects recently (https://github.com/Rackster/ossec-wuicore) (see badges)...if you see a "live version" of how helpful such things can be that might help you with your decision ;)

    Regards,
    Michel

    PS: A happy new year as well.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Thanks for posting the tools. I will check them out.

    The code has been completely reformatted in nov or dec. lst year.
     
    Last edited: Apr 9, 2014
  6. jan.koprowski

    jan.koprowski New Member

    Regarding testing framework I believe using selenium + xvfb + classes wrapping cmd line tools like: quota, /etc/passwd will be good start. Is what you are thinking about or you are thinking about something more fancy?
     

Share This Page