The n98-magerun2 v9.0.0 Release is Here: Stay Calm and Update Now!

Published by Christian Münch on

We are thrilled to announce the release of n98-magerun2 v9.0.0. The codename for this release is Stuttgart, a fitting tribute to a city that perfectly merges world-class engineering and innovative spirit with scenic beauty. This is a milestone release that introduces a significant underlying framework upgrade, powerful new commands, and a completely revamped documentation experience to streamline your Magento development and administration tasks.

The headline feature of this release is the major upgrade to Symfony 6.4. This leap modernizes the core of n98-magerun2, bringing performance improvements, enhanced security, and setting a solid foundation for future development. Alongside this, we’re introducing a new documentation portal built with Docusaurus and several new features and commands requested by the community.

What’s New?

Keep Calm and Run Your Commands

Say goodbye to complex maintenance routines! The new dev:keep-calm command gets your Magento system back to a clean, operational state with just a single command. It automatically runs all the necessary steps and disables maintenance mode upon completion. This allows you to ensure safe operations during deployments and other sensitive tasks—and stay calm while doing it.

Bash

$ n98-magerun2.phar dev:keep-calm
Keep Calm!

See docs: https://netz98.github.io/n98-magerun2/command-docs/development/dev-keep-calm

New Docusaurus-Powered Documentation

We’re excited to launch our new documentation, now powered by Docusaurus. This provides a vastly improved, searchable, and more user-friendly experience. Finding the information you need is now faster and more intuitive. We moved all the Github Wiki pages to the new documentation. Explore the new documentation hub to get the most out of n98-magerun2. One of the next TODOs is to provide a good search for the documentation.

The new documentation covers:

  • Command User Guide
  • Contribution Guide
  • Extending the functionality of n98-magerun2 for your projects

The new documentation is served by a GitHub page.
https://netz98.github.io/n98-magerun2/

… and yes, we offer a dark theme.

Our beautiful new documentation page!

If something is missing, feel free to send us a pull request or open a new issue on GitHub.

Thanks Björn Schotte and Stephan Hochdörfer for your help.

Re-design of files.magerun.net

We gave our landing page for the phar file download a more modern touch.

https://files.magerun.net

… and yes, we offer a dark theme.

The new designed files.magerun.net page in dark theme.

Enhanced Admin User Listing

The admin:user:list command has been upgraded. It now includes a logdate column to show the last login time for each user. Additionally, you can now sort the list by any column using the new --sort option, making it easier to audit admin accounts.

Bash

$ n98-magerun2.phar admin:user:list --sort="logdate"

To make the command really useful, the option --columns was added. This allows to define a custom list of columns to show in the list. If no columns are defined, the column defined with the sort option is automatically added to the list. See command documentation (or --help) for a list of supported column names.

$ n98-magerun2.phar admin:user:list --columns=id,username,firstname,lastname,status,status

+----+----------+-----------+----------+--------+
| id | username | firstname | lastname | status |
+----+----------+-----------+----------+--------+
| 1  | admin    | Armin     | Admin    | active |
+----+----------+-----------+----------+--------+

See docs: https://netz98.github.io/n98-magerun2/command-docs/admin/admin-user-list

Hyvä Theme Build Command

The command dev:theme:build-hyva became some love and we added a Hyvä Theme detection. This means that the themes list is now filtered.

The options --all and --supress-no-theme-found-error were added. With --all you can build all your Hyvä Themes at once. This does not run in watch mode.

A new option --force-npm-install was added.

See docs: https://netz98.github.io/n98-magerun2/command-docs/development/dev-theme-build-hyva

Database View Support in db:dump and db:drop

Handling database views during database operations is now fully supported. The db:dump and db:drop commands can now correctly process views, preventing potential errors and ensuring your database dumps and drops are more reliable.

New Functionality:

  • db:dump:
    • --views: Explicitly include views in the dump (this is generally the default behavior).
    • --no-views: Exclude all views from the dump. This overrides other flags that might otherwise include a view by name (e.g., if a view is part of an --include pattern or not in an --exclude or --strip pattern).
  • db:drop:
    • --drop-views: Specifically drops all views in the database. Can be used in conjunction with --tables to drop both, or independently.

See docs:

MariaDB Tools

We’ve introduced a significant enhancement to our database command handling for better compatibility with modern database systems. All db commands that rely on the mysql and mysqldump client tools now intelligently inspect the database server’s version first. If the system detects a connection to a MariaDB server, it will automatically prioritize using the native mariadb and mariadb-dump command-line tools, provided they are installed. This ensures optimal performance and support for MariaDB-specific features. For all other cases, such as connecting to a MySQL server or if the MariaDB clients are not found, the commands will seamlessly fall back to using the traditional mysql and mysqldump executables, guaranteeing backward compatibility and reliable operation across all environments.

Load External Modules from Any Directory

We’ve added a new global option, --add-module-dir, which allows you to load external n98-magerun2 modules from a specified directory. This makes it incredibly easy to work with custom, project-specific, or third-party commands without altering the core installation.

This is useful in environments, whre write access in the default module pathes is not allowed. With the new option it’s possible to place module somewhere on your server.

Thanks Raj KB for the idea and your help.

CSV Export for Database Queries

The db:query command is now even more powerful. You can directly export the results of your SQL queries to a CSV file using the --format option. This is perfect for quick data exports and reporting.

Bash

$ n98-magerun2.phar db:query --format=csv "SELECT * FROM core_config_data"

Thanks Raj KB for the idea and your help. Thanks Alex D. for testing.

GitHub Token for PR Command

To address GitHub API rate-limiting, especially in automated CI/CD environments, the github:pr command now supports using a GitHub token. This ensures your automated workflows that rely on applying patches from pull requests run smoothly.

Improvements

  • Symfony 6.4 Upgrade: This is the core improvement of v9.0.0. By updating to the latest Long-Term Support (LTS) version of Symfony, we ensure n98-magerun2 remains secure, performant, and compatible with modern PHP ecosystems.
  • Optimized Development Setup: We’ve made several enhancements to our internal development environment and improved the accuracy of Magento version detection.
  • CI Workflow Enhancements: The release workflow in our CI pipeline has been improved for greater reliability and speed.
  • Optimizes BATS tests: The functional test suite got a optimization. Huge tests are splitter into single tests. The test names were normalized for better readability in the CI/CD log and on command line.

Bug Fixes

  • PHP 8.4 Compatibility: We have proactively addressed deprecations and other issues to ensure n98-magerun2 is compatible with the forthcoming PHP 8.4 release.
  • Better TTY Handling in Proxy Command: The proxy command’s TTY handling has been improved, resolving issues with interactive command execution in proxied environments.

AI Usage

For this release we had support by several virtual developers.
There is code included provided by Google Jules, GitHub CoPilot Agent, JetBrains Junie, OpenAI Codex.

In the GIT repo were several files with instructions (system prompts) for this agents added.

How to Update

Updating to the latest version is as simple as running:

Bash

$ n98-magerun2.phar self-update

Full Changelog

Here is a complete list of all changes for the v9.0.0 release:

  • Add: keep calm command (PR #1692, issue #499, by Christian Münch)
  • Add: extend admin:user:list with –sort option and logdate column (PR #1647, issue #1646)
  • Add: support view handling in db:dump and db:drop commands (PR #1672, issue #602)
  • Add: enable github tokens in github:pr command (issue #1633, by Christian Münch)
  • Add: –add-module-dir option to load external modules (PR #1687, issue #1677, by Christian Münch)
  • Add: CSV export option in db:query command (PR #1653, issue #1651)
  • Add: Docusaurus documentation and deployment workflow (PR #1643, issue #1643)
  • Imp: update to Symfony 6.4 (PR #1608, issue #1608, by Christian Münch)
  • Imp: optimize development setup and Magento version detection (by Christian Münch)
  • Imp: feat(dev:theme:build-hyva): add –force-npm-install option to always run npm install
  • Imp: Update 3rd party dependencies (sigstore/cosign-installer, brace-expansion, captainhook)
  • Imp: feat(db): prefer mariadb client tools when available (PR #1695, by Christian Münch)
  • Imp: feat(dev:hyva:build): Add –all and –supress-no-theme-found-error in dev:hyva:build command (by Christian Münch)
  • Imp: feat(dev:hyva:build): Add check for Hyvä theme in dev:hyva:build command (by Christian Münch)
  • Fix: better TTY handling in proxy command (PR #1667, issue #1422, by Christian Münch)
  • Fix: PHP 8.4 compatibility updates (PR #1655, issue #1654, by Christian Münch)
  • Fix: Port handling in database helper (by Christian Münch)
  • Build: CI release workflow enhancements (PR #1657, issue #1657, by Christian Münch)

We encourage you to update to v9.0.0 to take advantage of these new features and improvements. As always, we welcome your feedback and contributions on our GitHub repository.

Thank You

Christian Walter, Alexander Dite, Ray KB, Stephan Hochdörfer, Björn Schotte for testing


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.