Bug 28279

Summary: mappings.yaml no longer in sync
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: System AdministrationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19482, 20589, 25325, 27316    
Bug Blocks:    
Attachments: Bug 28279: Re-sync mappings.yaml
Bug 28279: Re-sync mappings.yaml

Description Jonathan Druart 2021-05-03 13:00:47 UTC
We are missing some changes in the mappings.yaml file:
* missing staff_client/opac (bug 25325 and bug 20589)
* missing mandatory (bug 19482)
* sort (bug 27316) became a boolean field

Which means export_elasticsearch_mappings.pl generates a file that differs a lot from the one we have in our codebase.
Comment 1 Jonathan Druart 2021-05-03 13:06:08 UTC
*** Bug 27856 has been marked as a duplicate of this bug. ***
Comment 2 Jonathan Druart 2021-05-03 13:06:47 UTC
Created attachment 120405 [details] [review]
Bug 28279: Re-sync mappings.yaml

We are missing some changes in the mappings.yaml file:
* missing staff_client/opac (bug 25325 and bug 20589)
* missing mandatory (bug 19482)
* sort (bug 27316) became a boolean field

Which means export_elasticsearch_mappings.pl generates a file that differs a lot from the one we have in our codebase.

There are also indentation changes certainly caused by the replacement
of YAML with YAML::XS

Test plan:
1. reset_all without this patch
2. export the mappings to a non-tracked file (ie. don't erate
mappings.yaml from source)
3. Apply this patch
4. Compare both file
=> No change expected
5. Reset the mappings (so using the mappings.yaml after the changes from
this patch)
6. Compare the tables on the UI (with and without the patch applied)
=> No change expected

QA will use --word-diff to make sure only mandatory, sort and
staff_client/opac are modified
Comment 3 Fridolin Somers 2021-08-17 07:31:28 UTC
Sorry patch does not apply anymore
Comment 4 Jonathan Druart 2021-08-17 08:17:30 UTC
Created attachment 123868 [details] [review]
Bug 28279: Re-sync mappings.yaml

We are missing some changes in the mappings.yaml file:
* missing staff_client/opac (bug 25325 and bug 20589)
* missing mandatory (bug 19482)
* sort (bug 27316) became a boolean field

Which means export_elasticsearch_mappings.pl generates a file that differs a lot from the one we have in our codebase.

There are also indentation changes certainly caused by the replacement
of YAML with YAML::XS

Test plan:
1. reset_all without this patch
2. export the mappings to a non-tracked file (ie. don't erate
mappings.yaml from source)
3. Apply this patch
4. Compare both file
=> No change expected
5. Reset the mappings (so using the mappings.yaml after the changes from
this patch)
6. Compare the tables on the UI (with and without the patch applied)
=> No change expected

QA will use --word-diff to make sure only mandatory, sort and
staff_client/opac are modified
Comment 5 Fridolin Somers 2021-08-20 00:08:24 UTC
There is a strange thing in the patch.

Some blocks are moving (for example field Heading).
Looks like the export sorts by MARC type marc21->unimarc->normarc.

But for me export sorts by MARC type alphabetical : marc21->normarc->unimarc.

This is in patch :
Bug 23204: Fix ordering of fields in exported file

o_O
Comment 6 Jonathan Druart 2021-08-25 09:34:31 UTC
I've only used export_elasticsearch_mappings.pl to generate this patch.
Comment 7 Fridolin Somers 2021-09-01 06:09:17 UTC
Ah, I think we need someone else testing.
Maybe Nick.
Comment 8 Jonathan Druart 2021-11-16 15:11:24 UTC
Has been regenerated by
  commit 0760045e0b10a80643b90cac77f653d5cda42e75
  Bug 18984: Remove ES mapping for NORMARC