Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve deleted.files Workflow #4217

Open
splitbrain opened this issue Feb 18, 2024 · 5 comments
Open

Improve deleted.files Workflow #4217

splitbrain opened this issue Feb 18, 2024 · 5 comments

Comments

@splitbrain
Copy link
Collaborator

The current workflow only adds newly deleted files to data/deleted.files. It does not ensure that the file does not contain any files that exist (again). This lead to #4214

The action should remove any lines that point to files that exist in current master.

@Zweihorn
Copy link
Contributor

Further improvements

IMHO there may be room for further improvements to the workflow.

  1. Deleting old entries
  2. Newest entries to the top of the list

Deleting old entries

Deleting old entries when file is re-introduced i.e. remove any lines that point to files that exist in current master to comply with the original request.

Newest entries to the top of the list

Any additions of deleted files should be made to the top of the list, I presume. But this is not the case.

Obviously, the current workflow only adds newly deleted files to the end of the data/deleted.files file.

This looks like an oversimplified action, unfortunately. The relevant shell script line is:

echo "$F" >> data/deleted.files

This could become quite cumbersome to the devs in merging and could produce a quite misleading list of deleted files.

The current data/deleted.files holds the deleted files from latest (i.e. 2022-06-26) to oldest (i.e. 2006-03-09) change in a reasonable chronological order. Any addition to the end of this file would produce a quite misleading information as this should be the oldest entries and not the newest.

Proof of example

An abbreviated form of the a.m. file looks like:

# This is a list of files that were present in previous DokuWiki releases
# but were removed later. An up to date DokuWiki should not have any of
# the files installed

# removed in 2022-06-26
.travis.yml
appveyor.yml
inc/IXR_Library.php
inc/cli.php

. . .

# removed in 2006-03-09
data/pages/wiki/playground.txt
inc/auth/ldap.php
inc/auth/mysql.php
. . .
vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php
vendor/marcusschwarz/lesserphp/README.md
vendor/marcusschwarz/lesserphp/lessc.inc.php

Testing the workflow on my fork by deleting just the vendor/README file and commiting to the master branch produces a new branch bot/deletedFiles with an (expected but unwanted) addition to the end of the list.

The respective Update deleted files commit looks like:

@@ -981,3 +981,4 @@ vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php
vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php
vendor/marcusschwarz/lesserphp/README.md
vendor/marcusschwarz/lesserphp/lessc.inc.php
vendor/README

This is not optimal. Any additions should be made to the top of the list, I presume.

@Zweihorn
Copy link
Contributor

Tested on my lokal fork with ref data/deleted.files by deleting two exemplary files

  • vendor/README and
  • vendor/splitbrain/slika/README.md

and pushing to master branch after establishing the new workflow definition.

In the result the respective Update deleted files commit contains a new list as requested like:

@@ -2,6 +2,9 @@
# but were removed later. An up to date DokuWiki should not have any of
# the files installed

vendor/README
vendor/splitbrain/slika/README.md

# removed in 2022-06-26
.travis.yml
appveyor.yml

NOTE: Naturally, both README files shall remain in the original master branch for the time being.

Voila.
🌻

@Zweihorn
Copy link
Contributor

Zweihorn commented Mar 31, 2024

Tested on my local fork ref data/deleted.files by re-introducing exemplary files.

  • inc/IXR_Library.php
  • inc/cli.php
  • . . .
  • data/pages/wiki/playground.txt
  • vendor/marcusschwarz/lesserphp/README.md

Again pushing to master branch after establishing the newly improved workflow definition.

In the result the respective Update deleted files commit contains a newly cleaned list as requested like:

@@ -2,11 +2,12 @@
# but were removed later. An up to date DokuWiki should not have any of
# the files installed

vendor/README
vendor/splitbrain/slika/README.md

# removed in 2022-06-26
.travis.yml
appveyor.yml
lib/images/interwiki/amazon.de.gif
lib/images/interwiki/amazon.gif
lib/images/interwiki/amazon.uk.gif
. . .

# removed in 2006-03-09
inc/auth/ldap.php
inc/auth/mysql.php
. . .
vendor/phpseclib/phpseclib/phpseclib/Net/SSH1.php
vendor/marcusschwarz/lesserphp/lessc.inc.php

Obviously, the re-introduced files have their entries deleted as requested.

NOTE: Naturally, all the files shall remain unchanged in the original master branch for the time being.

Voila.
🌻

@Zweihorn
Copy link
Contributor

Zweihorn commented Apr 1, 2024

The improved approach overcomes limitations of #4254

@Zweihorn
Copy link
Contributor

Zweihorn commented Apr 2, 2024

Updated #4256 for adding the current ISO date.

An example of the outcome after deleting and re-introducing some files is given below:

dokuwiki_update-deletedFiles_2024-04-02_diff

I would hope this helps.

Voila.
🌻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants