Bug 40419

Summary: xt/find-license-problems.t isn't catching all instances of 51 Franklin St/Street
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Test SuiteAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to stable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02
Circulation function:
Bug Depends on: 40402    
Bug Blocks:    
Attachments: Bug 40419: Remove check for Copyright line
Bug 40419: Skip testing-related templates
Bug 40419: Fix wrong license
Bug 40419: Changes to testing logic
Bug 40419: Fix wrong license
Bug 40419: Changes to testing logic
Bug 40419: Fix wrong license

Description Lucas Gass (lukeg) 2025-07-16 16:54:36 UTC
kohadev-koha@kohadevbox:koha(main)$ git grep '51 Franklin St'
Koha/Course.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Course/Instructor.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Course/Instructors.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Course/Item.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Course/Items.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Course/Reserve.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Course/Reserves.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Courses.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/Exceptions/MarcOverlayRule.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Koha/REST/V1/CirculationRules.pm:# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
etc/zebradb/authorities/etc/dom-config-marc.xml:Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, 
etc/zebradb/authorities/etc/dom-config.xml:Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, 
etc/zebradb/biblios/etc/dom-config-marc.xml:Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
etc/zebradb/biblios/etc/dom-config.xml:Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
etc/zebradb/xsl/zebra.xsl:Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, 
koha-tmpl/intranet-tmpl/lib/greybox/GreyBox_v5_5/LGPL.txt:     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
koha-tmpl/intranet-tmpl/lib/greybox/GreyBox_v5_5/LGPL.txt:    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
koha-tmpl/intranet-tmpl/lib/tiny_mce/license.txt: 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
koha-tmpl/intranet-tmpl/lib/tiny_mce/license.txt:    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
koha-tmpl/opac-tmpl/lib/greybox/GreyBox_v5_5/LGPL.txt:     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
koha-tmpl/opac-tmpl/lib/greybox/GreyBox_v5_5/LGPL.txt:    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
xt/find-license-problems.t:        $hasfranklinst    = 1 if ( $line =~ /51 Franklin Street/ );



Two things here: 
1. Sometimes it is 51 Franklin St and other times '51 Franklin Street'

2. Some of these are passing because they do do not contain the string 'Copyright'. 


We should probably catch all of these instances?
Comment 1 Tomás Cohen Arazi (tcohen) 2025-07-16 18:14:00 UTC
Created attachment 184164 [details] [review]
Bug 40419: Remove check for Copyright line

The Copyright line should not be mandatory. And if missing, is not a
reason to skip the GPL-related checks anyway.

This 'fix' will highlight existing errors that were skipped until now.

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/find-license-problems.t
=> FAIL: Tests pass! Some files should make them fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests fail!
Comment 2 Tomás Cohen Arazi (tcohen) 2025-07-16 18:14:03 UTC
Created attachment 184165 [details] [review]
Bug 40419: Skip testing-related templates
Comment 3 Tomás Cohen Arazi (tcohen) 2025-07-16 18:14:05 UTC
Created attachment 184166 [details] [review]
Bug 40419: Fix wrong license
Comment 4 Jonathan Druart 2025-07-16 19:01:15 UTC
The correct fix is on bug 40402, I told you on mattermost ;-)

*** This bug has been marked as a duplicate of bug 40402 ***
Comment 5 Jonathan Druart 2025-07-16 19:03:18 UTC
Or maybe it's actually related and not duplicated. But bug 40402 is going to fix Jenkins the correct way. If we need more it should be written on top of it.
Comment 6 Tomás Cohen Arazi (tcohen) 2025-07-16 20:29:23 UTC
Created attachment 184175 [details] [review]
Bug 40419: Changes to testing logic

This patch makes a couple changes to the tests:

* Remove check for Copyright line. The Copyright line should not be mandatory.
* Remove dependency of GPL-related checks on the copyrigth line
  existence. (this highlights several missed checks).
* Skip testing-related templates. Koha ships some templates that are not
  excluded correctly.

This 'fix' will highlight existing errors that were skipped until now.

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/find-license-problems.t
=> FAIL: Tests pass! Some files should make them fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests fail!
Comment 7 Tomás Cohen Arazi (tcohen) 2025-07-16 20:29:26 UTC
Created attachment 184176 [details] [review]
Bug 40419: Fix wrong license
Comment 8 Tomás Cohen Arazi (tcohen) 2025-07-16 20:35:43 UTC
Lucas:

* I think errors in the external libs we include should better be reported upstream. `koha-tmpl/` is explicitly excluded so I wouldn't care.
* I don't think the Copyright line check makes sense. Right now it is only being used to skip the GPL check which is incorrect.
Comment 9 Tomás Cohen Arazi (tcohen) 2025-07-16 20:37:57 UTC
... I mistakenly submitted before finishing.

That's why I propose to remove the copyright line check. Nice catch!
I believe I covered them all.
Comment 10 Jonathan Druart 2025-07-17 07:19:10 UTC
Created attachment 184182 [details] [review]
Bug 40419: Changes to testing logic

This patch makes a couple changes to the tests:

* Remove check for Copyright line. The Copyright line should not be mandatory.
* Remove dependency of GPL-related checks on the copyrigth line
  existence. (this highlights several missed checks).
* Skip testing-related templates. Koha ships some templates that are not
  excluded correctly.

This 'fix' will highlight existing errors that were skipped until now.

To test:
1. Run:
   $ ktd --shell
  k$ prove xt/find-license-problems.t
=> FAIL: Tests pass! Some files should make them fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests fail!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2025-07-17 07:19:12 UTC
Created attachment 184183 [details] [review]
Bug 40419: Fix wrong license

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Lucas Gass (lukeg) 2025-07-18 17:13:00 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 13 Paul Derscheid 2025-07-24 08:21:43 UTC
Nice work everyone!

Pushed to 25.05.x