Bug 18645 - Creation of Koha feature release change tool displayed after running Koha update
Summary: Creation of Koha feature release change tool displayed after running Koha update
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL: https://wiki.koha-community.org/wiki/...
Keywords:
: 19247 (view as bug list)
Depends on:
Blocks: 18715
  Show dependency treegraph
 
Reported: 2017-05-21 14:03 UTC by Alex Buckley
Modified: 2020-05-29 09:31 UTC (History)
11 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 18645 -Koha feature release change tool (102.26 KB, patch)
2017-10-14 23:10 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18645 -Koha feature release change tool (102.26 KB, patch)
2017-10-14 23:24 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 19247 - Followup: QA test tool fixes (24.65 KB, patch)
2017-10-14 23:30 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 19247 - Added ability to skip feature release tool (37.12 KB, patch)
2017-10-14 23:52 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18645 -Koha feature release change tool (93.75 KB, patch)
2017-10-14 23:59 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18645 -Koha feature release change tool (95.35 KB, patch)
2017-12-03 19:50 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18645 -Koha feature release change tool (70.15 KB, patch)
2017-12-03 20:56 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18645: Koha feature release change tool (174.34 KB, patch)
2019-03-11 00:07 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 18645: (follow-up) Making feature release tool work with all syspref types (31.74 KB, patch)
2019-03-26 22:04 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2017-05-21 14:03:01 UTC
After Koha site admins update their Koha version at present they simply log into the staff interface and the home page is displayed with no further information about what was installed.  

The enhancement that will be built to fill this niche will display all new sysprefs created since the users previous version by comparing version numbers (old version and new one just installed), the site admin will be able to review and modify the system preferences.

Additionally links to the release notes (and manual where applicable) will be provided.

If time permitting a further addition to this enhancement would be information about major new features in each release.
Comment 1 Marc Véron 2017-06-01 04:28:24 UTC
+1

Just some questions and ideas:

Will the display of new features go to a separate tab on the About page?
Will it be translatable?

For the (new) system preferences:

Will they have a separate tab on the About page as well?

Or, as an alternative, will they somehow be highlighted on Home > Administration > System preferences?
Maybe have the version number as a search criterium (or a filter) for the (new or changed) system preferences? 

We could have a new column 'version' in the table 'systempreferences' and include it to the search. Then you could have a link like:
.../cgi-bin/koha/admin/preferences.pl?op=search&searchfield=17.05
to display all sysprefs related to this version, and they would appear in the installed languages as appropriate.

To announce the new version in staff client:

What about creating a 'News' item that appears for all libraries? 

Such a news item could contain a standard text with the release number, and links to the new features and preferences. Library staff then could edit it, e.g. adding some library specific information ("Please report issues to...")
The creaton of such news item could take place at the end of the installation process. The text used would be the translated one for the language chosen at the start of the installation porcess.
Comment 2 Liz Rea 2017-06-01 04:36:49 UTC
Whoa, good ideas, but quite a bit of scope creep. :D
Comment 3 Alex Buckley 2017-06-01 05:01:38 UTC
Hi Marc

Thanks very much for your feedback/ideas I like the ideas, I am thinking it would be good to put them in a separate bug report, just so there isn't too much in a single bug report because having done the onboarding tool I found that the bigger the patch the longer it takes to get through QA and it would be good to get both this enhancement and the recommendation enhancement pushed for the Koha 17.11 release :) 

For this patch I was planning to have the new sysprefs, links to release notes (and Koha manual where applicable) to be displayed on a new page after the user logs in following an update. So it is available to admins immediately after upgrade.

I can write up a bug report for your ideas to depend on this bug report now if you'd like
Comment 4 Marc Véron 2017-06-01 08:19:33 UTC
(In reply to Alex Buckley from comment #3)
> Hi Marc
> 
> Thanks very much for your feedback/ideas I like the ideas, I am thinking it
> would be good to put them in a separate bug report, just so there isn't too
> much in a single bug report because having done the onboarding tool I found
> that the bigger the patch the longer it takes to get through QA and it would
> be good to get both this enhancement and the recommendation enhancement
> pushed for the Koha 17.11 release :) 
> 
> For this patch I was planning to have the new sysprefs, links to release
> notes (and Koha manual where applicable) to be displayed on a new page after
> the user logs in following an update. So it is available to admins
> immediately after upgrade.
> 
> I can write up a bug report for your ideas to depend on this bug report now
> if you'd like

Hi Alex and Liz

Thanks for the comments. I agree that my suggestions would be out of scope of your initial intentions for this bug. If you have time to put the suggestions in a new bug report - please go ahead.

Marc
Comment 5 Alex Buckley 2017-10-14 23:10:30 UTC Comment hidden (obsolete)
Comment 6 Alex Buckley 2017-10-14 23:24:01 UTC Comment hidden (obsolete)
Comment 7 Alex Buckley 2017-10-14 23:30:53 UTC Comment hidden (obsolete)
Comment 8 Alex Buckley 2017-10-14 23:52:42 UTC Comment hidden (obsolete)
Comment 9 Alex Buckley 2017-10-14 23:59:57 UTC Comment hidden (obsolete)
Comment 10 Dominic Pichette 2017-10-20 20:15:55 UTC
I'm having trouble applying the patch.
I did a reset and still can't apply the patch without getting:
fatal: sha1 information is lacking or useless (installer/data/mysql/kohastructure.sql).
Comment 11 Alex Buckley 2017-10-30 22:37:17 UTC
(In reply to Dominic Pichette)

Hi Dominic

Thanks for trying to test. Hmm it is applying successfully for me on a clean, up to date branch. If you try applying on a new branch rather than resetting do you get the same error?

Also can someone else try testing just to determine if this is a system specific issue
Comment 12 Liz Rea 2017-10-30 23:12:10 UTC
This patch applies just fine for me on a clean master branch.

I recommend the following: 

git fetch origin && git checkout origin/master
git checkout -b bug-18645
git bz apply 18645

(or apply the patch however you usually do)

This is the best and really only way to test patches.

Cheers,
Liz
Comment 13 Mark Tompsett 2017-11-01 03:09:31 UTC
Please do not do whitespace changes in patches unless necessary for individual changed lines. White space patches should be separated. Otherwise, it makes eyeballing the bug more difficult.
Comment 14 David Bourgault 2017-11-17 21:52:30 UTC
When applying the patch I got a conflict with staff-global.css (trivial, I fixed it)

Following test plan I saw the buttons as predicted, but when login-in-out with admin and then login with superlibrarian I did not get redirected to the installer login page.

When through step plan again, clicked the "Continue to feature release tool" button and got redirected correctly. However no system pref showed up (I had 1 release note, for 17.05).

QA tool shows multiple (minor) errors (including a spelling error in a surname‽)

Failed QA
Comment 15 Alex Buckley 2017-12-03 19:50:06 UTC Comment hidden (obsolete)
Comment 16 Alex Buckley 2017-12-03 20:56:50 UTC
Created attachment 69471 [details] [review]
Bug 18645 -Koha feature release change tool

This tool is displayed at the end of the update process to display all
the new system preferences added during the update so that the
administrator can view and modify their default values if neccessary

The administrator also has the ability to skip the feature release tool on the update
process and it will be displayed to the next superlibrarian user that
logs in. Because librarian staff are likely to be more familiar with the
system preference settings that a library would want to set than an IT
support administrator

Test plan:
1. Go to Administrator->global system preferences->Local use

2. Set the version number to 16.120033 (Note: only 1 decimal place) and
save

3. Go through the update process and notice that after submitting the
'Update database structure' page you are prompted to login and the main
page appears if you logged in with the correct credentials

4. Apply patch

5. Repeat steps 1 and 2

6. Notice the button text on the 'Update database structure' page has
changed and now it says 'Continue to feature release tool'

7. Notice there is also a skip button. Click the skip button and notice
you are redirected to the staff intranet login page.

8. Login with the Koha db administrator credentials and notice that the
Koha main page is displayed

9. Logout and enter superlibrarian user credentials and submit the login
form

10. Notice you are redirected to the Koha web installer login page

11. Login with the Koha db administrator credentials

12. Notice the feature release change tool is displayed

13. Alter the NumSavedReports and the
TalkingTechItivaPhoneNotification values and select the 'Save all
preferences' button

14. Query the values of these two sysprefs in the systempreferences
database table and notice they have been changed to what you submitted

15. Click the 'Log into Koha staff intranet' button

16. Notice the intranet login page appears

17. Login and the main page will be displayed

18. Repeat steps 1,2 and click the 'Continue to feature release tool'
button

19. Notice the feature release tool is displayed and repeat steps 13 and
14

20. Click the 'Log into Koha staff intranet' button, login as either
Koha db administrator or as a superlibrarian (it doesn't matter which
you log in as) and the Koha staff intranet mainpage will be displayed

21. Log out and then log back in again and notice the staff intranet is
still displayed. Note you are not redirected to the Koha web installer
login page to go through the feature release change tool because you
have already gone through it

Sponsored-By: Catalyst IT
Comment 17 Owen Leonard 2018-08-07 18:23:08 UTC
I think this is a great idea. I'm some problems though:

 - Only YesNo and Choice type prefs are displaying. In my test I should also be seeing form fields for types "short" and "textarea." While "choice" type preferences are showing a dropdown, the dropdown is empty.

In my test system there are these preference types:

| Choice       |
| ClassSources |
| File         |
| Free         |
| integer      |
| Languages    |
| multiple     |
| short        |
| Textarea     |
| Themes       |
| YesNo        |

It doesn't look like all those options are accounted for in the template. Would it be possible to break the code out of admin/preferences.tt into an include file to be used here?
Comment 18 Aleisha Amohia 2019-03-11 00:07:56 UTC
Created attachment 86420 [details] [review]
Bug 18645: Koha feature release change tool

This tool is displayed at the end of the update process to display all
the new system preferences added during the update so that the
administrator can view and modify their default values if neccessary

The administrator also has the ability to skip the feature release tool on the update
process and it will be displayed to the next superlibrarian user that
logs in. Because librarian staff are likely to be more familiar with the
system preference settings that a library would want to set than an IT
support administrator

Test plan:
1. Go to Administrator->global system preferences->Local use

2. Set the version number to 16.120033 (Note: only 1 decimal place) and
save

3. Go through the update process and notice that after submitting the
'Update database structure' page you are prompted to login and the main
page appears if you logged in with the correct credentials

4. Apply patch

5. Repeat steps 1 and 2

6. Notice the button text on the 'Update database structure' page has
changed and now it says 'Continue to feature release tool'

7. Notice there is also a skip button. Click the skip button and notice
you are redirected to the staff intranet login page.

8. Login with the Koha db administrator credentials and notice that the
Koha main page is displayed

9. Logout and enter superlibrarian user credentials and submit the login
form

10. Notice you are redirected to the Koha web installer login page

11. Login with the Koha db administrator credentials

12. Notice the feature release change tool is displayed

13. Alter the NumSavedReports and the
TalkingTechItivaPhoneNotification values and select the 'Save all
preferences' button

14. Query the values of these two sysprefs in the systempreferences
database table and notice they have been changed to what you submitted

15. Click the 'Log into Koha staff intranet' button

16. Notice the intranet login page appears

17. Login and the main page will be displayed

18. Repeat steps 1,2 and click the 'Continue to feature release tool'
button

19. Notice the feature release tool is displayed and repeat steps 13 and
14

20. Click the 'Log into Koha staff intranet' button, login as either
Koha db administrator or as a superlibrarian (it doesn't matter which
you log in as) and the Koha staff intranet mainpage will be displayed

21. Log out and then log back in again and notice the staff intranet is
still displayed. Note you are not redirected to the Koha web installer
login page to go through the feature release change tool because you
have already gone through it

Sponsored-By: Catalyst IT
Comment 19 Aleisha Amohia 2019-03-11 00:08:23 UTC
Fixed merge conflicts, now looking at Comment 17
Comment 20 Jonathan Druart 2019-03-15 13:26:49 UTC
I had a very quick look at the patch and eyeballed:

1. Do not include css/staff-global.css but css/src/staff-global.scss instead

2.
+# warn user if they are using mysql/admin login
=> This is no longer possible

3. Koha::Patron should not contain raw SQL queries.

sub check_if_patrons_have_flags
should be replaced with "filter_by_with_flags" (or filter_by_something) and looks like:
  my $patron_without_flags = $self->search({ flags => undef })->count;
I let you do the logic for the return value ;)

4. in admin/preferences.pl you are replacing 4 spaces indent with 3 spaces. It's against the coding guidelines and will add merge conflicts. Not a good idea :)
There is also debug statements (warn) and empty spaces changes.

5. Is team.inc a copy of about.tt? Also not a good idea, we should have this list only once (we already have it twice actually docs/history.txt and about.tt)
Comment 21 Aleisha Amohia 2019-03-26 22:04:07 UTC
Created attachment 87039 [details] [review]
Bug 18645: (follow-up) Making feature release tool work with all syspref types

This patch is a work in progress. I've separated the template code into
an include for the preferences page and feature release page. Am now
working on making the feature release perl code work with this template.

Struggling to avoid duplicating code. If anyone has a suggestion on a
good way to use essentially all the methods in admin/preferences.pl
again in installer/featurereleasetool.pl without repeating them, I'd
appreciate hearing them.

Sponsored-by: Catalyst IT
Comment 22 Martin Renvoize 2019-06-19 08:56:38 UTC
*** Bug 19247 has been marked as a duplicate of this bug. ***