- Issue created by @quietone
- πͺπΈSpain fjgarlin
Did you get there because you crafted the URL or because it was linked from somewhere else?
- π³πΏNew Zealand quietone
I entered 'api.drupal.org' which went to 'https://api.drupal.org/api/drupal/11.x'. I then used the search, such as,, 'forum.info.yml'.
- πͺπΈSpain fjgarlin
Yeah, if you type exactly what you want, it will be there. When we reparse, we update existing pages and create new ones, but do not remove old pages that become orphaned.
I believe that this behaviour has been the same since the D7 days, anything removed from the codebase stops being linked from places, even tho the page still exists.
Implementing this removal would mean scanning all elements (not just files, it should be files, classes, namespaces, functions, constants...) and see if these are in the codebase somehow.
Possible solutions:
1. Add an "updated" field everywhere, and always update the timestamp on "git pull + re-parsing" (even when there are no changes to the file). That way we could clean up older entries for a particular branch.
2. Remove everything for a branch (aka delete branch) and recreate it. This process can take a few hours and the site won't show information in the meantime.
3. Implement some sort of "isInCode" function, that determines whether an element is being currently used in the code and then remove it if it is not found in the code. This could be a background job.Note that 1 and 3 mean "removing" entries, and with these, we'd also need to remove all the possible related relationships to the entry in other tables.
None of the above are easy/quick/ideal, but I wanted to put my thoughts there anyway.
- πΊπΈUnited States drumm NY, US
https://git.drupalcode.org/project/api/-/blob/7.x-2.x/api.update_branch.... looks like where files were removed in D7. Looks like the general flow was:
- Make a list of current files
- Make a list of previously-parsed files
- When processing current files, remove them from the list of previously-parsed files
- Remove anything left in previously-parsed files, starting with removing the items parsed from them
Iβd do that again, or possible solution #1
- πͺπΈSpain fjgarlin
Oh cool, that was totally missed in the porting of the project.
That logic sounds good. The parsing logic changed a bit between D7 and D10, but I think we should be able to pull a before/after of files, and then trigger a delete for the old files no longer present (we'd need to check relationships and dependant elements derived from the file).
- π³πΏNew Zealand quietone
Changing to Critical because this is a "Significant regressions in user experience, developer experience, or documentation".
- πͺπΈSpain fjgarlin
There is an attempt at removing orphan entities: https://git.drupalcode.org/project/api/-/blob/2.x/api.module?ref_type=he...
It's probably not configured. So we should try this first.
- π¨π¦Canada Charlie ChX Negyesi πCanada
ghost of drupal past β made their first commit to this issueβs fork.
- π¨π¦Canada Charlie ChX Negyesi πCanada
To sum up a very hard and long debug session: On DocFile::delete needs to remove all the docblocks for the file being deleted but this creates another bug because DocBlock presumed DocFile::delete doesn't clean up so that delete call needed to be removed.
- πͺπΈSpain fjgarlin
Tests are failing. Small detail that I forgot to check.
-
fjgarlin β
committed 4db6cc7e on 2.x authored by
ghost of drupal past β
Issue #3503024 by ghost of drupal past, fjgarlin, quietone, drumm:...
-
fjgarlin β
committed 4db6cc7e on 2.x authored by
ghost of drupal past β
Automatically closed - issue fixed for 2 weeks with no activity.
- π³πΏNew Zealand quietone
I checked today and the link in the Issue Summary still shows the action.info.yml file for 11.x. And so is forum, https://api.drupal.org/api/drupal/core%21modules%21forum%21forum.info.ym...
- πͺπΈSpain fjgarlin
My bad, the code is deployed but I never changed the settings so it starts deleting them:
I will adjust the settings and deploy the new configuration.
- πͺπΈSpain fjgarlin
I've changed the value now. I will revisit this by the end of the week to see if the old entries were removed.
- πͺπΈSpain fjgarlin
I can guarantee it works. I set the value to 5 instead of 50 and it pretty much wiped out all the api site data.
It's bein regenerated now.
- π³πΏNew Zealand quietone
I checked again today and I could not find references to removed extension files in 11.x
Thanks!