Skip to content

Composer.lock and plugin version control strategy #175

@TeemuSuoranta

Description

@TeemuSuoranta

I noticed that composer.lock was recently automatically ignored from the version control f954bdd

I have read the commit notes and agree that the file has many issues as updates in production do not (to my knowledge) update composer.lock and packages in composer.json have no fixed version most of the time.

As a background we have usually added the WordPress.org plugins via composer and kept premium and custom plugins in version control. Now, when you add a new plugin via composer, there is pre-made git hook in production that also installs it if there is change in composer.lock. If this file is not in version control, this automation will not work (manual command needed in production).

As a developer I don't want to have this manual and easy to forget thing in the workflow which leaves (at least) two strategies:

  1. Manually re-add the composer.lock to the version control and keep workflow the same.
  2. Add all the plugins to the version control to minimize the need for composer.json in the first place. This will lead to more uncommited changes in production situations, but fix all issues with composer.lock. For this option, we'll need to change the default .gitignore for plugins each time.

What do you think? With this change there is a hole in the workflow when a new (WordPress.org) plugin is added to the site in local development that needs some kind of solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions