Bug 37262 - api/v1/extended_attribute_types does not filter additional fields for unmapped tablenames
Summary: api/v1/extended_attribute_types does not filter additional fields for unmappe...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on: 35197 37261
Blocks: 35044
  Show dependency treegraph
 
Reported: 2024-07-05 12:15 UTC by Pedro Amorim
Modified: 2024-07-12 08:22 UTC (History)
3 users (show)

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


Attachments
Bug 37262: Tests for filtering unmapped tablename (1.66 KB, patch)
2024-07-05 12:19 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37262: Fix for unmapped tablename filtering (1.84 KB, patch)
2024-07-05 12:19 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37262: Tests for filtering unmapped tablename (1.72 KB, patch)
2024-07-08 12:33 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37262: Fix for unmapped tablename filtering (1.84 KB, patch)
2024-07-08 12:33 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37262: Tests for filtering unmapped tablename (1.77 KB, patch)
2024-07-08 18:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 37262: Fix for unmapped tablename filtering (1.89 KB, patch)
2024-07-08 18:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 37262: Tests for filtering unmapped tablename (1.83 KB, patch)
2024-07-10 13:35 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 37262: Fix for unmapped tablename filtering (1.96 KB, patch)
2024-07-10 13:35 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 37262: (follow-up) Rename types/tables (2.30 KB, patch)
2024-07-10 13:35 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 37262: (follow-up) Rename types/tables (2.36 KB, patch)
2024-07-10 15:59 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2024-07-05 12:15:49 UTC

    
Comment 1 Pedro Amorim 2024-07-05 12:19:02 UTC
Created attachment 168533 [details] [review]
Bug 37262: Tests for filtering unmapped tablename

Test plan:
1) Apply this patch only, run tests:
prove t/db_dependent/api/v1/extended_attribute_types.t
2) Notice they fail
3) Apply the fix patch, run tests again
Comment 2 Pedro Amorim 2024-07-05 12:19:04 UTC
Created attachment 168534 [details] [review]
Bug 37262: Fix for unmapped tablename filtering
Comment 3 David Nind 2024-07-05 22:09:39 UTC
The tests don't pass after applying the fix patch.

With the first patch (and dependent bug 37261)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

prove t/db_dependent/api/v1/extended_attribute_types.t
t/db_dependent/api/v1/extended_attribute_types.t .. 
    #   Failed test '200 OK'
    #   at t/db_dependent/api/v1/extended_attribute_types.t line 124.
    #          got: '400'
    #     expected: '200'

    #   Failed test 'exact match for JSON Pointer ""'
    #   at t/db_dependent/api/v1/extended_attribute_types.t line 124.
    #     Structures begin differing at:
    #          $got = HASH(0x58ce5bcd0ea0)
    #     $expected = ARRAY(0x58ce5c4ed4e8)
    # Looks like you failed 2 tests of 23.
t/db_dependent/api/v1/extended_attribute_types.t .. 1/1 
#   Failed test 'list() tests'
#   at t/db_dependent/api/v1/extended_attribute_types.t line 135.
# Looks like you failed 1 test of 1.
t/db_dependent/api/v1/extended_attribute_types.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/db_dependent/api/v1/extended_attribute_types.t (Wstat: 256 (exited 1) Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  4 wallclock secs ( 0.02 usr  0.00 sys +  3.18 cusr  0.28 csys =  3.48 CPU)
Result: FAIL

After the fix patch
~~~~~~~~~~~~~~~~~~~

prove t/db_dependent/api/v1/extended_attribute_types.t
t/db_dependent/api/v1/extended_attribute_types.t .. 
    #   Failed test '200 OK'
    #   at t/db_dependent/api/v1/extended_attribute_types.t line 124.
    #          got: '400'
    #     expected: '200'

    #   Failed test 'exact match for JSON Pointer ""'
    #   at t/db_dependent/api/v1/extended_attribute_types.t line 124.
    #     Structures begin differing at:
    #          $got = HASH(0x643ead195ea8)
    #     $expected = ARRAY(0x643ead191650)
    # Looks like you failed 2 tests of 23.
t/db_dependent/api/v1/extended_attribute_types.t .. 1/1 
#   Failed test 'list() tests'
#   at t/db_dependent/api/v1/extended_attribute_types.t line 135.
# Looks like you failed 1 test of 1.
t/db_dependent/api/v1/extended_attribute_types.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/db_dependent/api/v1/extended_attribute_types.t (Wstat: 256 (exited 1) Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  4 wallclock secs ( 0.01 usr  0.01 sys +  3.20 cusr  0.22 csys =  3.44 CPU)
Result: FAIL
Comment 4 Pedro Amorim 2024-07-08 12:33:17 UTC
Created attachment 168589 [details] [review]
Bug 37262: Tests for filtering unmapped tablename

Test plan:
1) Apply this patch only, run tests:
prove t/db_dependent/api/v1/extended_attribute_types.t
2) Notice they fail
3) Apply the fix patch, refresh the API bundle, run:
yarn api:bundle
4) Run tests again, notice they pass
Comment 5 Pedro Amorim 2024-07-08 12:33:19 UTC
Created attachment 168590 [details] [review]
Bug 37262: Fix for unmapped tablename filtering
Comment 6 Pedro Amorim 2024-07-08 12:34:33 UTC
Thank you David, I missed a step on the test plan and have now updated it.
We are required to run:
yarn api:bundle

Because the API specs have changed I believe.
Can you please try again? The api bundle command failed for me today before running ktd pull so please try that if it fails for you the first time.
Comment 7 David Nind 2024-07-08 18:38:54 UTC
(In reply to Pedro Amorim from comment #6)
> Thank you David, I missed a step on the test plan and have now updated it.
> We are required to run:
> yarn api:bundle
> 
> Because the API specs have changed I believe.
> Can you please try again? The api bundle command failed for me today before
> running ktd pull so please try that if it fails for you the first time.

Thanks Pedro! That worked.
Comment 8 David Nind 2024-07-08 18:39:42 UTC
Created attachment 168613 [details] [review]
Bug 37262: Tests for filtering unmapped tablename

Test plan:
1) Apply this patch only, run tests:
prove t/db_dependent/api/v1/extended_attribute_types.t
2) Notice they fail
3) Apply the fix patch, refresh the API bundle, run:
yarn api:bundle
4) Run tests again, notice they pass

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2024-07-08 18:39:44 UTC
Created attachment 168614 [details] [review]
Bug 37262: Fix for unmapped tablename filtering

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 Tomás Cohen Arazi 2024-07-10 13:35:32 UTC
Created attachment 168742 [details] [review]
Bug 37262: Tests for filtering unmapped tablename

Test plan:
1) Apply this patch only, run tests:
prove t/db_dependent/api/v1/extended_attribute_types.t
2) Notice they fail
3) Apply the fix patch, refresh the API bundle, run:
yarn api:bundle
4) Run tests again, notice they pass

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Tomás Cohen Arazi 2024-07-10 13:35:35 UTC
Created attachment 168743 [details] [review]
Bug 37262: Fix for unmapped tablename filtering

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: amended to tidy the new code (tcohen)
Comment 12 Tomás Cohen Arazi 2024-07-10 13:35:37 UTC
Created attachment 168744 [details] [review]
Bug 37262: (follow-up) Rename types/tables

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 13 Tomás Cohen Arazi 2024-07-10 13:36:25 UTC
Pedro: please review my follow-up.
Comment 14 Pedro Amorim 2024-07-10 15:59:31 UTC
Created attachment 168752 [details] [review]
Bug 37262: (follow-up) Rename types/tables

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 15 Katrin Fischer 2024-07-12 08:22:20 UTC
Pushed for 24.11!

Well done everyone, thank you!