Bug 36367

Summary: Remove context stack
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: minor    
Priority: P5 - low CC: dcook, julian.maurice, lucas
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 36149    
Bug Blocks:    
Attachments: Bug 36367: Remove get_schema_cached
Bug 36367: Remove flush_schema_cached
Bug 36367: Remove _new_userenv
Bug 36367: Remove context stack
Bug 36367: Remove dbh_stack
Bug 36367: Remove schema_stack
Bug 36367: Set to undef when unsetting
Bug 36367: Remove obsolete tests
Bug 36367: Fix BackgroundJob.t
Bug 36367: Remove get_schema_cached
Bug 36367: Remove flush_schema_cached
Bug 36367: Remove _new_userenv
Bug 36367: Remove context stack
Bug 36367: Remove dbh_stack
Bug 36367: Remove schema_stack
Bug 36367: Set to undef when unsetting
Bug 36367: Remove obsolete tests
Bug 36367: Fix BackgroundJob.t
Bug 36367: Remove call to non-existent subroutine new_userenv
Bug 36367: Fix test t/Token.t
Bug 36367: Fix test t/db_dependent/Auth.t
Bug 36367: Remove get_schema_cached
Bug 36367: Remove flush_schema_cached
Bug 36367: Remove _new_userenv
Bug 36367: Remove context stack
Bug 36367: Remove dbh_stack
Bug 36367: Remove schema_stack
Bug 36367: Set to undef when unsetting
Bug 36367: Remove obsolete tests
Bug 36367: Fix BackgroundJob.t
Bug 36367: Remove call to non-existent subroutine new_userenv
Bug 36367: Fix test t/Token.t
Bug 36367: Fix test t/db_dependent/Auth.t

Description Jonathan Druart 2024-03-20 07:50:15 UTC
It's not used and is confusing. It does not make sense for now with plack and our current codebase.

We should remove it (and the other places using this pattern) and reintroduce it later, correctly implemented, if we need it back.
Comment 1 Jonathan Druart 2024-03-20 07:54:10 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2024-03-20 07:54:13 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2024-03-20 07:54:15 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2024-03-20 07:54:17 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2024-03-20 07:54:20 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2024-03-20 07:54:22 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2024-03-20 07:54:25 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2024-03-20 07:54:27 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2024-03-20 08:13:39 UTC Comment hidden (obsolete)
Comment 10 Julian Maurice 2024-04-18 14:41:42 UTC Comment hidden (obsolete)
Comment 11 Julian Maurice 2024-04-18 14:41:44 UTC Comment hidden (obsolete)
Comment 12 Julian Maurice 2024-04-18 14:41:47 UTC Comment hidden (obsolete)
Comment 13 Julian Maurice 2024-04-18 14:41:50 UTC Comment hidden (obsolete)
Comment 14 Julian Maurice 2024-04-18 14:41:53 UTC Comment hidden (obsolete)
Comment 15 Julian Maurice 2024-04-18 14:41:56 UTC Comment hidden (obsolete)
Comment 16 Julian Maurice 2024-04-18 14:41:59 UTC Comment hidden (obsolete)
Comment 17 Julian Maurice 2024-04-18 14:42:01 UTC Comment hidden (obsolete)
Comment 18 Julian Maurice 2024-04-18 14:42:04 UTC Comment hidden (obsolete)
Comment 19 Julian Maurice 2024-04-18 14:42:06 UTC Comment hidden (obsolete)
Comment 20 Julian Maurice 2024-04-18 14:42:09 UTC Comment hidden (obsolete)
Comment 21 Julian Maurice 2024-04-18 14:42:11 UTC Comment hidden (obsolete)
Comment 22 Julian Maurice 2024-04-18 14:58:08 UTC
Patches look good. Tests pass. QA tests pass (except one about POD but I think it's a false negative).
I didn't notice any bug trying to login/logout with different patrons and using staff interface and opac
Comment 23 Martin Renvoize (ashimema) 2024-06-04 12:10:46 UTC
Created attachment 167380 [details] [review]
Bug 36367: Remove get_schema_cached

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 24 Martin Renvoize (ashimema) 2024-06-04 12:10:49 UTC
Created attachment 167381 [details] [review]
Bug 36367: Remove flush_schema_cached

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 25 Martin Renvoize (ashimema) 2024-06-04 12:10:52 UTC
Created attachment 167382 [details] [review]
Bug 36367: Remove _new_userenv

TODO - better review C4::Auth's changes. Are all the removal of
_new_userenv correct/enough?

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 26 Martin Renvoize (ashimema) 2024-06-04 12:10:55 UTC
Created attachment 167383 [details] [review]
Bug 36367: Remove context stack

We are not using it and it's confusing, let's remove the context stack.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 27 Martin Renvoize (ashimema) 2024-06-04 12:10:58 UTC
Created attachment 167384 [details] [review]
Bug 36367: Remove dbh_stack

Same pattern, remove dbh stack

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 28 Martin Renvoize (ashimema) 2024-06-04 12:11:01 UTC
Created attachment 167385 [details] [review]
Bug 36367: Remove schema_stack

Same pattern in Koha::Database

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 29 Martin Renvoize (ashimema) 2024-06-04 12:11:04 UTC
Created attachment 167386 [details] [review]
Bug 36367: Set to undef when unsetting

We usually test if C4::Context->userenv, so we need to undef when
unsetting, not {} (evaluated true)

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 30 Martin Renvoize (ashimema) 2024-06-04 12:11:07 UTC
Created attachment 167387 [details] [review]
Bug 36367: Remove obsolete tests

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 31 Martin Renvoize (ashimema) 2024-06-04 12:11:09 UTC
Created attachment 167388 [details] [review]
Bug 36367: Fix BackgroundJob.t

This test is useless it seems, it is not testing background jobs
behaviour.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 32 Martin Renvoize (ashimema) 2024-06-04 12:11:12 UTC
Created attachment 167389 [details] [review]
Bug 36367: Remove call to non-existent subroutine new_userenv

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 33 Martin Renvoize (ashimema) 2024-06-04 12:11:15 UTC
Created attachment 167390 [details] [review]
Bug 36367: Fix test t/Token.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 34 Martin Renvoize (ashimema) 2024-06-04 12:11:18 UTC
Created attachment 167391 [details] [review]
Bug 36367: Fix test t/db_dependent/Auth.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 35 Martin Renvoize (ashimema) 2024-06-04 12:11:43 UTC
Awesome work here, thanks for following through on it.

Passing QA
Comment 36 Martin Renvoize (ashimema) 2024-06-14 10:22:12 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant