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


##########
docs/src/documents/RestAPI.md:
##########
@@ -10,4 +10,3 @@ import {CustomLink} from 
"theme/components/shared/common/CustomLink";
 # REST API

Review Comment:
   Added third-party license files for Bootstrap 3.4.1 (MIT), jQuery 1.12.2 
(MIT), and Google Code Prettify (Apache 2.0) under 3party-licenses/:
   
   3party-licenses/bootstrap-LICENSE
   3party-licenses/jquery-LICENSE
   3party-licenses/google-code-prettify-LICENSE
   Also updated the project LICENSE, 
docs/src/documents/Project-Info/ProjectLicense.md, and NOTICE files accordingly.
   
   Verified the changes with:
   
   mvn clean package -pl webapp -DskipEnunciate=true (Build Success & Apache 
Rat check passed with 0 unapproved licenses)
   mvn clean package -pl webapp (Build Success)
   



##########
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" />
+                                <replace 
dir="${project.build.directory}/api/v2" includes="**/*.html" 
token="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"; 
value="js/bootstrap.min.js" />
+                                <replace 
dir="${project.build.directory}/api/v2" includes="**/*.html" 
token="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js";
 value="js/run_prettify.js" />

Review Comment:
   Addressed. In addition to patching run_prettify.js to derive relative local 
asset paths at runtime and bundling prettify.css locally, added a Maven antrun 
<replace> execution task to webapp/pom.xml (includes="**/*.js" 
token="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/"; 
value="") to ensure all embedded CDN references inside JS assets are replaced 
at build time.



##########
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" />

Review Comment:
   Addressed. Changed failonerror="false" to failonerror="true" across all 
<copy> tasks in webapp/pom.xml. If any asset file is missing, the Maven build 
will now fail explicitly.



##########
webapp/pom.xml:
##########
@@ -683,6 +683,38 @@
                             </tasks>
                         </configuration>
                     </execution>
+                    <execution>

Review Comment:
   Added build-step assertions in webapp/pom.xml (maven-antrun-plugin). The 
build will now fail with an explicit error message if any generated HTML or JS 
files under target/api/v2/ contain bootstrapcdn.com, code.jquery.com, or 
cdn.jsdelivr.net URLs.



-- 
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