Skip to content

Migrate glpi-project/tools to core#22465

Merged
cedric-anne merged 7 commits intoglpi-project:11.0/bugfixesfrom
froozeify:11.0/migrate-glpi-project-tools
Feb 4, 2026
Merged

Migrate glpi-project/tools to core#22465
cedric-anne merged 7 commits intoglpi-project:11.0/bugfixesfrom
froozeify:11.0/migrate-glpi-project-tools

Conversation

@froozeify
Copy link
Copy Markdown
Member

@froozeify froozeify commented Dec 22, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

Migrate https://github.com/glpi-project/tools into the core with also a converted python/bash scripts so all are runned as Symfony Command.

Doing that migration will avoid the dependencies exception libraries could have when they were requiring a different glpi-project/tools

For the future we could put glpi-project/tools as archived but we can't remove it from packagist as plugin supporting prior to GLPI 11.0.5 version would have to still install that library.

It's can be release in 11.0.5 as it was currently only a dev dependencies, so in worth case if the user try to run a command it will just not work.
It will force local dev env to be up to date (or at least be in 11.0.5-dev)

Template https://github.com/pluginsGLPI/empty should also be updated to remove that composer dependency once this PR is merged.

TODOs

  • LicenceHeadersCheck
  • CompileTwigTemplate
  • ExtractLocals (migrate this to /tools not /tools/plugins ???)
  • PluginRelease
  • PHPStan Rules (already present in core MissingGlobalVarTypeRule)

What was done

  • Migrate LicenceHeadersCheckCommand.php and CompileTwigTemplatesCommand.php (no major edit - namespace and print changes)
  • Convert plugin-release python file to PHP
  • Convert extract-local bash file to PHP

Interconnected PR (merge order) :

Plugins CI

Whatsapp plugin got a dedicated PR to test the modification (see in the feed under for the link)

Copy link
Copy Markdown
Member

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need to rebase and update the header (2026)

Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/CompileTwigTemplatesCommand.php Outdated
Comment thread tools/src/Command/CompileTwigTemplatesCommand.php Outdated
Comment thread tools/src/Command/CompileTwigTemplatesCommand.php Outdated
Comment thread tools/src/Command/ExtractLocalesCommand.php Outdated
Comment thread tools/src/Command/ExtractLocalesCommand.php Outdated
Comment thread tools/src/Command/LicenceHeadersCheckCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Command/LicenceHeadersCheckCommand.php Outdated
@froozeify froozeify force-pushed the 11.0/migrate-glpi-project-tools branch from 657aa2b to 5554081 Compare January 5, 2026 08:59
@cedric-anne cedric-anne added this to the 11.0.5 milestone Jan 5, 2026
Comment thread PluginsMakefile.mk Outdated
Comment thread package.json Outdated
Comment thread src/Glpi/Console/CommandLoader.php
Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/AbstractCommand.php
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
@froozeify froozeify force-pushed the 11.0/migrate-glpi-project-tools branch from b82e036 to 275e8e7 Compare January 15, 2026 14:17
@froozeify froozeify marked this pull request as draft January 15, 2026 15:03
@froozeify froozeify marked this pull request as ready for review January 19, 2026 12:25
@froozeify froozeify requested a review from cedric-anne January 19, 2026 12:27
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
@trasher
Copy link
Copy Markdown
Contributor

trasher commented Jan 19, 2026

This PR is very huge. Should not be splat into smaller parts easier to follow and review?

Comment thread bin/console Outdated
Copy link
Copy Markdown
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except added tests are failing, it seems technically OK. I will do some manuel tests to compare results with the scripts from glpi-project/tools.

@froozeify froozeify requested a review from cedric-anne January 22, 2026 09:09
@froozeify
Copy link
Copy Markdown
Member Author

Except added tests are failing, it seems technically OK. I will do some manuel tests to compare results with the scripts from glpi-project/tools.

Fixed it was due to the fact that the pot file didn't exist in test and previous code would not run the file creation (php would only run the file_exist in the if condition)

@trasher
Copy link
Copy Markdown
Contributor

trasher commented Jan 23, 2026

I'll probably test in the day, but I won't review any lines of code - nor past comments; there are too much of them. I already make a quick check and see nothing notable.

I'd really prefer this one to be merged after 11.0.5 has been released; so we have time to fix potential issues, without quick fix to do on release day. Problems caused by the tools lib are not new; this can wait one or two extra week.

@trasher trasher requested review from Rom1-B and stonebuzz January 23, 2026 07:21
@trasher
Copy link
Copy Markdown
Contributor

trasher commented Jan 23, 2026

@Rom1-B @stonebuzz could you please test on your side the plugin release process from this PR?

@stonebuzz
Copy link
Copy Markdown
Contributor

@froozeify
Copy link
Copy Markdown
Member Author

This should also be updated accordingly.

https://github.com/glpi-project/plugin-release-workflows/blob/v1/.github/workflows/publish-release.yml

https://github.com/glpi-project/plugin-translation-workflows

Done in PRs :

They should be merged once this one is deployed as it will be based on the source code here (for now I tested them using a fork)

@cedric-anne cedric-anne force-pushed the 11.0/migrate-glpi-project-tools branch from 5cfa07d to 4b117f7 Compare January 28, 2026 15:21
Copy link
Copy Markdown
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge this PR without breaking existing plugins ci/release/translation workflows.

These workflows will be updated to keep using glpi-project/tools from the plugins vendor if they are found, and with a fallback to the new commands introduced here. This will permit to migrate plugins one at a time, and will give the ability to put back the glpi-project/tools dependency to a migrated plugin to temporarly bypass any issue present in the new commands.

Comment thread tools/src/Command/AbstractCommand.php Outdated
Comment thread tools/src/Command/LocalesCompileCommand.php
Comment thread tools/src/Plugin/Command/PluginReleaseCommand.php Outdated
@froozeify froozeify force-pushed the 11.0/migrate-glpi-project-tools branch from 7215ccd to e8e4b7d Compare January 29, 2026 13:16
Copy link
Copy Markdown
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about the way the plugin export command would be used, I think it could be drastically simplified:

  • with a unique dest parameter that corresponds to the path of the destination file e.g. --dest=~/build/glpi-myplugin-preversion-20260129.tar.bz2;
  • in combination with the --auto-compress tar option, instead of -j to allow usage of other compression formats (e.g. .tar.gz);
  • using the git checkout-index command, like we do in the make_release.sh script, instead of git ls-tree + git archive + untar;
  • moving the "banned files" cleaning at the end of the process, right before the archive creation.

@cedric-anne cedric-anne force-pushed the 11.0/migrate-glpi-project-tools branch from 3a6b3b2 to 331aa06 Compare February 3, 2026 14:07
@cedric-anne cedric-anne force-pushed the 11.0/migrate-glpi-project-tools branch from 331aa06 to 0dc4cb9 Compare February 3, 2026 14:15
@cedric-anne cedric-anne merged commit 20ad250 into glpi-project:11.0/bugfixes Feb 4, 2026
9 checks passed
@froozeify froozeify deleted the 11.0/migrate-glpi-project-tools branch February 4, 2026 09:20
@cedric-anne cedric-anne mentioned this pull request Feb 4, 2026
SebSept pushed a commit to SebSept/glpi that referenced this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants