Arun Manni created WW-5872:
------------------------------

             Summary: Release build: fail the build when the bundled 
documentation fetch produces nothing
                 Key: WW-5872
                 URL: https://issues.apache.org/jira/browse/WW-5872
             Project: Struts 2
          Issue Type: Improvement
          Components: Build Management
            Reporter: Arun Manni
             Fix For: 7.6.0


The docs execution of the assembly module (assembly/pom.xml) runs wget through 
an antrun <exec> with no failonerror. If the fetch fails for any reason, wget 
exits non-zero, the <exec> ignores it, and the build reports success with 
target/docs empty or partial.

all.xml and docs.xml copy target/docs into docs/docs, so the all and docs 
assemblies would be published with missing or absent documentation and nothing 
in the build would flag it. By contrast stage-assemblies.sh, in the same 
release path, checks both the wget exit status and the outcome and aborts on 
either.

Proposed change: after the fetch, fail the build if target/docs contains no 
files, using an Ant <fail> with a resourcecount condition. A stricter form 
could assert one retrieved page per line in docs-urls.txt, catching a partial 
fetch as well as a total one.

Setting failonerror="true" looks more obvious but is fragile here: the fetch is 
recursive over six trees and wget exits 8 if any single URL returns an error, 
so one stale link would fail every release build. Checking the output directory 
tests what actually matters.

Independent of WW-5870, though enabling certificate validation there adds one 
more way for the fetch to fail, which is what surfaced it. Happy to prepare the 
PR — say which form you prefer.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to