Bug 19512 - Koha::File - wrapper/utility routines for file handling
Summary: Koha::File - wrapper/utility routines for file handling
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 19515
  Show dependency treegraph
 
Reported: 2017-10-23 11:12 UTC by Olli-Antti Kivilahti
Modified: 2017-10-23 23:28 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19512 - Koha::File - wrapper/utility routines for file handling (6.60 KB, patch)
2017-10-23 11:14 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 19512 - Koha::File - wrapper/utility routines for file handling (6.65 KB, patch)
2017-10-23 23:26 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 19512: silence noise when KOHA_PATH undefined. (2.00 KB, patch)
2017-10-23 23:26 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 19512: Make pass koha qa test tools (4.54 KB, patch)
2017-10-23 23:26 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.