Brijesh619 commented on code in PR #721:
URL: https://github.com/apache/atlas/pull/721#discussion_r3927980654


##########
webapp/pom.xml:
##########
@@ -683,6 +683,38 @@
                             </tasks>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>fix-enunciate-css</id>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <tasks>
+                                <!-- Copy CSS -->
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/css/bootstrap.min.css" 
todir="${project.build.directory}/api/v2/css" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/css/bootstrap.min.css" 
todir="${project.build.directory}/api/v2/apidocs/css" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/css/bootstrap.min.css" 
todir="${project.build.directory}/api/v2/apidocs/ui/css" />
+
+                                <!-- Copy JS -->
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/jquery-1.12.2.min.js" 
todir="${project.build.directory}/api/v2/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/bootstrap.min.js" 
todir="${project.build.directory}/api/v2/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/run_prettify.js" 
todir="${project.build.directory}/api/v2/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/jquery-1.12.2.min.js" 
todir="${project.build.directory}/api/v2/apidocs/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/bootstrap.min.js" 
todir="${project.build.directory}/api/v2/apidocs/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/run_prettify.js" 
todir="${project.build.directory}/api/v2/apidocs/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/jquery-1.12.2.min.js" 
todir="${project.build.directory}/api/v2/apidocs/ui/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/bootstrap.min.js" 
todir="${project.build.directory}/api/v2/apidocs/ui/js" />
+                                <copy failonerror="false" 
file="${project.basedir}/src/main/enunciate-assets/js/run_prettify.js" 
todir="${project.build.directory}/api/v2/apidocs/ui/js" />
+
+                                <!-- Replace URLs -->
+                                <replace 
dir="${project.build.directory}/api/v2" includes="**/*.html" 
token="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css";
 value="css/bootstrap.min.css" />
+                                <replace 
dir="${project.build.directory}/api/v2" includes="**/*.html" 
token="https://code.jquery.com/jquery-1.12.2.min.js"; 
value="js/jquery-1.12.2.min.js" />

Review Comment:
   Verification & Resolution Details:
   
   jQuery CDN Token Replacement & Version Alignment:
   Enunciate 2.13.2 generates <script 
src="https://code.jquery.com/jquery-1.12.2.min.js";></script> in all HTML output 
pages (index.html, data.html, resource_*.html, json_*.html).
   The token replace rule <replace dir="${project.build.directory}/api/v2" 
includes="**/*.html" token="https://code.jquery.com/jquery-1.12.2.min.js"; 
value="js/jquery-1.12.2.min.js" /> matches the exact URL emitted by Enunciate.
   Verified across all 118 generated HTML pages in target/api/v2/: 
https://code.jquery.com/... is replaced with js/jquery-1.12.2.min.js, matching 
the bundled jQuery 1.12.2 asset.
   Build Failure Handling (failonerror="true"):
   Set failonerror="true" on all asset copy tasks to ensure missing assets 
trigger an immediate build failure instead of failing silently.
   Consolidation of Duplicate Copy Tasks:
   Replaced individual file copy calls with directory-level <fileset> copy 
tasks for enunciate-assets/css and enunciate-assets/js.
   Automated CDN Verification Assertions:
   Added Ant <fail> assertions in webapp/pom.xml that scan all generated .html 
and .js files under target/api/v2/. If any bootstrapcdn.com, code.jquery.com, 
or cdn.jsdelivr.net URL remains, the build immediately fails with a descriptive 
error message.
   Execution Guard & Naming:
   Renamed execution ID to fix-enunciate-csp-assets and guarded execution with 
<skip>${skipEnunciate}</skip>.



##########
docs/src/documents/RestAPI.md:
##########
@@ -10,4 +10,3 @@ import {CustomLink} from 
"theme/components/shared/common/CustomLink";
 # REST API
 
 1. <CustomLink href="http://atlas.apache.org/api/v2/index.html";>REST API 
Documentation</CustomLink>
-2. <CustomLink href="http://atlas.apache.org/api/rest.html";>Legacy API 
Documentation </CustomLink>

Review Comment:
   Addressed. Restored the <CustomLink 
href="http://atlas.apache.org/api/rest.html";>Legacy API 
Documentation</CustomLink> link in docs/src/documents/RestAPI.md.



##########
docs/crypto-fallback.js:
##########
@@ -0,0 +1,30 @@
+/**

Review Comment:
   Addressed. Refactored docs/crypto-fallback.js to eliminate global patching 
risks:
   
   crypto.createHash now attempts standard originalCreateHash("md4", options) 
first, falling back to sha256 only if ERR_OSSL_EVP_UNSUPPORTED is thrown (Node 
17+ / OpenSSL 3.0 compatibility for Docz v1.2 / Webpack 4 asset hashing).
   ECONNRESET handling now logs explicit warnings (console.warn) for Docz dev 
build process sockets rather than silently swallowing errors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to