[Bug 25078] New: Stop updatedatabase.pl when a database change cannot be applied

classic Classic list List threaded Threaded
78 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] New: Stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

            Bug ID: 25078
           Summary: Stop updatedatabase.pl when a database change cannot
                    be applied
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Installation and upgrade (web-based installer)
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
                CC: [hidden email]

In order to maintain database schema consistency between installations running
the same Koha version, we must not either conditionally apply or skip a schema
alteration.

See previous discussion
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22887#c15

Discuss how updatedatabase.pl and the GUI (and install.pl) should work when we
want to stop a problematic database update and leave room for sysadmin to fix
it.

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Lari Taskula <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |In Discussion

--- Comment #1 from Lari Taskula <[hidden email]> ---
I start from where we left off at Bug 22887 comment 28.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22887#c28

(In reply to Jonathan Druart from comment #28)
> It is what we are doing for years.

I can find only one occurrence that conditionally either alters the schema or
not, and leaves the admin with only a warning. And that was 12 days ago by Bug
18177.

> Dying in the updatedatabase.pl will require more work than just adding a die
> statement. We need to handle the error, propagate it to the UI. The way it's
> done so far will make the change not trivial.

I tested updating via the GUI with a die() and it seems to display it well.

Also we do already have a die() statement in a database update, although a very
old one - but I'm not sure whether Koha handled it better then. I doubt it.

I'll add an attachment for you to see how it looks.

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #2 from Lari Taskula <[hidden email]> ---
Created attachment 102521
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102521&action=edit
How update in the GUI looks when a die() is given

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Lari Taskula <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.koha-community
                   |                            |.org/bugzilla3/show_bug.cgi
                   |                            |?id=22887

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Lari Taskula <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Stop updatedatabase.pl when |Gracefully stop
                   |a database change cannot be |updatedatabase.pl when a
                   |applied                     |database change cannot be
                   |                            |applied

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]-c
                   |                            |ommunity.org

--- Comment #3 from Jonathan Druart <[hidden email]> ---
(In reply to Lari Taskula from comment #1)
> I start from where we left off at Bug 22887 comment 28.
> https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22887#c28
>
> (In reply to Jonathan Druart from comment #28)
> > It is what we are doing for years.
>
> I can find only one occurrence that conditionally either alters the schema
> or not, and leaves the admin with only a warning. And that was 12 days ago
> by Bug 18177.

Yes, that is what I meant, we usually do not deal with errors. We drop the
column (with data or not), we add the FK without checking if it will be created
or not.

What is needed here is to surround each of our entry with an eval and catch any
errors raised by the DBMS. If there is an error, we stop the update process and
raise the error to the interface/script, waiting for the situation to be
unblocked.

On the other hand I can imagine that one could want to get all the errors at
once, and deal with them in one go. That's the behavior what I would like to
get if I had to deal with upgrade process. In that case I imagine a switch
would be needed.

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #4 from Jonathan Druart <[hidden email]> ---
Here are some occurrences where we drop a message and continue the update
process.

 7285         print "Upgrade to $DBversion done (Bug 10636 - patronimage should
have borrowernumber as PK, not cardnumber) failed! Transaction aborted because
$@\n";
 7286         eval { $dbh->rollback };

 8057             print "Upgrade to $DBversion failed (Bug 7372: Move road
types from the roadtype table to the ROADTYPE authorised values.\nTransaction
aborted because $@\n)";
 8058             $dbh->rollback;


17027             warn "Upgrade to $DBversion failed: $@\n";

11100         print "Upgrade to $DBversion done (Bug 10020: This database
contains data related to 'ethnicity'. No change will be done on the DB
structure but note that the Koha codebase does not use it)\n";

12596         print "WARNING: You have corrupted data in your items table!! The
table contains $cnt references to biblio records that do not exist.\nPlease
correct your data IMMEDIATELY after this upgrade and ma      nually add the
foreign key constraint for biblionumber in the items table.\n";

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #5 from Lari Taskula <[hidden email]> ---
(In reply to Jonathan Druart from comment #4)
> Here are some occurrences where we drop a message and continue the update
> process.
> ...

Ah you're right, I only went through warn statements.

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #6 from Lari Taskula <[hidden email]> ---
(In reply to Jonathan Druart from comment #3)
> On the other hand I can imagine that one could want to get all the errors at
> once, and deal with them in one go. That's the behavior what I would like to
> get if I had to deal with upgrade process. In that case I imagine a switch
> would be needed.
Do you mean executing all the db updates and gather errors from all of them? If
an error occurs we should stop immediately in order to avoid the next steps
potentially causing damage to the database.

I like the idea of exception handling for db updates, but this seems like a big
change to the installer considering it already sort of works the way it is as
shown in the screenshot.

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase.pl when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #7 from Lari Taskula <[hidden email]> ---
(In reply to Lari Taskula from comment #6)
> I like the idea of exception handling for db updates, but this seems like a
> big change to the installer considering it already sort of works the way it
> is as shown in the screenshot.
Of course, if we have the resources for it, I think it's a great idea!

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Lari Taskula <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Gracefully stop             |Gracefully stop
                   |updatedatabase.pl when a    |updatedatabase/installer
                   |database change cannot be   |when a database change
                   |applied                     |cannot be applied

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Lari Taskula <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.koha-community
                   |                            |.org/bugzilla3/show_bug.cgi
                   |                            |?id=24131

--- Comment #8 from Jonathan Druart <[hidden email]> ---
How it works so far: from the IU, the updatedatabase.pl is called, the outputs
redirected to tmp files, reopened and displayed. That's ugly and does not let
us much flexibility.

I would like to rewrite it and have 2 scripts, the command line script, then
the UI script. Both would call a method for each update step. So we could
retrieve the outputs, exceptions or whatever we want easily.

As I said I would prefer to have the whole thing ran in one go. And you don't:)
That only means we need a switch that would be easy to implement if things are
correctly written.

I am happy to collect any ideas you have to improve the update process. I will
try and work on that during the next dev cycle.

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Martin Renvoize <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugs.koha-community
                   |                            |.org/bugzilla3/show_bug.cgi
                   |                            |?id=18050
                 CC|                            |martin.renvoize@ptfs-europe
                   |                            |.com

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Tomás Cohen Arazi <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #9 from Tomás Cohen Arazi <[hidden email]> ---
It should definitely stop when an error is found. Each DBRev should be run
inside a transaction as well.
And it should report meaningful things :-D

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Agustín Moyano <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #10 from Agustín Moyano <[hidden email]> ---
I agree there should be a consistent way to stop the upgrade process, and
specially one that will allow to resume from the place it broke, but I think we
should try to stop the upgrade process as little as possible..

meaning that for example if we add a FK on a nullable column, and there are
some values that don't exists in the foreign table, instead of killing the
process, we can copy the offending rows to some table we create, set the column
to null, add the restriction and raise a warning..

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #11 from Agustín Moyano <[hidden email]> ---
A question, can we have upgrade tests?..

I mean, a way to set some tables in a certain condition, execute the upgrade
process and check the results all within a single transaction to rollback?

Is it possible?

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #12 from Jonathan Druart <[hidden email]> ---
Created attachment 116032
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116032&action=edit
Bug 25078: [POC] Lazy version

This is the lazy, quick and dirty, version.
We use a try catch block and execute the db entry in a transaction.
When I error is found, we stop.

The main problem is that we cannot do anything with the raw output in
the template.

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #13 from Jonathan Druart <[hidden email]> ---
Created attachment 116033
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116033&action=edit
Bug 25078: [POC] Put the db entries in a structure to handle them better

If we have have a hashref (ideally in a module!) we could have do
something more powerful and deal correctly with them.

More work is needed:
- The "export" of the $db_entries hashref from updatedatabase.pl is
really dirty, we don't want to do that
- We should not need to eval { require $updatedatabase_path } from .pm,
but retrieve it from another pm

The main problems with this approach is:
1. Someone will have to move all(?) the entries into the new
structure/file
2. Habit will change, updatedatabase.pl will become a 10 lines script
that will loop over the db entries and display the output

In my opinion it's what we want.

Don't be afraid by the diff size, most of the changes is a move of the
subroutine from updatedatabase.pl to C4/Installer.pm

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[hidden email]-commun |[hidden email]-c
                   |ity.org                     |ommunity.org

--- Comment #14 from Jonathan Druart <[hidden email]> ---
Here we go, please have a look at those 2 patches. It's still a POC and some
stuffs are really dirty.

Test it, provide feedback, talk about it, and I will keep working on it!

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |25026


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25026
[Bug 25026] RaiseError must be set for the UI
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #15 from Jonathan Druart <[hidden email]> ---
Screenshot UI:  https://snipboard.io/g5JfjL.jpg
Screenshot CLI: https://snipboard.io/bUKpai.jpg

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #116033|0                           |1
        is obsolete|                            |

--- Comment #16 from Jonathan Druart <[hidden email]> ---
Created attachment 116034
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116034&action=edit
Bug 25078: [POC] Put the db entries in a structure to handle them better

If we have have a hashref (ideally in a module!) we could have do
something more powerful and deal correctly with them.

More work is needed:
- The "export" of the $db_entries hashref from updatedatabase.pl is
really dirty, we don't want to do that
- We should not need to eval { require $updatedatabase_path } from .pm,
but retrieve it from another pm

The main problems with this approach is:
1. Someone will have to move all(?) the entries into the new
structure/file
2. Habit will change, updatedatabase.pl will become a 10 lines script
that will loop over the db entries and display the output

In my opinion it's what we want.

Don't be afraid by the diff size, most of the changes is a move of the
subroutine from updatedatabase.pl to C4/Installer.pm

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #17 from Jonathan Druart <[hidden email]> ---
Screenshot UI:  https://snipboard.io/lpETMg.jpg
Screenshot CLI: https://snipboard.io/cCoGju.jpg

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

David Cook <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #18 from Martin Renvoize <[hidden email]> ---
I like the look of the patches here.. but they won't apply at the moment.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #116032|0                           |1
        is obsolete|                            |

--- Comment #19 from Jonathan Druart <[hidden email]> ---
Created attachment 116208
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116208&action=edit
Bug 25078: [POC] Lazy version

This is the lazy, quick and dirty, version.
We use a try catch block and execute the db entry in a transaction.
When I error is found, we stop.

The main problem is that we cannot do anything with the raw output in
the template.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #116034|0                           |1
        is obsolete|                            |

--- Comment #20 from Jonathan Druart <[hidden email]> ---
Created attachment 116209
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116209&action=edit
Bug 25078: [POC] Put the db entries in a structure to handle them better

If we have have a hashref (ideally in a module!) we could have do
something more powerful and deal correctly with them.

More work is needed:
- The "export" of the $db_entries hashref from updatedatabase.pl is
really dirty, we don't want to do that
- We should not need to eval { require $updatedatabase_path } from .pm,
but retrieve it from another pm

The main problems with this approach is:
1. Someone will have to move all(?) the entries into the new
structure/file
2. Habit will change, updatedatabase.pl will become a 10 lines script
that will loop over the db entries and display the output

In my opinion it's what we want.

Don't be afraid by the diff size, most of the changes is a move of the
subroutine from updatedatabase.pl to C4/Installer.pm

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://gitlab.com/joubu/Ko
                   |                            |ha/-/tree/bug_25078

--- Comment #21 from Jonathan Druart <[hidden email]> ---
Pushed to a remove branch, I won't be able to maintain those patches up-to-date
because of the changes to updatedatabase.pl and Koha.pm

https://gitlab.com/joubu/Koha/-/tree/bug_25078

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rel_21_05_candidate,
                   |                            |RM_priority

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
123