Bug 19512

Summary: Koha::File - wrapper/utility routines for file handling
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: josef.moravec, mtompset
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19515
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 19515    
Attachments: Bug 19512 - Koha::File - wrapper/utility routines for file handling
Bug 19512 - Koha::File - wrapper/utility routines for file handling
Bug 19512: silence noise when KOHA_PATH undefined.
Bug 19512: Make pass koha qa test tools

Description Olli-Antti Kivilahti 2017-10-23 11:12:06 UTC
Subroutines specific to dealing with files.

Maybe some day evolve to a true wrapper for all file operations.
Comment 1 Olli-Antti Kivilahti 2017-10-23 11:14:53 UTC
Created attachment 68384 [details] [review]
Bug 19512 - Koha::File - wrapper/utility routines for file handling

Add getDiagnostics()
usable by Exceptions to gather more information about a file and why accessing
it failed.
Comment 2 Josef Moravec 2017-10-23 21:58:38 UTC
Olle, 

first I have to say I like the idea of file wrapper, I've tried to test this but:

test Koha/File.t is not passing for me
Both test warn:

Use of uninitialized value $ENV{"KOHA_PATH"} in concatenation (.) or string

koha qa tools has also some complains:

 FAIL	Koha/Exceptions/File.pm
   FAIL	  pod
		=head2 without preceding higher level
		*** WARNING: 
		 
		 in file Koha/Exceptions/File.pm
   FAIL	  pod coverage
		POD is missing for Fields
		POD is missing for description
		POD is missing for path
		POD is missing for stat

 FAIL	Koha/File.pm
   FAIL	  critic
		"return" statement with explicit "undef" at line 36, column 5. See page 199 of PBP.
   FAIL	  pod coverage
		POD is missing for 'getDiagnosticsString'

 FAIL	t/Koha/Exceptions/File.t
   FAIL	  spelling
		 throughly  ==> thoroughly

 FAIL	t/Koha/File.t
   FAIL	  critic
		Integer with leading zeros: "07777" at line 20, column 50. See page 58 of PBP.
Comment 3 Mark Tompsett 2017-10-23 23:26:43 UTC
Created attachment 68452 [details] [review]
Bug 19512 - Koha::File - wrapper/utility routines for file handling

Add getDiagnostics()
usable by Exceptions to gather more information about a file and why accessing
it failed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Mark Tompsett 2017-10-23 23:26:45 UTC
Created attachment 68453 [details] [review]
Bug 19512: silence noise when KOHA_PATH undefined.

If you run the tests with KOHA_PATH unset, this bombs.
Apply the patch, and it copes by guessing the current
directory.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 5 Mark Tompsett 2017-10-23 23:26:48 UTC
Created attachment 68454 [details] [review]
Bug 19512: Make pass koha qa test tools

Can't seem to get the pod coverage correct for one file.
This fixes the others.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 6 Mark Tompsett 2017-10-23 23:28:11 UTC
(In reply to Josef Moravec from comment #2)
>    FAIL	  pod coverage
> 		POD is missing for Fields
> 		POD is missing for description
> 		POD is missing for path
> 		POD is missing for stat

Still Failed QA because of this. But I can't figure out where these subs are defined. It makes no sense.