? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
23 Aug 2021

Pull Request for Issue # .

Summary of Changes

  • adds a flag to preserve the timestamps for folder/files copied from build/media_source to media
  • adds a flag for mkdir to use mode: 0o755
  • adds a flag for writeFile to use mode: 0o644 and also encoding: 'utf8'

Testing Instructions

The timestamp flag is documented here: https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy.md

The flags mode and encoding for writeFile: https://nodejs.org/api/fs.html#fs_fspromises_writefile_file_data_options

The flags recursive and mode for mkdir: https://nodejs.org/api/fs.html#fs_fspromises_mkdir_path_options

Check that ALL files are still generated and with correct timestamps and mode

Actual result BEFORE applying this Pull Request

Expected result AFTER applying this Pull Request

Documentation Changes Required

No

avatar dgrammatiko dgrammatiko - open - 23 Aug 2021
avatar dgrammatiko dgrammatiko - change - 23 Aug 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Aug 2021
Category JavaScript Repository
avatar dgrammatiko dgrammatiko - change - 23 Aug 2021
Labels Added: ?
avatar richard67 richard67 - test_item - 23 Aug 2021 - Tested successfully
avatar richard67
richard67 - comment - 23 Aug 2021

I have tested this item successfully on 567253f

Code review: According to https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy.md we should use the preserveTimestamps parameter to be sure timestamps of copied files are preserved because the default is false.

Real test: After an "npm ci" wihout this PR applied, all time stamps of files which just have copied from build/media_source to media (or folders below) have changed their time stamp. With the PR applied the timestamps are preserved. Comparing build/media_source and media folder structures with a good comparison tool like e.g. BeyondCompare shows that within a second.


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

e8d676b 23 Aug 2021 avatar dgrammatiko More
avatar dgrammatiko dgrammatiko - change - 23 Aug 2021
Labels Added: ?
Removed: ?
avatar richard67
richard67 - comment - 23 Aug 2021

@dgrammatiko Don't forget to adjust title and description to all changes when done with coding ;-)

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2021

@dgrammatiko Don't forget to adjust title and description to all changes when done with coding ;-)

I Will do it in a bit, running some tests right now, so this is not really ready for testing yet

avatar dgrammatiko dgrammatiko - change - 23 Aug 2021
The description was changed
avatar dgrammatiko dgrammatiko - edited - 23 Aug 2021
2fee5eb 23 Aug 2021 avatar dgrammatiko meh
7a758bf 23 Aug 2021 avatar dgrammatiko meh
avatar dgrammatiko dgrammatiko - change - 23 Aug 2021
The description was changed
avatar dgrammatiko dgrammatiko - edited - 23 Aug 2021
avatar C-Lodder
C-Lodder - comment - 23 Aug 2021

Default encoding for writeFile is uft8, so you shouldn't need to manually define it

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2021

so you shouldn't need to manually define it

It was more or less a find and replace, also the code is not going to be served on a browser so the extra bytes are not really harmful here. Anyways I've switched tasks so @C-Lodder if you pr the changes I will apply them

avatar wilsonge
wilsonge - comment - 23 Aug 2021

Is this ready to test @dgrammatiko ?

avatar dgrammatiko
dgrammatiko - comment - 23 Aug 2021

Is this ready to test @dgrammatiko ?

yup

avatar wilsonge wilsonge - close - 23 Aug 2021
avatar wilsonge wilsonge - merge - 23 Aug 2021
avatar wilsonge wilsonge - change - 23 Aug 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-23 18:36:37
Closed_By wilsonge
Labels Added: ?
Removed: ?
avatar wilsonge
wilsonge - comment - 23 Aug 2021

Thanks!

Add a Comment

Login with GitHub to post a comment