Release Blocker NPM Resource Changed PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
13 Dec 2022

Pull Request for Issue # .

Summary of Changes

After PR #39374 has been merged, the package build e.g. with php ./build/build.php --remote=HEAD --exclude-gzip --exclude-bzip2 fails at the versioning step for the assets because PR #39374 has removed some JS but hasn't removed it from file build/media_source/com_users/joomla.asset.json.

This PR here fixes that.

It was partly also my fault. I should have noticed this when reviewing that PR, but well, nobody's perfect.

But when testing the PR it was not obvious because package building doesn't belong to our usual testing instructions and also not to the automated CI tests, and the package build which drone runs for building the testing packages seem not to include that versioning step because it hasn't failed for that PR. Everything was green.

Pinging @Hackwar just for information.

Testing Instructions

It requires a development environment (Git clone of this repo, composer, npm) either on Linux or on Windows with WSL to run the build.php script.

  1. Checkout the current 4.3-dev branch where #39374 has been merged in today.
  2. Run php ./build/build.php --remote=HEAD --exclude-gzip --exclude-bzip2.
    Result: See section "Actual result BEFORE applying this Pull Request" below.
  3. Clean up everything with git clean -d -x -f and git checkout ..
  4. Checkout the branch of this PR. You can do that with commands git fetch upstream pull/39408/head:test-pr-39408 and then git checkout test-pr-39408.
  5. Repeat step 2.
    Result: See section "Expected result AFTER applying this Pull Request" below.

Actual result BEFORE applying this Pull Request

At the end of the output in the command window:

> joomla@4.0.0 versioning
> node build/build.js --versioning

[Error: ENOENT: no such file or directory, lstat '/home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670929783/media/com_users/js/admin-users-mail-es5.min.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670929783/media/com_users/js/admin-users-mail-es5.min.js'
}
`npm run versioning` did not complete as expected.

Expected result AFTER applying this Pull Request

At the end of the output in the command window:

> joomla@4.0.0 versioning
> node build/build.js --versioning

Timer: Versioning finished in 160 ms
Cleaning checkout in /home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670930708.
Cleaning vendors.
Cleanup complete.
Generating optimized autoload files
Generated optimized autoload files containing 2381 classes
Cleaning Composer manifests in /home/richard/lamp/public_html/joomla-cms-4.3-dev/build/tmp/1670930708.
Cleanup complete.
Workspace built.
Create list of changed files from git repository for version 4.3.0-alpha2-dev.
Delete folders not included in packages.
Build full package files.
Building Joomla_4.3.0-alpha2-dev-Development-Full_Package.zip... done.
Build full update package.
Building Joomla_4.3.0-alpha2-dev-Development-Update_Package.zip... done.
Build of version 4.3.0-alpha2-dev complete!

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 13 Dec 2022
Category Repository NPM Change
avatar richard67 richard67 - open - 13 Dec 2022
avatar richard67 richard67 - change - 13 Dec 2022
Status New Pending
avatar richard67 richard67 - change - 13 Dec 2022
The description was changed
avatar richard67 richard67 - edited - 13 Dec 2022
avatar richard67 richard67 - change - 13 Dec 2022
The description was changed
avatar richard67 richard67 - edited - 13 Dec 2022
avatar richard67 richard67 - change - 13 Dec 2022
The description was changed
avatar richard67 richard67 - edited - 13 Dec 2022
avatar dgrammatiko dgrammatiko - test_item - 13 Dec 2022 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 13 Dec 2022

I have tested this item successfully on 657b6de


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39408.

avatar obuisard obuisard - test_item - 13 Dec 2022 - Tested successfully
avatar obuisard
obuisard - comment - 13 Dec 2022

I have tested this item successfully on 657b6de


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39408.

avatar obuisard obuisard - change - 13 Dec 2022
Labels Added: Release Blocker NPM Resource Changed PR-4.3-dev
avatar richard67 richard67 - change - 13 Dec 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 13 Dec 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39408.

avatar obuisard
obuisard - comment - 13 Dec 2022

To be honest, I love this PR's description and documentation. Thanks Richard @richard67, you made it easy to test.

avatar SharkyKZ
SharkyKZ - comment - 13 Dec 2022

It should go without saying but removing assets is a B/C break.

avatar dgrammatiko
dgrammatiko - comment - 13 Dec 2022

It should go without saying but removing assets is a B/C break.

I will agree for media/system, media/legacy and media/vendor but anything else shouldn't ever be considered public API

avatar richard67
richard67 - comment - 13 Dec 2022

It should go without saying but removing assets is a B/C break.

Even if this was true for the assets handled here, this PR just removes them from the json but not from the file system on update. That is done with my other PR #39401 . So the thumb down should go there and not here.

avatar SharkyKZ
SharkyKZ - comment - 13 Dec 2022

It's actually this PR that causes templates to error.

avatar richard67
richard67 - comment - 13 Dec 2022

It's actually this PR that causes templates to error.

So we shall keep not existing asset files being referenced in the assets.json?

avatar dgrammatiko
dgrammatiko - comment - 13 Dec 2022

So we shall keep not existing asset files being referenced in the assets.json?

He's suggesting reverting the changes in the assets.json and keep the files. Although the B/C promise doesn't cover layouts, the parent PR will break any existing override. I'm ok with keeping the assets.json removing the files (this won't break with a PHP Exception any override) and adding a simple check on the versioning script

avatar richard67
richard67 - comment - 13 Dec 2022

So we shall keep not existing asset files being referenced in the assets.json?

He's suggesting reverting the changes in the assets.json and keep the files. Although the B/C promise doesn't cover layouts, the parent PR will break any existing override. I'm ok with keeping the assets.json removing the files (this won't break with a PHP Exception any override) and adding a simple check on the versioning script

@dgrammatiko "the parent PR will break any existing override." ... does that mean we should revert #39374 ?

And regarding the "adding a simple check on the versioning script": If you can make a PR for this, I'd close this one here.

But then we should add some comment to the json with that PR which tells why we have these not existing assets in it.

And what should I do then with my PR #39401 ? Should I revert the last commit so the files are not deleted on update?

avatar dgrammatiko
dgrammatiko - comment - 13 Dec 2022

@dgrammatiko "the parent PR will break any existing override." ... does that mean we should revert #39374 ?

No, the B/C promise allows these kinds of breaks. What I just realised from @SharkyKZ 's comment is that if you manipulate the assets.json and remove an entry the WAM will throw a PHP exception. This should never be allowed!

About keeping or removing the files I guess the maintainers should decide on this. But I think @SharkyKZ unveiled something interesting about WAM and the jsons and probably this worth some revision of the B/C promise and set some restrictions so layouts never throw...

avatar richard67
richard67 - comment - 13 Dec 2022

About keeping or removing the files I guess the maintainers should decide on this. But I think @SharkyKZ unveiled something interesting about WAM and the jsons and probably this worth some revision of the B/C promise and set some restrictions so layouts never throw...

@dgrammatiko I've pinged the other maintainers in the maintainers channel on Mattermost and hope someone can have a look on it and make a decision. Thanks for your support so far.

avatar richard67 richard67 - change - 13 Dec 2022
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 13 Dec 2022

Back to pending due to discussion. See details in previous comments.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39408.

avatar dgrammatiko
dgrammatiko - comment - 13 Dec 2022

And regarding the "adding a simple check on the versioning script": If you can make a PR for this, I'd close this one here.

@richard67 here are the changes for the versioning:
From

const jAssetFile = await lstat(path);

to

  let jAssetFile;
  try {
    jAssetFile = await lstat(path);
  } catch(err) {
    final[directory].push(asset);
    return;
  }

About the other questions: I'll say wait for the maintainers

avatar richard67
richard67 - comment - 13 Dec 2022

@dgrammatiko Ok, if you are busy I can make the PR for the versioning js and mention you, and then close this one here. We have discussed on Mattermost, and it seems that will be what we do as first, leave them in the assets.json. For the long term it would be good to have a kind of deprecated logging for obsolete assets.

avatar richard67
richard67 - comment - 13 Dec 2022

Closing in favour of #39413 . Please test. Thanks all.

avatar richard67 richard67 - close - 13 Dec 2022
avatar richard67 richard67 - change - 13 Dec 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-12-13 16:17:11
Closed_By richard67

Add a Comment

Login with GitHub to post a comment