martinthomson / i-d-template

A template for IETF internet draft git repositories
Other
208 stars 182 forks source link

Branch links left dead after branch removal #302

Open chrysn opened 3 years ago

chrysn commented 3 years ago

Working on https://github.com/anr-bmbf-pivot/draft-dns-over-coap I got complaints about dead links; it seems that when branches are removed after merging, parts are removed but the index stays.

I'll investigate later, and file a PR if I manage to find out the details.

MikeBishop commented 3 years ago

Here's the code in question:

# Clean up obsolete directories (2592000 = 30 days)
@CUTOFF=$$(($$(date '+%s')-2592000)); \
MAYBE_OBSOLETE=`comm -13 <(git branch -a | sed -e 's,.*[ /],,' | sort | uniq) <(ls $(GHPAGES_ROOT) | sed -e 's,.*/,,')`; \
for item in $$MAYBE_OBSOLETE; do \
  if [ -d "$(GHPAGES_ROOT)/$$item" ] && \
     [ `git -C $(GHPAGES_ROOT) log -n 1 --format=%ct -- $$item` -lt $$CUTOFF ]; then \
    echo "Remove obsolete '$$item'"; \
    git -C $(GHPAGES_ROOT) rm -rfq -- $$item; \
  fi \
done

What it's supposed to do is remove artifacts from a branch when it no longer exists and they're more than 30 days old.

martinthomson commented 3 years ago

I'm looking at https://anr-bmbf-pivot.github.io/draft-dns-over-coap/ and not seeing any dead links.

The code that Mike points at finds directories that exist on the gh-pages branch, but don't have matching branches. It then removes the directory. There is a second step where the index is regenerated, which is based on the directories that remain.

The only thing that might have caused problems here is that this cleanup might have been committed without updating the index. Or if the index was generated before the cleanup happened. That seems like it might be the cause of the problem. (I am relying on dependency ordering here more than is appropriate; I'll see if a small update will fix that.)

AkroutiHamza commented 2 years ago

if you add more doc then will be ok