Yii-dev-tool enhancements


(Pavel Ivanov) #1

Hi all :slight_smile:

I develop yii-dev-tool package for Yii3 contributors. I recently wrote about how to use this tool to develop the framework. Today I’ll write about the improvements that have been made since then.

Vagrant

Added ready-to-use Vagrant configuration. See related documentation. Now in a few minutes you can get a working environment for developing the framework. Just install, write code and commit it from the pre-configured virtual machine.

The stack is:

  • Ubuntu 18.04
  • PHP 7.4
  • Composer with prestissimo plugin
  • xDebug
  • htop
  • mc (Midnight Commander)

Now you do not need to configure anything locally to develop the framework. Instead, you can simply use the off-the-shelf environment.

Exec command

Added console command ./yii-dev exec. It makes it possible to execute any arbitrary console command at once in all repositories.

For example, you want to make a commit with custom options in all repositories:

./yii-dev exec 'git commit -S --message="Feature X" --amend'

It is also very convenient for managing a large number of repositories.

Composer config replication

A command has been added that replicates common composer configuration sections to all Yii3 repositories. This helps @samdark easily update dozens of repositories with a single console command.

For example, we have added such general sections of composer configurations:

{
    "require": {
        "php": "^7.4"
    },
    "require-dev": {
        "phpunit/phpunit": "^8.4"
    },
    "config": {
        "sort-packages": true
    }
}

Then @samdark executed only one console command ./yii-dev replicate/composer-config, and these sections were updated in all Yii3 repositories. This is very convenient for bulk changes.

Travis management commands

Two console commands have been added:

  1. ./yii-dev travis/ensure-cronjob
  2. ./yii-dev travis/update-slack-config

The first makes it possible to enable scheduled builds for the repository in Travis. The second configures Travis so that notifications about the results of the builds are sent to Slack.

Using these commands, we have successfully configured Travis crons for all Yii3 repositories :tada:

Now Travis builds are launched regularly on schedule for all Yii3 repositories, and notifications of results are sent to Yii Slack to channels #build-failures and #build-successes. If something breaks somewhere due to changes in interdependent repositories, we will immediately know about it.

Command prefixes

Some prefixes have been added. For example, prefix git/ has been added to git commands. Now they look like this:

  • git/checkout-branch
  • git/commit
  • git/pull
  • git/push
  • git/status

Verbosity mode

The verbosity of all console commands has been reduced. Now for verbose mode, you must explicitly specify option -v or --verbose. For example:

./yii-dev git/status --verbose

By default, each command now outputs only the most important information.

What’s next?

  1. I plan to develop a console command for releasing new package versions.
  2. I plan to parallelize the execution of the commands so that they run hundreds of times faster. For example, now an execution of git/pull for many repositories is slow due to network delays.

I hope this all helps to release a new version of the framework faster.

That’s all

Join the development of the framework :slight_smile: Let’s make cool stuff together.
Thanks for reading!


A detailed example of how to contribute to Yii 3.0
Yii 1, Yii 2.0.31 and Yii 3 progress
Contributing to Yii 3
#2

That looks odd, considering that Yii 3 will require PHP 7.4.


(Alexander Makarov) #3

That’s because I’ve switched everything except dev tool to 7.4 quite rapidly.


#4

Actually it is good that dev tool does not require PHP 7.4 (it will be easier to use it), but this vagrant box for Yii 3 development seems to be pretty useless right now.


(Pavel Ivanov) #5

Yes, you’re right :slight_smile: Just upgraded to PHP 7.4.