Skip to content

fix(upgrade): correct what a real 1.x extension's upgrade got wrong, and add --check - #67

Merged
imorland merged 1 commit into
3.xfrom
im/upgrade-fixes-from-gravatar
Oct 16, 2026
Merged

imorland merged 1 commit into
3.xfrom
im/upgrade-fixes-from-gravatar

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes: no issue.

Changes proposed in this pull request:
Upgrading ianm/gravatar showed what the 2.0 upgrade still gets wrong. It no longer lowers a version an extension already asks for, and JSON files keep their newline and indentation. Build tooling moves to devDependencies, and the typings scripts the 2.x frontend workflow runs are added. tsconfig.json reads every vendor package's global typings and sets "types": [], because TypeScript 4.9 can't parse the @types/node webpack brings along. The skeleton gets the same tsconfig change. main_git_branch moves to 2.x when there is a 2.x branch, and gets a @TODO when there isn't. The JSON:API step no longer adds unused imports, and added imports are sorted. An admin initializer the step has emptied is removed. Work the upgrade can only point out, such as the AvatarEditor and avatarSrcset changes, is listed in the --json todos.

upgrade 2.0 --check reports what the upgrade would change without changing anything. The steps run on the last commit, in a temporary worktree. Running it on already-upgraded extensions turned up steps that break 2.x code, now fixed:

  • notification drivers were stripped;
  • AlertableInterface was added twice;
  • lazy-module imports were removed while still in use, and LabelValue and LoadingPost aren't lazy any more;
  • 2.x email views were deleted.

Reviewers should focus on:

  • --check creates and removes a git worktree and branch in the extension's repository.

Screenshot
N/A

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Frontend changes: tests are green (run yarn test in js/).
  • Frontend changes: tests have been added, or are not appropriate here.
  • Backend changes: tests are green (run composer test).
  • Backend changes: tests have been added, or are not appropriate here.
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite).
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

@imorland
imorland marked this pull request as ready for review October 16, 2026 10:12
@imorland
imorland merged commit 0ba4b48 into 3.x Oct 16, 2026
2 of 3 checks passed
@imorland
imorland deleted the im/upgrade-fixes-from-gravatar branch October 16, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant