Bug 39190 - Rework new (S)FTP classes to be polymorphic classes
Summary: Rework new (S)FTP classes to be polymorphic classes
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 35761 39488
Blocks: 38115
  Show dependency treegraph
 
Reported: 2025-02-24 13:06 UTC by Martin Renvoize (ashimema)
Modified: 2025-06-05 12:37 UTC (History)
7 users (show)

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


Attachments
Bug 39190: Add $result to Koha::Objects `object_class` calls (2.31 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.20 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.61 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.70 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.09 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (1.99 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.19 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.69 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.47 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.60 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (24.75 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (2.94 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.69 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (764 bytes, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.89 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.10 KB, patch)
2025-02-24 13:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Skip polymorphic classes in TestBuilder tests (1.33 KB, patch)
2025-02-24 13:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add $result to Koha::Objects `object_class` calls (2.31 KB, patch)
2025-03-13 14:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.20 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.61 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.70 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.09 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (1.99 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.19 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.69 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.47 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.60 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (24.75 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (2.94 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.69 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (764 bytes, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.89 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.10 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Skip polymorphic classes in TestBuilder tests (1.33 KB, patch)
2025-03-13 14:36 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add $result to Koha::Objects `object_class` calls (2.31 KB, patch)
2025-03-17 15:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.20 KB, patch)
2025-03-17 15:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.61 KB, patch)
2025-03-17 15:20 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.70 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.09 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (1.99 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.19 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.69 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.47 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.60 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (24.75 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (2.94 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.69 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (764 bytes, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.89 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.10 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Use introspection in TestBuilder tests (4.93 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update polymorhpic base class to identify itself (1.76 KB, patch)
2025-03-17 15:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add $result to Koha::Objects `object_class` calls (2.38 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.27 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.68 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.77 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.16 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (2.06 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.26 KB, patch)
2025-03-21 13:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.76 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.54 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.67 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (24.82 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (3.01 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.75 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (835 bytes, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.96 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.17 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Use introspection in TestBuilder tests (5.00 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Update polymorhpic base class to identify itself (1.83 KB, patch)
2025-03-21 13:37 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 39190: Add $result to Koha::Objects `object_class` calls (2.37 KB, patch)
2025-03-24 15:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.25 KB, patch)
2025-03-24 15:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.66 KB, patch)
2025-03-24 15:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.76 KB, patch)
2025-03-24 15:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.14 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (2.04 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.24 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.18 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.52 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.65 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (24.81 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (3.00 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.74 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (819 bytes, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.94 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.16 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Use introspection in TestBuilder tests (4.99 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update polymorhpic base class to identify itself (1.81 KB, patch)
2025-03-24 15:58 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.67 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.66 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.76 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.14 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (2.04 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.24 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.18 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.52 KB, patch)
2025-03-31 12:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.65 KB, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (24.81 KB, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (3.00 KB, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.74 KB, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (819 bytes, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.94 KB, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.16 KB, patch)
2025-03-31 12:22 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update polymorhpic base class to identify itself (1.66 KB, patch)
2025-03-31 12:26 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Rework (S)FTP into File::Transport classes (28.67 KB, patch)
2025-03-31 12:26 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add key handling to SFTP Transports (7.66 KB, patch)
2025-03-31 12:26 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API to use new Transport classes (2.76 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update sftp_servers page to use new objects (4.14 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update status to longtext (2.04 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: DBIC Update (4.24 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Re-implement the connection testing (109.18 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update api tests for status format change (2.52 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Start of recording status updates from abort (1.65 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove old objects (25.49 KB, patch)
2025-03-31 12:27 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove test routine from API (3.00 KB, patch)
2025-03-31 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Remove replaced test_connection (4.74 KB, patch)
2025-03-31 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Redirect Schema to new classes (819 bytes, patch)
2025-03-31 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Update API's to reference new classes (1.94 KB, patch)
2025-03-31 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39190: Add transport to test (4.16 KB, patch)
2025-03-31 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2025-02-24 13:06:17 UTC
We add a new UI for managing (S)FTP servers with bug 35761.

We want to use these new configurations in other bugs, but the classes currently are just storage and don't offer the transport code.

This patchset updates the classes to implement transport methods utilising polymorphism.

We also clean up the API's a little to follow more RESTful best practices.
Comment 1 Martin Renvoize (ashimema) 2025-02-24 13:14:22 UTC
Created attachment 178555 [details] [review]
Bug 39190: Add $result to Koha::Objects `object_class` calls

This allows us to do dynamic polymorphic classing on calls to 'find',
'find_or_create', 'single', 'next', 'last' and 'as_list' etc.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 2 Martin Renvoize (ashimema) 2025-02-24 13:14:25 UTC
Created attachment 178556 [details] [review]
Bug 39190: Rework (S)FTP into File::Transport classes

This patch adds polymorphic transport classes to Koha for FTP and SFTP
file transport configurations.

We introduce a base class for interacting with the base configuration
storage and subclasses to impliment the protocol specific transport
handling.
Comment 3 Martin Renvoize (ashimema) 2025-02-24 13:14:27 UTC
Created attachment 178557 [details] [review]
Bug 39190: Add key handling to SFTP Transports

We add triggers to store in the base class and then use them in the SFTP
transport class to write out the key file to the filesystem for later
use in connect.
Comment 4 Martin Renvoize (ashimema) 2025-02-24 13:14:29 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize (ashimema) 2025-02-24 13:14:32 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 2025-02-24 13:14:34 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2025-02-24 13:14:36 UTC Comment hidden (obsolete)
Comment 8 Martin Renvoize (ashimema) 2025-02-24 13:14:39 UTC Comment hidden (obsolete)
Comment 9 Martin Renvoize (ashimema) 2025-02-24 13:14:42 UTC Comment hidden (obsolete)
Comment 10 Martin Renvoize (ashimema) 2025-02-24 13:14:44 UTC Comment hidden (obsolete)
Comment 11 Martin Renvoize (ashimema) 2025-02-24 13:14:47 UTC Comment hidden (obsolete)
Comment 12 Martin Renvoize (ashimema) 2025-02-24 13:14:49 UTC Comment hidden (obsolete)
Comment 13 Martin Renvoize (ashimema) 2025-02-24 13:14:51 UTC Comment hidden (obsolete)
Comment 14 Martin Renvoize (ashimema) 2025-02-24 13:14:54 UTC Comment hidden (obsolete)
Comment 15 Martin Renvoize (ashimema) 2025-02-24 13:14:56 UTC Comment hidden (obsolete)
Comment 16 Martin Renvoize (ashimema) 2025-02-24 13:14:58 UTC Comment hidden (obsolete)
Comment 17 Martin Renvoize (ashimema) 2025-02-24 13:15:01 UTC Comment hidden (obsolete)
Comment 18 Martin Renvoize (ashimema) 2025-03-13 14:35:58 UTC Comment hidden (obsolete)
Comment 19 Martin Renvoize (ashimema) 2025-03-13 14:36:02 UTC Comment hidden (obsolete)
Comment 20 Martin Renvoize (ashimema) 2025-03-13 14:36:04 UTC Comment hidden (obsolete)
Comment 21 Martin Renvoize (ashimema) 2025-03-13 14:36:06 UTC Comment hidden (obsolete)
Comment 22 Martin Renvoize (ashimema) 2025-03-13 14:36:09 UTC Comment hidden (obsolete)
Comment 23 Martin Renvoize (ashimema) 2025-03-13 14:36:11 UTC Comment hidden (obsolete)
Comment 24 Martin Renvoize (ashimema) 2025-03-13 14:36:14 UTC Comment hidden (obsolete)
Comment 25 Martin Renvoize (ashimema) 2025-03-13 14:36:17 UTC Comment hidden (obsolete)
Comment 26 Martin Renvoize (ashimema) 2025-03-13 14:36:20 UTC Comment hidden (obsolete)
Comment 27 Martin Renvoize (ashimema) 2025-03-13 14:36:22 UTC Comment hidden (obsolete)
Comment 28 Martin Renvoize (ashimema) 2025-03-13 14:36:25 UTC Comment hidden (obsolete)
Comment 29 Martin Renvoize (ashimema) 2025-03-13 14:36:28 UTC Comment hidden (obsolete)
Comment 30 Martin Renvoize (ashimema) 2025-03-13 14:36:31 UTC Comment hidden (obsolete)
Comment 31 Martin Renvoize (ashimema) 2025-03-13 14:36:33 UTC Comment hidden (obsolete)
Comment 32 Martin Renvoize (ashimema) 2025-03-13 14:36:36 UTC Comment hidden (obsolete)
Comment 33 Martin Renvoize (ashimema) 2025-03-13 14:36:38 UTC Comment hidden (obsolete)
Comment 34 Martin Renvoize (ashimema) 2025-03-13 14:36:41 UTC Comment hidden (obsolete)
Comment 35 Kyle M Hall (khall) 2025-03-17 11:40:25 UTC
Getting at least one unit test failure:

kohadev-koha@kohadevbox:koha((63831c2dd5e...))$ prove t/db_dependent/TestBuilder.t
t/db_dependent/TestBuilder.t .. 3/16
        #   Failed test 'Testing Koha::File::Transports'
        #   at t/db_dependent/TestBuilder.t line 495.
        #          got: 'Koha::File::Transport::FTP'
        #     expected: 'Koha::File::Transport'
        # Looks like you failed 1 test of 1032.

    #   Failed test 'Test all classes'
    #   at t/db_dependent/TestBuilder.t line 515.
    # Looks like you failed 1 test of 5.
t/db_dependent/TestBuilder.t .. 12/16
#   Failed test 'build_object() tests'
#   at t/db_dependent/TestBuilder.t line 535.
# Looks like you failed 1 test of 16.
t/db_dependent/TestBuilder.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/16 subtests

Test Summary Report
-------------------
t/db_dependent/TestBuilder.t (Wstat: 256 (exited 1) Tests: 16 Failed: 1)
  Failed test:  12
  Non-zero exit status: 1
Files=1, Tests=16, 26 wallclock secs ( 0.03 usr  0.01 sys + 20.08 cusr  4.58 csys = 24.70 CPU)
Result: FAIL
Comment 36 Martin Renvoize (ashimema) 2025-03-17 15:20:50 UTC Comment hidden (obsolete)
Comment 37 Martin Renvoize (ashimema) 2025-03-17 15:20:53 UTC Comment hidden (obsolete)
Comment 38 Martin Renvoize (ashimema) 2025-03-17 15:20:56 UTC Comment hidden (obsolete)
Comment 39 Martin Renvoize (ashimema) 2025-03-17 15:21:00 UTC Comment hidden (obsolete)
Comment 40 Martin Renvoize (ashimema) 2025-03-17 15:21:03 UTC Comment hidden (obsolete)
Comment 41 Martin Renvoize (ashimema) 2025-03-17 15:21:06 UTC Comment hidden (obsolete)
Comment 42 Martin Renvoize (ashimema) 2025-03-17 15:21:09 UTC Comment hidden (obsolete)
Comment 43 Martin Renvoize (ashimema) 2025-03-17 15:21:13 UTC Comment hidden (obsolete)
Comment 44 Martin Renvoize (ashimema) 2025-03-17 15:21:16 UTC Comment hidden (obsolete)
Comment 45 Martin Renvoize (ashimema) 2025-03-17 15:21:19 UTC Comment hidden (obsolete)
Comment 46 Martin Renvoize (ashimema) 2025-03-17 15:21:22 UTC Comment hidden (obsolete)
Comment 47 Martin Renvoize (ashimema) 2025-03-17 15:21:25 UTC Comment hidden (obsolete)
Comment 48 Martin Renvoize (ashimema) 2025-03-17 15:21:29 UTC Comment hidden (obsolete)
Comment 49 Martin Renvoize (ashimema) 2025-03-17 15:21:33 UTC Comment hidden (obsolete)
Comment 50 Martin Renvoize (ashimema) 2025-03-17 15:21:36 UTC Comment hidden (obsolete)
Comment 51 Martin Renvoize (ashimema) 2025-03-17 15:21:39 UTC Comment hidden (obsolete)
Comment 52 Martin Renvoize (ashimema) 2025-03-17 15:21:42 UTC
Created attachment 179412 [details] [review]
Bug 39190: Use introspection in TestBuilder tests

We update the testbuilder tests here to look for signs of a polymorphic
class map and use it to test the different class options for this base
class
Comment 53 Martin Renvoize (ashimema) 2025-03-17 15:21:45 UTC
Created attachment 179413 [details] [review]
Bug 39190: Update polymorhpic base class to identify itself

This patch adds _polymorphic_field and _polymorphic_map private methods
to the Koha::File::Transports class to more clearly identify this as a
polymorphic class base for TestBuilder.
Comment 54 Kyle M Hall (khall) 2025-03-21 13:36:37 UTC Comment hidden (obsolete)
Comment 55 Kyle M Hall (khall) 2025-03-21 13:36:45 UTC Comment hidden (obsolete)
Comment 56 Kyle M Hall (khall) 2025-03-21 13:36:47 UTC Comment hidden (obsolete)
Comment 57 Kyle M Hall (khall) 2025-03-21 13:36:50 UTC Comment hidden (obsolete)
Comment 58 Kyle M Hall (khall) 2025-03-21 13:36:52 UTC Comment hidden (obsolete)
Comment 59 Kyle M Hall (khall) 2025-03-21 13:36:55 UTC Comment hidden (obsolete)
Comment 60 Kyle M Hall (khall) 2025-03-21 13:36:58 UTC Comment hidden (obsolete)
Comment 61 Kyle M Hall (khall) 2025-03-21 13:37:01 UTC Comment hidden (obsolete)
Comment 62 Kyle M Hall (khall) 2025-03-21 13:37:03 UTC Comment hidden (obsolete)
Comment 63 Kyle M Hall (khall) 2025-03-21 13:37:06 UTC Comment hidden (obsolete)
Comment 64 Kyle M Hall (khall) 2025-03-21 13:37:09 UTC Comment hidden (obsolete)
Comment 65 Kyle M Hall (khall) 2025-03-21 13:37:11 UTC Comment hidden (obsolete)
Comment 66 Kyle M Hall (khall) 2025-03-21 13:37:14 UTC Comment hidden (obsolete)
Comment 67 Kyle M Hall (khall) 2025-03-21 13:37:18 UTC Comment hidden (obsolete)
Comment 68 Kyle M Hall (khall) 2025-03-21 13:37:21 UTC Comment hidden (obsolete)
Comment 69 Kyle M Hall (khall) 2025-03-21 13:37:23 UTC Comment hidden (obsolete)
Comment 70 Kyle M Hall (khall) 2025-03-21 13:37:26 UTC Comment hidden (obsolete)
Comment 71 Kyle M Hall (khall) 2025-03-21 13:37:29 UTC Comment hidden (obsolete)
Comment 72 Kyle M Hall (khall) 2025-03-21 13:54:02 UTC
Transport is listed twice in the form for sftp_servers.pl
Comment 73 Martin Renvoize (ashimema) 2025-03-24 15:57:46 UTC Comment hidden (obsolete)
Comment 74 Martin Renvoize (ashimema) 2025-03-24 15:57:49 UTC Comment hidden (obsolete)
Comment 75 Martin Renvoize (ashimema) 2025-03-24 15:57:53 UTC Comment hidden (obsolete)
Comment 76 Martin Renvoize (ashimema) 2025-03-24 15:57:56 UTC Comment hidden (obsolete)
Comment 77 Martin Renvoize (ashimema) 2025-03-24 15:58:00 UTC Comment hidden (obsolete)
Comment 78 Martin Renvoize (ashimema) 2025-03-24 15:58:03 UTC Comment hidden (obsolete)
Comment 79 Martin Renvoize (ashimema) 2025-03-24 15:58:06 UTC Comment hidden (obsolete)
Comment 80 Martin Renvoize (ashimema) 2025-03-24 15:58:10 UTC Comment hidden (obsolete)
Comment 81 Martin Renvoize (ashimema) 2025-03-24 15:58:13 UTC Comment hidden (obsolete)
Comment 82 Martin Renvoize (ashimema) 2025-03-24 15:58:16 UTC Comment hidden (obsolete)
Comment 83 Martin Renvoize (ashimema) 2025-03-24 15:58:19 UTC Comment hidden (obsolete)
Comment 84 Martin Renvoize (ashimema) 2025-03-24 15:58:22 UTC Comment hidden (obsolete)
Comment 85 Martin Renvoize (ashimema) 2025-03-24 15:58:25 UTC Comment hidden (obsolete)
Comment 86 Martin Renvoize (ashimema) 2025-03-24 15:58:28 UTC Comment hidden (obsolete)
Comment 87 Martin Renvoize (ashimema) 2025-03-24 15:58:31 UTC Comment hidden (obsolete)
Comment 88 Martin Renvoize (ashimema) 2025-03-24 15:58:35 UTC Comment hidden (obsolete)
Comment 89 Martin Renvoize (ashimema) 2025-03-24 15:58:39 UTC Comment hidden (obsolete)
Comment 90 Martin Renvoize (ashimema) 2025-03-24 15:58:42 UTC Comment hidden (obsolete)
Comment 91 Martin Renvoize (ashimema) 2025-03-24 16:00:00 UTC
(In reply to Kyle M Hall (khall) from comment #72)
> Transport is listed twice in the form for sftp_servers.pl

Well spotted, fixed inline now :)

Thanks for reviewing
Comment 92 Martin Renvoize (ashimema) 2025-03-31 12:21:19 UTC
Created attachment 179992 [details] [review]
Bug 39190: Rework (S)FTP into File::Transport classes

This patch adds polymorphic transport classes to Koha for FTP and SFTP
file transport configurations.

We introduce a base class for interacting with the base configuration
storage and subclasses to impliment the protocol specific transport
handling.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 93 Martin Renvoize (ashimema) 2025-03-31 12:21:23 UTC
Created attachment 179993 [details] [review]
Bug 39190: Add key handling to SFTP Transports

We add triggers to store in the base class and then use them in the SFTP
transport class to write out the key file to the filesystem for later
use in connect.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 94 Martin Renvoize (ashimema) 2025-03-31 12:21:26 UTC
Created attachment 179994 [details] [review]
Bug 39190: Update API to use new Transport classes

As the title says, use the new polymorphic classes in the API
controllers

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 95 Martin Renvoize (ashimema) 2025-03-31 12:21:32 UTC
Created attachment 179995 [details] [review]
Bug 39190: Update sftp_servers page to use new objects

Similar to the previous commit, this time we're updating the page
controller to use the new polymorphic classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 96 Martin Renvoize (ashimema) 2025-03-31 12:21:36 UTC
Created attachment 179996 [details] [review]
Bug 39190: Update status to longtext

Update status field to store longtext so we can sore more details
information about connection statuses from test connection

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 97 Martin Renvoize (ashimema) 2025-03-31 12:21:40 UTC
Created attachment 179997 [details] [review]
Bug 39190: DBIC Update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 98 Martin Renvoize (ashimema) 2025-03-31 12:21:46 UTC
Created attachment 179998 [details] [review]
Bug 39190: Re-implement the connection testing

We now use background jobs triggered by Transport->store to update the
connection status.

Status is now a json blob with more details, so we update the api
definition to reflect that.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 99 Martin Renvoize (ashimema) 2025-03-31 12:21:52 UTC
Created attachment 179999 [details] [review]
Bug 39190: Update api tests for status format change

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 100 Martin Renvoize (ashimema) 2025-03-31 12:22:00 UTC
Created attachment 180000 [details] [review]
Bug 39190: Start of recording status updates from abort

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 101 Martin Renvoize (ashimema) 2025-03-31 12:22:09 UTC
Created attachment 180001 [details] [review]
Bug 39190: Remove old objects

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 102 Martin Renvoize (ashimema) 2025-03-31 12:22:19 UTC
Created attachment 180002 [details] [review]
Bug 39190: Remove test routine from API

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 103 Martin Renvoize (ashimema) 2025-03-31 12:22:28 UTC
Created attachment 180003 [details] [review]
Bug 39190: Remove replaced test_connection

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 104 Martin Renvoize (ashimema) 2025-03-31 12:22:36 UTC
Created attachment 180004 [details] [review]
Bug 39190: Redirect Schema to new classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 105 Martin Renvoize (ashimema) 2025-03-31 12:22:46 UTC
Created attachment 180005 [details] [review]
Bug 39190: Update API's to reference new classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 106 Martin Renvoize (ashimema) 2025-03-31 12:22:49 UTC
Created attachment 180006 [details] [review]
Bug 39190: Add transport to test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 107 Martin Renvoize (ashimema) 2025-03-31 12:26:49 UTC
Created attachment 180010 [details] [review]
Bug 39190: Update polymorhpic base class to identify itself

This patch adds _polymorphic_field and _polymorphic_map private methods
to the Koha::File::Transports class to more clearly identify this as a
polymorphic class base for TestBuilder.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 108 Martin Renvoize (ashimema) 2025-03-31 12:26:54 UTC
Created attachment 180011 [details] [review]
Bug 39190: Rework (S)FTP into File::Transport classes

This patch adds polymorphic transport classes to Koha for FTP and SFTP
file transport configurations.

We introduce a base class for interacting with the base configuration
storage and subclasses to impliment the protocol specific transport
handling.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 109 Martin Renvoize (ashimema) 2025-03-31 12:26:59 UTC
Created attachment 180012 [details] [review]
Bug 39190: Add key handling to SFTP Transports

We add triggers to store in the base class and then use them in the SFTP
transport class to write out the key file to the filesystem for later
use in connect.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 110 Martin Renvoize (ashimema) 2025-03-31 12:27:03 UTC
Created attachment 180013 [details] [review]
Bug 39190: Update API to use new Transport classes

As the title says, use the new polymorphic classes in the API
controllers

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 111 Martin Renvoize (ashimema) 2025-03-31 12:27:07 UTC
Created attachment 180014 [details] [review]
Bug 39190: Update sftp_servers page to use new objects

Similar to the previous commit, this time we're updating the page
controller to use the new polymorphic classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 112 Martin Renvoize (ashimema) 2025-03-31 12:27:15 UTC
Created attachment 180015 [details] [review]
Bug 39190: Update status to longtext

Update status field to store longtext so we can sore more details
information about connection statuses from test connection

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 113 Martin Renvoize (ashimema) 2025-03-31 12:27:23 UTC
Created attachment 180016 [details] [review]
Bug 39190: DBIC Update

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 114 Martin Renvoize (ashimema) 2025-03-31 12:27:32 UTC
Created attachment 180017 [details] [review]
Bug 39190: Re-implement the connection testing

We now use background jobs triggered by Transport->store to update the
connection status.

Status is now a json blob with more details, so we update the api
definition to reflect that.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 115 Martin Renvoize (ashimema) 2025-03-31 12:27:41 UTC
Created attachment 180018 [details] [review]
Bug 39190: Update api tests for status format change

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 116 Martin Renvoize (ashimema) 2025-03-31 12:27:44 UTC
Created attachment 180019 [details] [review]
Bug 39190: Start of recording status updates from abort

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 117 Martin Renvoize (ashimema) 2025-03-31 12:27:54 UTC
Created attachment 180020 [details] [review]
Bug 39190: Remove old objects

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 118 Martin Renvoize (ashimema) 2025-03-31 12:28:02 UTC
Created attachment 180021 [details] [review]
Bug 39190: Remove test routine from API

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 119 Martin Renvoize (ashimema) 2025-03-31 12:28:09 UTC
Created attachment 180022 [details] [review]
Bug 39190: Remove replaced test_connection

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 120 Martin Renvoize (ashimema) 2025-03-31 12:28:16 UTC
Created attachment 180023 [details] [review]
Bug 39190: Redirect Schema to new classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 121 Martin Renvoize (ashimema) 2025-03-31 12:28:24 UTC
Created attachment 180024 [details] [review]
Bug 39190: Update API's to reference new classes

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 122 Martin Renvoize (ashimema) 2025-03-31 12:28:33 UTC
Created attachment 180025 [details] [review]
Bug 39190: Add transport to test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 123 Julian Maurice 2025-04-18 11:47:42 UTC
I think that polymorphism (at the Koha::Object level) is not the best solution here. I think the problem is that Koha::File::Transport tries to be many things at once: it is a database entity and a file transporter. Those are two very different things.

We could have Koha::File::Transport::FTP and Koha::File::Transport::SFTP as non-Koha::Object and have (for instance) a Koha::File::Transport::transporter method that returns the correct object depending on the value of transport column.
Would that work ?