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

[INFRA] Fix linkchecker #982

Merged
merged 5 commits into from Jan 21, 2022
Merged

Conversation

sappelhoff
Copy link
Member

@sappelhoff sappelhoff commented Jan 20, 2022

The problem with our linkchecker failing for weeks is the following:

This is how it looks:

<!doctype html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      
      
      
        <link rel="canonical" href="https://bids-specification.readthedocs.io/en/stable/01-introduction.html">
...

Whenever we add a new HTML page to the spec, like the glossary, or microscopy - but haven't done a release yet, linkchecker will fail because those HTML pages are not available in the stable (canonical) URL.

I think we can fix this by temporarily adding these files to the ignore list of the linkchecker, and then "cleaning up" that ignore list at release time.

WDYT?

EDIT: cc @tsalo who figured this out in the first place

@sappelhoff
Copy link
Member Author

I also tend to start ignoring doi.org links here, see bids-standard/bids-website#223

Comment on lines 56 to 57
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/10-microscopy.html' \
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/99-appendices/14-glossary.html' \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't we just ignore all stable links?

Suggested change
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/10-microscopy.html' \
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/99-appendices/14-glossary.html' \
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't think of a reason.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear: this means that none of the internal links will be checked then. Am I understanding this correctly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this will only impact the links in the HTML headers, because the internal spec links (in the text) are looking like this:

<p>Additional fields can include external behavioral measures relevant to the
scan.
For example vigilance questionnaire score administered after a resting
state scan.
All such included additional fields SHOULD be documented in an accompanying
<code>_scans.json</code> file that describes these fields in detail
(see <a href="02-common-principles.html#tabular-files">Tabular files</a>).</p>
<p>Example <code>_scans.tsv</code>:</p>
<div class="highlight"><pre><span></span><code>filename    acq_time
func/sub-control01_task-nback_bold.nii.gz   1877-06-15T13:45:30
func/sub-control01_task-motor_bold.nii.gz   1877-06-15T13:55:33

that is: They don't match the full form https://bids-specification.readthedocs.io/en/stable/.*

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah OK
thanks for the clarification

sappelhoff and others added 2 commits January 20, 2022 19:37
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Copy link
Collaborator

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sappelhoff sappelhoff merged commit d611689 into bids-standard:master Jan 21, 2022
@sappelhoff sappelhoff deleted the fix_linkchecker branch January 21, 2022 09:32
@effigies effigies added the exclude-from-changelog This item will not feature in the automatically generated changelog label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-from-changelog This item will not feature in the automatically generated changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants