You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Chris M. Hostetter (Jira)" <ji...@apache.org> on 2021/03/16 18:06:00 UTC

[jira] [Commented] (SOLR-15267) ref-guide link checking doesn't fail on bad links in index.html???

    [ https://issues.apache.org/jira/browse/SOLR-15267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17302756#comment-17302756 ] 

Chris M. Hostetter commented on SOLR-15267:
-------------------------------------------

Ok, I understand what's happening now...

 
* Once upon a time, every {{*.adoc}} page used the same jekyll layout {{page.html}} which contained a {{<section class="content">}} around the asciidoctor content of the page (the rest of the layout is header/footer/sidebar, etc..)
* When I first wrote the link checking logic, in order to avoid redundantly checking every header/footer/sidebar link in every page (which took forever), I used a DOM selector of {{.content}} to constrain the section of the page that we wanted to link check (with some error checking to confirm we found at least one node matching that selector on every page we checked)
* SOLR-12164 introduced a new {{home.html}} for use with {{index.adoc}} specifically to to use a different wrapper around the content, so CSS could be used to style it differnetly
* my "must find at least one node using selector {{.content}} " error checking still "passed", because asciidoctor also uses the class "content" in some of it's html generation.

So I think what I'm going to to fix this (and future proof it against other layout changes down the roat) is...
* add a {{ref-guide-link-check-root}} css class to the main wrapper tag in both layouts
* update the link check logic to look for this class, and asser there is _exactly_ one match

> ref-guide link checking doesn't fail on bad links in index.html???
> ------------------------------------------------------------------
>
>                 Key: SOLR-15267
>                 URL: https://issues.apache.org/jira/browse/SOLR-15267
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Assignee: Chris M. Hostetter
>            Priority: Major
>
> While trying to sanity check my fix for SOLR-15263 is discovered that (for reasons my brain is not currently able to fathom) the link checking logic doesn't seem to be working on index.adoc / index.html ... but having the same invalid links in other files works fine ... this needs fixed (just as soon as i figure out WTF is going wrong)
> {noformat}
>  hossman@slate:~/lucene/solr/solr/solr-ref-guide [*main] $ gradle checkLocalJavadocLinksSite
> Using gradle at '/home/hossman/lucene/solr/gradlew' to run buildfile '/home/hossman/lucene/solr/solr/solr-ref-guide/build.gradle':
> > Task :solr:solr-ref-guide:checkLocalJavadocLinksSite FAILED
> Relative link points at dest file that doesn't exist: ../../nocommit.html.html
>  ... source: file:/home/hossman/lucene/solr/solr/solr-ref-guide/build/local-jdoc-links-site/rate-limiters.html
> Relative link points at dest file that doesn't exist: nocommit.html
>  ... source: file:/home/hossman/lucene/solr/solr/solr-ref-guide/build/local-jdoc-links-site/rate-limiters.html
> Processed 2495 links (1984 relative) to 3742 anchors in 252 files
> Total of 2 problems foundFAILURE: Build failed with an exception.* What went wrong:
> Execution failed for task ':solr:solr-ref-guide:checkLocalJavadocLinksSite'.
> > Process 'command '/opt/jdk/11/jdk-11.0.4+11/bin/java'' finished with non-zero exit value 255* Try:
> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 6s
> 27 actionable tasks: 3 executed, 24 up-to-date
> hossman@slate:~/lucene/solr/solr/solr-ref-guide [*main] $ git diff
> diff --git a/solr/solr-ref-guide/src/index.adoc b/solr/solr-ref-guide/src/index.adoc
> index 789c546f861..c7b354b07c2 100644
> --- a/solr/solr-ref-guide/src/index.adoc
> +++ b/solr/solr-ref-guide/src/index.adoc
> @@ -137,3 +137,8 @@ The *<<getting-started.adoc#,Getting Started>>* section guides you through the i
>  *<<the-well-configured-solr-instance.adoc#,The Well-Configured Solr Instance>>*: This section discusses performance tuning for Solr. It begins with an overview of the `solrconfig.xml` file, then tells you how to configure cores with `solr.xml`, how to configure the Lucene index writer
>  ****
>  --
> +
> +
> +<<../../nocommit.html#,Bogus1>>
> +<<nocommit.adoc#,Bogus2>>
> +
> diff --git a/solr/solr-ref-guide/src/rate-limiters.adoc b/solr/solr-ref-guide/src/rate-limiters.adoc
> index 708f1f8883f..43852a5788a 100644
> --- a/solr/solr-ref-guide/src/rate-limiters.adoc
> +++ b/solr/solr-ref-guide/src/rate-limiters.adoc
> @@ -99,3 +99,8 @@ pending task to make it a priority based model (https://issues.apache.org/jira/b
>  
>  NOTE: This feature is experimental and gives no guarantee of borrowed slots being
>  returned in time.
> +
> +
> +<<../../nocommit.html#,Bogus1>>
> +<<nocommit.adoc#,Bogus2>>
> +
> (END)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)