Repository navigation
WW-5872 Release build: fail the build when the documentation fetch produces no files - #2156
Open
arunmanni-ai wants to merge 2 commits into
Open
arunmanni-ai wants to merge 2 commits into
arunmanni-ai wants to merge 2 commits into
Conversation
lukaszlenart
reviewed
Dec 3, 2026
…s run Nothing cleared the directory beforehand, so on a build without clean the files from an earlier successful run were still present and the count passed even when today's fetch produced nothing. The assemblies would then ship stale documentation. The directory is deleted before it is recreated, so the count only ever sees files written by the current run. erroronmissingdir is dropped from the fileset because the mkdir guarantees the directory exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
docsexecution of the assembly module runs wget through an antrun<exec>with nofailonerror. If the fetch fails, wget exits non-zero, the<exec>ignores it, and the build reports success withtarget/docsempty.all.xmlanddocs.xmlcopy that directory intodocs/docs, so theallanddocsassemblies would be published without documentation and nothing would flag it.This adds an Ant
<fail>after the fetch that aborts the build whentarget/docscontains no files.I did not use
failonerror="true": the fetch is recursive over the six trees indocs-urls.txt, and wget exits 8 when any single URL returns an error response, so one stale link on the documentation site would fail every release build. Checking the output directory tests the condition that matters and is not sensitive to wget's exit-code semantics.Known limitation, deliberate: this catches a fetch that produced nothing, not a partial one. A stricter form could assert one retrieved page per line in
docs-urls.txt, at the cost of coupling the pom to that file's contents. Happy to switch if you prefer that.Verification
CI runs with
-DskipAssembly, which deactivates theincludeAssemblyprofile, so the assembly module is not in the reactor and these checks do not exercise this path. Verified locally in both directions (-DskipITsneeded because the struts2-showcase integration tests fail independently and assembly sits after showcase in the reactor):assembly/target/docs, the new<fail>silent;docs-urls.txttemporarily pointed at a non-resolving host: BUILD FAILURE withThe documentation fetch produced no files in .../assembly/target/docs; the all and docs assemblies would be published without documentation.Worth noting antrun already logged
[ERROR] [exec] Result: 4for the failed fetch before this change — the signal was present, it just did not stop the build.Fixes WW-5872