You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "mansi75 (via GitHub)" <gi...@apache.org> on 2026/03/12 13:19:27 UTC

[PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

mansi75 opened a new pull request, #56:
URL: https://github.com/apache/fineract-site/pull/56

   ## What
   Fixes FINERACT-2528 in apache/fineract-site.
   
   ## Changes
   - updated footer rendering to improve Whimsy-compatible ASF footer checks
   - added Privacy Policy in the legal footer block
   - documented how maintainers can build, serve, and verify the site locally
   
   ## Testing
   - built the site locally with Docker
   - ran local check command
   - served the site locally and verified footer links and legal text
   - checked below links locally
   License
   Thanks
   Privacy
   Security
   Sponsorship
   
   ## References
   - JIRA: FINERACT-2528
   - Hint PR: #46


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on PR #56:
URL: https://github.com/apache/fineract-site/pull/56#issuecomment-4049039665

   Also, please PGP-sign your commits.


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2926833584


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   @meonkeys Sure, I will update the README.md.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on PR #56:
URL: https://github.com/apache/fineract-site/pull/56#issuecomment-4049389973

   @meonkeys I will sign the commits.


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2937108330


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -29,8 +31,16 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
 
       <div class="site-footer-legal center-align white-text">
         <p>
-          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation</a>.
-          Licensed under the <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">Apache License, Version 2.0</a>.
+          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">
+            Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation
+          </a>.
+          Licensed under the
+          <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">
+            Apache License, Version 2.0
+          </a>.
+          <a class="white-text" href="{{ $footer.privacy_url }}" target="_blank" rel="noopener">
+            Privacy Policy
+          </a>.

Review Comment:
   Fixed this in Fixed in 5301431.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2996398260


##########
scripts/check-whimsy-json.sh:
##########
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+# Checks whimsy site-scan.json for fineract compliance
+# Usage: ./scripts/check-whimsy-json.sh
+# Source: https://whimsy.apache.org/public/site-scan.json
+
+set -euo pipefail
+
+echo "Fetching whimsy site-scan.json..."
+DATA=$(curl -s https://whimsy.apache.org/public/site-scan.json | jq '.fineract')
+
+echo "Whimsy scan results for fineract:"
+echo "$DATA" | jq .
+
+FAILED=0
+
+check_field() {
+  FIELD=$1
+  VALUE=$(echo "$DATA" | jq -r ".$FIELD")
+  if [ "$VALUE" = "null" ] || [ -z "$VALUE" ]; then
+    echo "FAIL: $FIELD is null/missing"
+    FAILED=1
+  else
+    echo "PASS: $FIELD = $VALUE"
+  fi
+}
+
+check_field "uri"
+check_field "foundation"
+check_field "events"
+check_field "license"
+check_field "thanks"
+check_field "security"
+check_field "sponsorship"
+check_field "trademarks"
+check_field "copyright"
+check_field "privacy"
+check_field "resources"
+check_field "image"
+
+# csp_check is done differently - whimsy sets it to "OK" if csp matches
+# the expected DEFAULT_CSP pattern from sitestandards.rb
+# See: https://infra.apache.org/tools/csp.html
+CSP_CHECK=$(echo "$DATA" | jq -r '.csp_check')

Review Comment:
   @meonkeys I have updated the check-whimsy-json according to the above changes mentioned. I think you meant csp_check to be against the "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval'......data: blob:;". Please kindly check 



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2983488281


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   Hi @mansi75, just checking in on this. Should I merge this one or leave it open?



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using <i> for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   
   "gavel"  parent is <i> so it is not skipped by whimsy and is collected. License's parent is plain <span> (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from <i> to <span class="material-icons icon-sr-only">
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2990719750


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,239 @@
+#!/usr/bin/env ruby
+# Replicates exactly how whimsy's site-scan.rb uses sitestandards.rb
+# Source: https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Source: https://github.com/apache/whimsy/blob/master/lib/whimsy/sitestandards.rb
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+
+#########################################################################
+# Exact copy of SiteStandards module from sitestandards.rb
+#########################################################################
+module SiteStandards
+  CHECK_TEXT     = 'text'
+  CHECK_CAPTURE  = 'capture'
+  CHECK_VALIDATE = 'validate'
+  CHECK_TYPE     = 'type'
+  CHECK_POLICY   = 'policy'
+  CHECK_DOC      = 'doc'
+
+  COMMON_CHECKS = {
+    'foundation' => {
+      CHECK_TEXT     => %r{apache|asf|foundation}i,
+      CHECK_CAPTURE  => %r{^(https?:)?//(www\.)?apache\.org/?$},
+      CHECK_VALIDATE => %r{apache|asf|foundation}i,
+      CHECK_TYPE     => 'text',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs#navigation',
+      CHECK_DOC      => 'All projects must feature some prominent link back to the main ASF homepage at http://www.apache.org/',
+    },
+    'events' => {
+      CHECK_TEXT     => nil,
+      CHECK_CAPTURE  => %r{apachecon\.com/event-images|events\.apache\.org|apache\.org/events/current-event},
+      CHECK_VALIDATE => %r{^https?://((www\.)?apache\.org/events/current-event|events\.apache\.org|www\.apachecon\.com/event-images/snippet\.js)},
+      CHECK_TYPE     => 'href',
+      CHECK_POLICY   => 'https://www.apachecon.com/event-images/',
+      CHECK_DOC      => 'Projects SHOULD include a link to any current CommunityOverCode event.',
+    },
+    'license' => {
+      CHECK_TEXT     => /^license$/,
+      CHECK_CAPTURE  => %r{apache\.org},
+      CHECK_VALIDATE => %r{^https?://.*apache.org/licenses/?$},
+      CHECK_TYPE     => 'href',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs#navigation',
+      CHECK_DOC      => 'There should be a "License" (*not* "Licenses") navigation link which points to: http[s]://www.apache.org/licenses[/]. (Do not link to sub-pages)',
+    },
+    'thanks' => {
+      CHECK_TEXT     => /\A(sponsors|thanks!?|thanks to our sponsors)\z/,
+      CHECK_CAPTURE  => /\A(sponsors|thanks!?|thanks to our sponsors)\z/,
+      CHECK_VALIDATE => %r{^https?://.*apache.org/foundation/(thanks|sponsors)},
+      CHECK_TYPE     => 'href',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs#navigation',
+      CHECK_DOC      => '"Sponsors", "Thanks" or "Thanks to our Sponsors" should link to: http://www.apache.org/foundation/thanks.html or sponsors.html',
+    },
+    'security' => {
+      CHECK_TEXT     => /security/,
+      CHECK_CAPTURE  => /security/,
+      CHECK_VALIDATE => %r{^(https?://.*apache.org|[^:]*)/.*[Ss]ecurity},
+      CHECK_TYPE     => 'href',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs#navigation',
+      CHECK_DOC      => '"Security" should link to a project-specific page or http://www.apache.org/security/',
+    },
+    'sponsorship' => {
+      CHECK_TEXT     => %r{sponsorship|\bdonate\b|sponsor\sapache|sponsoring\sapache|\bsponsor\b},
+      CHECK_CAPTURE  => %r{sponsorship|\bdonate\b|sponsor\sapache|sponsoring\sapache|\bsponsor\b},
+      CHECK_VALIDATE => %r{^https?://.*apache.org/foundation/sponsorship},
+      CHECK_TYPE     => 'href',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs#navigation',
+      CHECK_DOC      => '"Sponsorship", "Sponsor Apache", or "Donate" should link to: http://www.apache.org/foundation/sponsorship.html',
+    },
+    'trademarks' => {
+      CHECK_TEXT     => %r{\btrademarks\b},
+      CHECK_CAPTURE  => %r{\btrademarks\b},
+      CHECK_VALIDATE => %r{trademarks of [Tt]he Apache Software Foundation},
+      CHECK_TYPE     => 'text',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs#attributions',
+      CHECK_DOC      => 'All project homepages must feature a prominent trademark attribution.',
+    },
+    'copyright' => {
+      CHECK_TEXT     => %r{((Copyright|©).*apache|apache.*(Copyright|©))}i,
+      CHECK_CAPTURE  => %r{(Copyright|©)}i,
+      CHECK_VALIDATE => %r{((Copyright|©).*apache|apache.*(Copyright|©))}i,
+      CHECK_TYPE     => 'text',
+      CHECK_POLICY   => 'https://www.apache.org/legal/src-headers.html#headers',
+      CHECK_DOC      => 'All website content SHOULD include a copyright notice for the ASF.',
+    },
+    'privacy' => {
+      CHECK_TEXT     => %r{Privacy Policy}i,
+      CHECK_CAPTURE  => %r{(Privacy)}i,
+      CHECK_VALIDATE => %r{\Ahttps://privacy\.apache\.org/policies/privacy-policy-public\.html\z
+                          |
+                          \Ahttps?://(?:www\.)?apache\.org/foundation/policies/privacy\.html\z
+                          }ix,
+      CHECK_TYPE     => 'href',
+      CHECK_POLICY   => 'https://www.apache.org/foundation/marks/pmcs.html#navigation',
+      CHECK_DOC      => 'All websites must link to the Privacy Policy.',
+    },
+  }
+end
+
+#########################################################################
+# Exact copy of helper functions from site-scan.rb
+#########################################################################
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with? 'sr-only'
+    end
+  end
+  squash(bits.join(' '))
+end
+
+def save_events(data, value)
+  prev = data[:events]
+  if prev and prev != value
+    puts "Events: already have '#{prev}', not storing '#{value}'"
+  else
+    data[:events] = value
+  end
+end
+
+<<<<<<< HEAD

Review Comment:
   Looks like a merge conflict marker. I think this is breaking the build.



##########
.github/workflows/whimsy-daily-check.yml:
##########
@@ -0,0 +1,63 @@
+name: Daily Whimsy Check
+
+on:
+  schedule:
+    - cron: '0 8 * * *'  # runs every day at 8am UTC
+  workflow_dispatch:
+
+jobs:
+  whimsy-check:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check whimsy site-scan.json for fineract errors
+        run: |
+          echo "Fetching whimsy site-scan.json..."
+          DATA=$(curl -s https://whimsy.apache.org/public/site-scan.json | jq '.fineract')
+
+          echo "Whimsy scan results for fineract:"
+          echo "$DATA" | jq .
+
+          # Check all fields from sitestandards.rb COMMON_CHECKS
+          FAILED=0
+
+          check_field() {
+            FIELD=$1
+            VALUE=$(echo "$DATA" | jq -r ".$FIELD")
+            if [ "$VALUE" = "null" ] || [ -z "$VALUE" ]; then
+              echo "FAIL: $FIELD is null/missing"
+              FAILED=1
+            else
+              echo "PASS: $FIELD = $VALUE"
+            fi
+          }
+
+          check_field "uri"
+          check_field "foundation"
+          check_field "events"
+          check_field "license"
+          check_field "thanks"
+          check_field "security"
+          check_field "sponsorship"
+          check_field "trademarks"
+          check_field "copyright"
+          check_field "privacy"
+          check_field "resources"
+          check_field "image"
+          check_field "csp_check"

Review Comment:
   I think the csp check is done differently. The whimsy test passes if the `csp` property matches, exactly: `default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; script-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; style-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; frame-ancestors 'self'; frame-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; worker-src 'self' data: blob:;`
   
   So I think we could just match that too? That's my best guess based on examining [failing and succeeding checks for ASF projects in the JSON](https://whimsy.apache.org/site/check/csp_check). Take a look at, e.g.: `jq .fineract.csp` (OK), `jq .cordova.csp` (OK), `jq .cayenne.csp` (FAIL)
   
   https://infra.apache.org/tools/csp.html might help us confirm/deny my guess



##########
scripts/test_run_whimsy_checks.rb:
##########
@@ -0,0 +1,373 @@
+#!/usr/bin/env ruby

Review Comment:
   How about we run this for PRs too?
   
   e.g. add a `test` line after the `build` (last) line in `.github/workflows/site-pr-check.yml`



##########
.github/workflows/whimsy-daily-check.yml:
##########
@@ -0,0 +1,63 @@
+name: Daily Whimsy Check
+
+on:
+  schedule:
+    - cron: '0 8 * * *'  # runs every day at 8am UTC
+  workflow_dispatch:
+
+jobs:
+  whimsy-check:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check whimsy site-scan.json for fineract errors
+        run: |
+          echo "Fetching whimsy site-scan.json..."

Review Comment:
   please move this shell code into a new file under `scripts/` and run it, similar to how we do it in `.github/workflows/verify-commits.yml`. I like to keep these github actions/workflow yaml config files simple, and support easy local runs



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2927335696


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   How does one "verify the footer locally"? Do you mean visually? I would hope a dev would run whimsy instead. And if there's any way we can make that easier for them, e.g. "before submitting your PR, do `docker run whimsy-checks`".



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2996714580


##########
scripts/check-whimsy-json.sh:
##########
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+# Checks whimsy site-scan.json for fineract compliance
+# Usage: ./scripts/check-whimsy-json.sh
+# Source: https://whimsy.apache.org/public/site-scan.json
+
+set -euo pipefail
+
+echo "Fetching whimsy site-scan.json..."
+DATA=$(curl -s https://whimsy.apache.org/public/site-scan.json | jq '.fineract')
+
+echo "Whimsy scan results for fineract:"
+echo "$DATA" | jq .
+
+FAILED=0
+
+check_field() {
+  FIELD=$1
+  VALUE=$(echo "$DATA" | jq -r ".$FIELD")
+  if [ "$VALUE" = "null" ] || [ -z "$VALUE" ]; then
+    echo "FAIL: $FIELD is null/missing"
+    FAILED=1
+  else
+    echo "PASS: $FIELD = $VALUE"
+  fi
+}
+
+check_field "uri"
+check_field "foundation"
+check_field "events"
+check_field "license"
+check_field "thanks"
+check_field "security"
+check_field "sponsorship"
+check_field "trademarks"
+check_field "copyright"
+check_field "privacy"
+check_field "resources"
+check_field "image"
+
+# csp_check is done differently - whimsy sets it to "OK" if csp matches
+# the expected DEFAULT_CSP pattern from sitestandards.rb
+# See: https://infra.apache.org/tools/csp.html
+CSP_CHECK=$(echo "$DATA" | jq -r '.csp_check')

Review Comment:
   You got it!



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2926833584


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   @meonkeys I have updated the README to avoid duplicating the Docker instructions and kept the Whimsy-specific local verification guidance only. Shall I remove Whimsy-specific local verification guidance as well or keep it?



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2928843931


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -29,8 +31,16 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
 
       <div class="site-footer-legal center-align white-text">
         <p>
-          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation</a>.
-          Licensed under the <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">Apache License, Version 2.0</a>.
+          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">
+            Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation
+          </a>.
+          Licensed under the
+          <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">
+            Apache License, Version 2.0
+          </a>.
+          <a class="white-text" href="{{ $footer.privacy_url }}" target="_blank" rel="noopener">

Review Comment:
   Agreed. I've removed the formatting-only changes and kept this PR limited to the actual Whimsy fix.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963142693


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   Other ideas (take them or leave them, totally up to you):
   
   1. add a unit test. That'll help we need to maintain `scripts/run_whimsy_checks.rb`
   2. instead of, or in addition to `scripts/run_whimsy_checks.rb`, make a new workflow that runs `curl https://whimsy.apache.org/public/site-scan.json | jq .fineract.errors` once a day and logs errors & fails if any errors are found
   3. maybe pull more/all of `lib/whimsy/sitestandards.rb` into our repo? I'm skeptical the abbreviated `CHECKS` in `scripts/run_whimsy_checks.rb` are working
   
   Finally, I'll just note how I'm confused that <https://whimsy.apache.org/site/project/fineract> shows red boxes (failed checks) but `curl https://whimsy.apache.org/public/site-scan.json | jq .fineract.errors` returns `[]`. I asked for help about that in `#whimsy` on <https://the-asf.slack.com>. `license` and `thanks` in that JSON output are both `null`... are those what's represented by the red boxes at <https://whimsy.apache.org/site/project/fineract>?



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963447247


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   oh wait, there might be a bug/feature in Whimsy itself. :facepalm:
   
   ```html
   <a class="ref-link waves-effect waves-light" href=https://www.apache.org/foundation/thanks.html target=_blank rel=noopener><span class="material-icons icon-sr-only" aria-hidden=true>favorite</span>
   <span>Thanks</span>
   </a>
   ```
   
   Maybe the whimsy checks started failing after I merged #46



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2991880938


##########
scripts/check-whimsy-json.sh:
##########
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+# Checks whimsy site-scan.json for fineract compliance
+# Usage: ./scripts/check-whimsy-json.sh
+# Source: https://whimsy.apache.org/public/site-scan.json
+
+set -euo pipefail
+
+echo "Fetching whimsy site-scan.json..."
+DATA=$(curl -s https://whimsy.apache.org/public/site-scan.json | jq '.fineract')
+
+echo "Whimsy scan results for fineract:"
+echo "$DATA" | jq .
+
+FAILED=0
+
+check_field() {
+  FIELD=$1
+  VALUE=$(echo "$DATA" | jq -r ".$FIELD")
+  if [ "$VALUE" = "null" ] || [ -z "$VALUE" ]; then
+    echo "FAIL: $FIELD is null/missing"
+    FAILED=1
+  else
+    echo "PASS: $FIELD = $VALUE"
+  fi
+}
+
+check_field "uri"
+check_field "foundation"
+check_field "events"
+check_field "license"
+check_field "thanks"
+check_field "security"
+check_field "sponsorship"
+check_field "trademarks"
+check_field "copyright"
+check_field "privacy"
+check_field "resources"
+check_field "image"
+
+# csp_check is done differently - whimsy sets it to "OK" if csp matches
+# the expected DEFAULT_CSP pattern from sitestandards.rb
+# See: https://infra.apache.org/tools/csp.html
+CSP_CHECK=$(echo "$DATA" | jq -r '.csp_check')

Review Comment:
   I'm seeing `csp_check` set to `null` for every site.
   
   I think you want to match `csp` to `"default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; script-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; style-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; frame-ancestors 'self'; frame-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://www.apachecon.com/ https://www.communityovercode.org/ https://*.apache.org/ https://apache.org/ https://*.scarf.sh/  ; worker-src 'self' data: blob:;"`



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2937118305


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -8,7 +8,9 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
         <div class="ref-group">
           {{- range $footer.links }}
           <a class="ref-link waves-effect waves-light" href="{{ .href }}" target="_blank" rel="noopener">
-            <i class="material-icons" aria-hidden="true">{{ .icon }}</i>
+            <span class="icon-sr-only" aria-hidden="true">

Review Comment:
   Fixed this in de57473.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using `<i>` for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is `<i>` so it is not skipped by whimsy and is collected. License's parent is plain <span> (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from `<i>` to <span class="material-icons icon-sr-only">
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using `<i>` for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is `<i>` so it is not skipped by whimsy and is collected. License's parent is plain `<span>`  (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from `<i>` to `<span class="material-icons icon-sr-only">`
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using `<i>` for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is `<i>` so it is not skipped by whimsy and is collected. License's parent is plain <span> (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from <i> to <span class="material-icons icon-sr-only">
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on PR #56:
URL: https://github.com/apache/fineract-site/pull/56#issuecomment-4130738832

   Please try that rebase again. Make sure your `asf-site` branch is up to date before you rebase. After that, your first commit (`FINERACT-2528: fix Whimsy footer checks and document local verification`) will be a direct descendant of 3a554523b48d82fcfe62bb5e6ede74a33e96b240


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2927335696


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   How does one "verify the footer locally"? Do you mean visually? I would hope a dev would run whimsy instead. And if there's any way we can make that easier for them, we should. E.g. "before submitting your PR, do `docker run whimsy-checks`" or something like that. And then add that same check to `.github/workflows/site-pr-check.yml`. Then it's much more likely https://whimsy.apache.org/site/project/fineract will show all green before and after every PR.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside `<a>`, skipping only text whose parent is a `<span>` with a class ending in sr-only. The current index.html on asf-site was built from a template using `<i>` for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is `<i>` so it is not skipped by whimsy and is collected. License's parent is plain `<span>`  (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from `<i>` to `<span class="material-icons icon-sr-only">`
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2990934568


##########
scripts/test_run_whimsy_checks.rb:
##########
@@ -0,0 +1,373 @@
+#!/usr/bin/env ruby

Review Comment:
   How about we run these unit tests for PRs too?
   
   e.g. add a `test` line after the `build` (last) line in `.github/workflows/site-pr-check.yml`



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on PR #56:
URL: https://github.com/apache/fineract-site/pull/56#issuecomment-4129781429

   Great work @mansi75! Please rebase your branch on top of `asf-site` before continuing. There shouldn't be any conflicts.


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2937117879


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -29,8 +31,16 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
 
       <div class="site-footer-legal center-align white-text">
         <p>
-          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation</a>.
-          Licensed under the <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">Apache License, Version 2.0</a>.
+          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">
+            Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation
+          </a>.
+          Licensed under the
+          <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">
+            Apache License, Version 2.0
+          </a>.
+          <a class="white-text" href="{{ $footer.privacy_url }}" target="_blank" rel="noopener">

Review Comment:
   Fixed this in de57473. 



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2928842805


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -8,7 +8,9 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
         <div class="ref-group">
           {{- range $footer.links }}
           <a class="ref-link waves-effect waves-light" href="{{ .href }}" target="_blank" rel="noopener">
-            <i class="material-icons" aria-hidden="true">{{ .icon }}</i>
+            <span class="icon-sr-only" aria-hidden="true">

Review Comment:
   You're right, that wrapper is unnecessary here. I added it while experimenting with the scanner behavior, but it doesn't belong in this PR. I've reverted it.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2926516998


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   These docker instructions are easily found above. Please don't duplicate them.
   
   From FINERACT-2528...
   
   > document how future maintainers can run the whimsy checks themselves, locally.
   >
   > See https://github.com/apache/fineract-site/pull/46 for hints/ideas.



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2937125745


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   I looked into using Whimsy directly as the dependency inside the Docker image, and I agree with the goal of avoiding a separately maintained local copy of the checks.
   
   I tried invoking Whimsy’s scanner directly, but the current entrypoint pulls in ASF-specific runtime dependencies and fails outside a fuller Whimsy/ASF environment (it expects  LDAP, the board checkout and committee data). Because of that, I don’t think we can use the scanner unmodified in this repo’s lightweight site image without bringing in a much larger runtime than the site build currently has.
   I have added a Ruby checker that mirrors Whimsy logic, I have kept Whimsy as the Docker dependency and add only a very small bit of glue code to call Whimsy’s current standards from within the existing site build flow, without reimplementing the checks ourselves as I did earlier in python script. 
   
   I have checked it in the local as shown below
   
   <img width="666" height="212" alt="Screenshot 2026-03-15 at 5 46 37 PM" src="https://github.com/user-attachments/assets/71b82b92-abde-46d3-8189-642974c33425" />
   
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2932674801


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -8,7 +8,9 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
         <div class="ref-group">
           {{- range $footer.links }}
           <a class="ref-link waves-effect waves-light" href="{{ .href }}" target="_blank" rel="noopener">
-            <i class="material-icons" aria-hidden="true">{{ .icon }}</i>
+            <span class="icon-sr-only" aria-hidden="true">

Review Comment:
   thank you. Please resolve this conversation (and others as you respond & fix things). It can help to also add a commit hash, e.g. "fixed this in de57473d716a827a7b2811452a3430abc5c961f2"



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2990368764


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys May you please kindly check the updated files based on the above feedback



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using <i> for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is `<i>` so it is not skipped by whimsy and is collected. License's parent is plain <span> (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from <i> to <span class="material-icons icon-sr-only">
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963068038


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   The goal of these checks is that, if they pass (locally and in CI), they'll pass on <https://whimsy.apache.org/site/project/fineract> as well.
   
   License and Thanks checks at <https://whimsy.apache.org/site/project/fineract> are currently red, so that means we've got some issue in the content on the `asf-site` branch.
   
   But when I run this script against code on this PR's branch, all checks are all GREEN. I don't see any changes to the content explaining why they should now be passing! Am I missing something?



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a `<span>` with a class ending in sr-only. The current index.html on asf-site was built from a template using `<i>` for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is `<i>` so it is not skipped by whimsy and is collected. License's parent is plain `<span>`  (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from `<i>` to `<span class="material-icons icon-sr-only">`
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using <i> for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is "<i>" so it is not skipped by whimsy and is collected. License's parent is plain <span> (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from <i> to <span class="material-icons icon-sr-only">
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2985101340


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Please leave it open, I have implemented the above changes, I will push the update then you may review once. 



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2927069322


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   @meonkeys I have updated the README to avoid duplicating the Docker instructions and kept the Whimsy-specific local verification guidance only. Shall I remove Whimsy-specific local verification guidance as well or keep it?



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2928851802


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   @meonkeys Please kindly review the added python script and changes in site-pr-check.yml and site-tool.ssh. If it is correct, I will add the correct instruction in the README file as well. 



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2996404804


##########
scripts/check-whimsy-json.sh:
##########
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+# Checks whimsy site-scan.json for fineract compliance
+# Usage: ./scripts/check-whimsy-json.sh
+# Source: https://whimsy.apache.org/public/site-scan.json
+
+set -euo pipefail
+
+echo "Fetching whimsy site-scan.json..."
+DATA=$(curl -s https://whimsy.apache.org/public/site-scan.json | jq '.fineract')
+
+echo "Whimsy scan results for fineract:"
+echo "$DATA" | jq .
+
+FAILED=0
+
+check_field() {
+  FIELD=$1
+  VALUE=$(echo "$DATA" | jq -r ".$FIELD")
+  if [ "$VALUE" = "null" ] || [ -z "$VALUE" ]; then
+    echo "FAIL: $FIELD is null/missing"
+    FAILED=1
+  else
+    echo "PASS: $FIELD = $VALUE"
+  fi
+}
+
+check_field "uri"
+check_field "foundation"
+check_field "events"
+check_field "license"
+check_field "thanks"
+check_field "security"
+check_field "sponsorship"
+check_field "trademarks"
+check_field "copyright"
+check_field "privacy"
+check_field "resources"
+check_field "image"
+
+# csp_check is done differently - whimsy sets it to "OK" if csp matches
+# the expected DEFAULT_CSP pattern from sitestandards.rb
+# See: https://infra.apache.org/tools/csp.html
+CSP_CHECK=$(echo "$DATA" | jq -r '.csp_check')

Review Comment:
   I have rebased on the latest asf-site and force-pushed. The first commit in the PR is now a direct descendant of 3a55452. Is it fine or need to change that?



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2927256352


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -8,7 +8,9 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
         <div class="ref-group">
           {{- range $footer.links }}
           <a class="ref-link waves-effect waves-light" href="{{ .href }}" target="_blank" rel="noopener">
-            <i class="material-icons" aria-hidden="true">{{ .icon }}</i>
+            <span class="icon-sr-only" aria-hidden="true">

Review Comment:
   why did you surround the `<i>` with a `<span>`?



##########
site-src/layouts/partials/home-footer.html:
##########
@@ -29,8 +31,16 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
 
       <div class="site-footer-legal center-align white-text">
         <p>
-          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation</a>.
-          Licensed under the <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">Apache License, Version 2.0</a>.
+          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">
+            Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation
+          </a>.
+          Licensed under the
+          <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">
+            Apache License, Version 2.0
+          </a>.
+          <a class="white-text" href="{{ $footer.privacy_url }}" target="_blank" rel="noopener">
+            Privacy Policy
+          </a>.

Review Comment:
   Why are you adding a link to the Privacy Policy? We already have one--this is not one of the failing whimsy checks



##########
site-src/layouts/partials/home-footer.html:
##########
@@ -29,8 +31,16 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
 
       <div class="site-footer-legal center-align white-text">
         <p>
-          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation</a>.
-          Licensed under the <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">Apache License, Version 2.0</a>.
+          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">
+            Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation
+          </a>.
+          Licensed under the
+          <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">
+            Apache License, Version 2.0
+          </a>.
+          <a class="white-text" href="{{ $footer.privacy_url }}" target="_blank" rel="noopener">

Review Comment:
   reformatting is great, but maybe do that in a separate PR. Here it's making it hard to see what actually changed



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on PR #56:
URL: https://github.com/apache/fineract-site/pull/56#issuecomment-4050010033

   > I will sign the commits.
   
   GPG/PGP sign, not SSH.


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2928845006


##########
site-src/layouts/partials/home-footer.html:
##########
@@ -29,8 +31,16 @@ <h3 class="white-text center-align">{{ $footer.reference_title }}</h3>
 
       <div class="site-footer-legal center-align white-text">
         <p>
-          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation</a>.
-          Licensed under the <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">Apache License, Version 2.0</a>.
+          <a class="white-text" href="{{ $footer.apache_url }}" target="_blank" rel="noopener">
+            Copyright &copy; {{ $footer.copyright_start }}&ndash;{{ now.Year }} The Apache Software Foundation
+          </a>.
+          Licensed under the
+          <a class="white-text" href="{{ $footer.license_url }}" target="_blank" rel="noopener">
+            Apache License, Version 2.0
+          </a>.
+          <a class="white-text" href="{{ $footer.privacy_url }}" target="_blank" rel="noopener">
+            Privacy Policy
+          </a>.

Review Comment:
   I've removed that change and narrowed the PR to License and Thanks only.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2962930947


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   that works, thanks! That seems like a decent compromise between testability and maintainability.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963447247


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   oh wait, there might be a bug/feature in Whimsy itself. :thinking: 
   
   Maybe the first `<span>` in the `<a>` is a problem?
   
   ```html
   <!-- I added some whitespace for readability -->
   <a class="ref-link waves-effect waves-light" href=https://www.apache.org/foundation/thanks.html target=_blank rel=noopener>
     <span class="material-icons icon-sr-only" aria-hidden=true>favorite</span>
     <span>Thanks</span>
   </a>
   ```
   
   Maybe the whimsy checks started failing after I merged #46 ...
   
   Anyway, thank you again for working on this. This is exactly why I want some check we can run on our own to try to know when our checks are failing before they fail on <https://whimsy.apache.org/site/project/fineract>!



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963447247


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   oh wait, there might be a bug/feature in Whimsy itself. :thinking: 
   
   Maybe the first `<span>` in the `<a>` is a problem?
   
   ```html
   <a class="ref-link waves-effect waves-light" href=https://www.apache.org/foundation/thanks.html target=_blank rel=noopener><span class="material-icons icon-sr-only" aria-hidden=true>favorite</span>
   <span>Thanks</span>
   </a>
   ```
   
   Maybe the whimsy checks started failing after I merged #46 ...
   
   Anyway, thank you again for working on this. This is exactly why I want some check we can run on our own to try to know when our checks are failing before they fail on <https://whimsy.apache.org/site/project/fineract>!



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963447247


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   oh wait, there might be a bug/feature in Whimsy itself. :facepalm:
   
   ```html
   <a class="ref-link waves-effect waves-light" href=https://www.apache.org/foundation/thanks.html target=_blank rel=noopener><span class="material-icons icon-sr-only" aria-hidden=true>favorite</span>
   <span>Thanks</span>
   </a>
   ```
   
   Maybe the whimsy checks started failing in a31ef7c723523dd7a181f3f44f777d042ac4ce50



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2932738542


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   hmm, it works, but now every time whimsy changes, we'll have to update `scripts/whimsy-check.py`. Why not just run the actual whimsy site checker Ruby script(s)? You can do all that within the Docker image/container without changing our dev process. Once whimsy and its dependencies are installed, run it in `run_checks()` in `scripts/site-tool.sh`.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys merged PR #56:
URL: https://github.com/apache/fineract-site/pull/56


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2926833584


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   @meonkeys I will update the README.md.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2927335696


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   How does one "verify the footer locally"? Do you mean visually? I would hope a dev would run whimsy instead. And if there's any way we can make that easier for them, we should. E.g. "before submitting your PR, do `docker run whimsy-checks`" or something like that.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2927335696


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   How does one "verify the footer locally"? Do you mean visually? I would hope a dev would run whimsy instead. And if there's any way we can make that easier for them, e.g. "before submitting your PR, do `docker run whimsy-checks`" or something like that.



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2937125745


##########
README.md:
##########
@@ -56,6 +56,21 @@ docker run --rm -v "${PWD}:/src" -w /src/site-src fineract-site build
 docker run --rm -it -p 1313:1313 -v "${PWD}:/src" -w /src/site-src fineract-site serve
 ```
 
+## Verifying ASF homepage footer checks locally
+
+Apache Whimsy validates that the public homepage includes specific ASF-required
+footer links and legal text. Before opening a PR, verify the footer locally.
+
+### Build and run checks
+```bash
+docker build -t fineract-site .
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site build
+docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src fineract-site check
+
+Serve the site locally
+
+docker run --rm -it -u "$(id -u):$(id -g)" -v "$PWD:/src" -w /src/site-src -p 1313:1313 fineract-site serve
+

Review Comment:
   I looked into using Whimsy directly as the dependency inside the Docker image, and I agree with the goal of avoiding a separately maintained local copy of the checks.
   
   I tried invoking Whimsy’s scanner directly, but the current entrypoint pulls in ASF-specific runtime dependencies and fails outside a fuller Whimsy/ASF environment (it expects  LDAP, the board checkout and committee data). Because of that, I don’t think we can use the scanner unmodified in this repo’s lightweight site image without bringing in a much larger runtime than the site build currently has.
   I have added a Ruby checker that mirrors Whimsy logic, I have kept Whimsy as the Docker dependency and add only a very small bit of code to call Whimsy’s current standards from within the existing site build flow, without reimplementing the checks ourselves as I did earlier in python script. 
   
   I have checked it in the local as shown below
   
   <img width="666" height="212" alt="Screenshot 2026-03-15 at 5 46 37 PM" src="https://github.com/user-attachments/assets/71b82b92-abde-46d3-8189-642974c33425" />
   
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963447247


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   oh wait, there might be a bug/feature in Whimsy itself. :facepalm:
   
   ```html
   <a class="ref-link waves-effect waves-light" href=https://www.apache.org/foundation/thanks.html target=_blank rel=noopener><span class="material-icons icon-sr-only" aria-hidden=true>favorite</span>
   <span>Thanks</span>
   </a>
   ```
   
   Maybe the whimsy checks started failing after I merged #45 



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "meonkeys (via GitHub)" <gi...@apache.org>.
meonkeys commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963447247


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   oh wait, there might be a bug/feature in Whimsy itself. :thinking: 
   
   Maybe the first `<span>` in the `<a>` is a problem?
   
   ```html
   <!-- I added some whitespace for readability -->
   <a class="ref-link waves-effect waves-light" href=https://www.apache.org/foundation/thanks.html target=_blank rel=noopener>
     <span class="material-icons icon-sr-only" aria-hidden=true>favorite</span>
     <span>Thanks</span>
   </a>
   ```
   
   Maybe the whimsy checks started failing after I merged #46 ...
   
   Anyway, thank you again for working on this. This is exactly why I want something we can run on our own to try to know when our checks are failing before they fail on <https://whimsy.apache.org/site/project/fineract>!



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2528: fix Whimsy footer checks and document local verification [fineract-site]

Posted by "mansi75 (via GitHub)" <gi...@apache.org>.
mansi75 commented on code in PR #56:
URL: https://github.com/apache/fineract-site/pull/56#discussion_r2963565530


##########
scripts/run_whimsy_checks.rb:
##########
@@ -0,0 +1,73 @@
+#!/usr/bin/env ruby
+# Extracted from https://github.com/apache/whimsy/blob/master/tools/site-scan.rb
+# Only includes site parsing logic - no ASF/LDAP/committee dependencies
+
+require 'net/http'
+require 'nokogiri'
+require 'uri'
+require 'json'
+
+# Copied directly from site-scan.rb
+def squash(text)
+  text.scrub.gsub(/[[:space:]]+/, ' ').strip
+end
+
+# Copied directly from site-scan.rb
+def get_link_text(anode)
+  bits = []
+  anode.traverse do |node|
+    if node.name == 'text'
+      bits << node.text unless node.parent.name == 'span' and
+        node.parent.attribute('class')&.value&.end_with?('sr-only')
+    end
+  end
+  squash(bits.join(' '))
+end
+
+# Copied from sitestandards.rb COMMON_CHECKS patterns
+CHECKS = {
+  'foundation'  => { url: /apache\.org/,                              text: nil },
+  'license'     => { url: /^https?:\/\/.*apache\.org\/licenses\/?$/,  text: /^license$/i },
+  'thanks'      => { url: nil, text: /^(thanks|sponsors|thanks to our sponsors)$/i },
+  'security'    => { url: nil, text: /^security$/i },
+  'sponsorship' => { url: nil, text: /^(sponsorship|sponsor|donate)$/i },
+  'privacy'     => { url: nil, text: /^privacy$/i },
+  'events'      => { url: /apache\.org\/events\/current-event/, text: nil },
+}

Review Comment:
   @meonkeys Thank you for the above valuable ideas
   
   I think License and Thanks are failing because of this
   
   <img width="1028" height="181" alt="Screenshot 2026-03-20 at 1 15 37 AM" src="https://github.com/user-attachments/assets/45beeb62-1f54-442a-9937-390342b191c2" />
   
   The root cause is in how whimsy's get_link_text() function in site-scan.rb reads link text. It collects all text nodes inside <a>, skipping only text whose parent is a <span> with a class ending in sr-only. The current index.html on asf-site was built from a template using <i> for the icon. 
   
   <img width="1184" height="94" alt="Screenshot 2026-03-20 at 1 32 17 AM" src="https://github.com/user-attachments/assets/598f9b73-e790-4e02-9723-0dc702d4cb8e" />
   
   "gavel"  parent is <i> so it is not skipped by whimsy and is collected. License's parent is plain <span> (no class) it is also not skipped and is collected.  Result is combined text and down cased  "gavel license",  whimsy checks "gavel license" =~ /^license$/, no match so red. Same happens for thanks as it turns into "favorite thanks". 
   
   In this PR I have fixed the template in home-footer.html by changing the icon from <i> to <span class="material-icons icon-sr-only">
   
   I will update the checks on run_whimsy_checks.rb, I think it is not working like the actual whimsy sitestandards.rb
   I will also work on the ideas you have given for unit test, new workflow and script update. It makes more sense to have them to avoid checks failing on https://whimsy.apache.org/site/project/fineract.
   
   



-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org