Copilot commented on code in PR #366:
URL: 
https://github.com/apache/grails-static-website/pull/366#discussion_r2155219401


##########
buildSrc/src/main/groovy/org/grails/documentation/DownloadPage.groovy:
##########
@@ -62,13 +63,29 @@ class DownloadPage {
                             a(href: binaryUrl(version, 'grails-wrapper', 
'.sha512'), 'SHA512')
                             a(href: binaryUrl(version, 'grails-wrapper', 
'.asc'), 'ASC')
                         }
+                        li {
+                            a(href: sourceUrl(version, '', 
'grails-spring-security', 'spring-security'), 'Grails Spring Security Plugin 
Source')
+                            a(href: sourceUrl(version, '.sha512', 
'grails-spring-security', 'spring-security'), 'SHA512')
+                            a(href: sourceUrl(version, '.asc', 
'grails-spring-security', 'spring-security'), 'ASC')
+                        }
+                        li {
+                            a(href: sourceUrl('5.0.0-M4', '', 'grails-redis', 
'redis'), 'Grails Redis 5.0.0-M4 Plugin Source')
+                            a(href: sourceUrl('5.0.0-M4', '.sha512', 
'grails-redis', 'redis'), 'SHA512')
+                            a(href: sourceUrl('5.0.0-M4', '.asc', 
'grails-redis', 'redis'), 'ASC')

Review Comment:
   The version for the Grails Redis plugin is hardcoded to '5.0.0-M4'; consider 
using the `version` variable or passing the plugin version as a parameter to 
keep links in sync with the current release.
   ```suggestion
                               a(href: sourceUrl(version, '', 'grails-redis', 
'redis'), "Grails Redis ${version} Plugin Source")
                               a(href: sourceUrl(version, '.sha512', 
'grails-redis', 'redis'), 'SHA512')
                               a(href: sourceUrl(version, '.asc', 
'grails-redis', 'redis'), 'ASC')
   ```



##########
buildSrc/src/main/groovy/org/grails/documentation/DownloadPage.groovy:
##########
@@ -25,12 +25,13 @@ import groovy.xml.MarkupBuilder
 @CompileStatic
 class DownloadPage {
 
-    static String binaryUrl(String version, String artifact, String ext = '') {
-        
"https://www.apache.org/dyn/closer.lua/grails/core/${version}/distribution/apache-${artifact}-${version}-incubating-bin.zip${ext}?action=download";
+    static String binaryUrl(String version, String artifact, String ext = '', 
String directory = 'core') {
+        
"https://www.apache.org/dyn/closer.lua/grails/${directory}/${version}/distribution/apache-${artifact}-${version}-incubating-bin.zip${ext}?action=download";
+
     }
 
-    static String sourceUrl(String version, String ext = '') {
-        
"https://www.apache.org/dyn/closer.lua/grails/core/${version}/sources/apache-grails-${version}-incubating-src.zip${ext}?action=download";
+    static String sourceUrl(String version, String ext = '', String 
artifact='grails', String directory = 'core') {

Review Comment:
   [nitpick] The parameter order in `sourceUrl` (version, ext, artifact, 
directory) differs from `binaryUrl` (version, artifact, ext, directory). 
Aligning their signatures will reduce confusion and improve consistency.
   ```suggestion
       static String sourceUrl(String version, String artifact = 'grails', 
String ext = '', String directory = 'core') {
   ```



##########
buildSrc/src/main/groovy/org/grails/documentation/DownloadPage.groovy:
##########
@@ -62,13 +63,29 @@ class DownloadPage {
                             a(href: binaryUrl(version, 'grails-wrapper', 
'.sha512'), 'SHA512')
                             a(href: binaryUrl(version, 'grails-wrapper', 
'.asc'), 'ASC')
                         }
+                        li {
+                            a(href: sourceUrl(version, '', 
'grails-spring-security', 'spring-security'), 'Grails Spring Security Plugin 
Source')
+                            a(href: sourceUrl(version, '.sha512', 
'grails-spring-security', 'spring-security'), 'SHA512')
+                            a(href: sourceUrl(version, '.asc', 
'grails-spring-security', 'spring-security'), 'ASC')
+                        }
+                        li {
+                            a(href: sourceUrl('5.0.0-M4', '', 'grails-redis', 
'redis'), 'Grails Redis 5.0.0-M4 Plugin Source')
+                            a(href: sourceUrl('5.0.0-M4', '.sha512', 
'grails-redis', 'redis'), 'SHA512')
+                            a(href: sourceUrl('5.0.0-M4', '.asc', 
'grails-redis', 'redis'), 'ASC')
+                        }

Review Comment:
   [nitpick] The code for rendering plugin download entries is repetitive for 
each plugin. Consider extracting a helper method that generates these `<li>` 
blocks given plugin metadata to improve reuse and ease future additions.
   ```suggestion
                           renderPluginLi(html, version, 
'grails-spring-security', 'spring-security', 'Grails Spring Security Plugin 
Source')
                           renderPluginLi(html, '5.0.0-M4', 'grails-redis', 
'redis', 'Grails Redis 5.0.0-M4 Plugin Source')
   ```



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