Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata Editor / fix error when saving with GeoNetwork 4.2.5+ #945

Merged
merged 7 commits into from
Jul 24, 2024

Conversation

jahow
Copy link
Collaborator

@jahow jahow commented Jul 22, 2024

Description

This PR fixes an issue where saving would fail with a 500 HTTP error with GeoNetwork versions of 4.2.5 and above.

This is because:

  • this commit made the insert API only accept the XML
  • the generated API client in GeoNetwork-UI was still handling the 3 previous content types (XML, JSON, url encoded)
  • as such, the generated API client was sending the PUT request with a Content-Type: application/json header, which failed because this content type was not handled anymore in GeoNetwork API

Remaining to do:

  • write an end-to-end test for saving a record
  • run e2e tests against various versions of GN to avoid this problem in the future

Architectural changes

GN4 API client was regenerated

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

Copy link
Contributor

github-actions bot commented Jul 22, 2024

Affected libs: data-access-gn4, api-metadata-converter, api-repository, feature-catalog, feature-record, feature-router, feature-search, feature-map, feature-dataviz, feature-editor, feature-auth, ui-search,
Affected apps: metadata-editor, metadata-converter, datahub, demo, webcomponents, map-viewer, search, datafeeder,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Jul 22, 2024

📷 Screenshots are here!

@jahow jahow force-pushed the me-fix-save-gn-425 branch 4 times, most recently from 69abd8a to 99485f7 Compare July 23, 2024 09:52
@jahow
Copy link
Collaborator Author

jahow commented Jul 23, 2024

This PR most likely fixes #935

@jahow jahow force-pushed the me-fix-save-gn-425 branch 2 times, most recently from dcc9b80 to a7f6a69 Compare July 23, 2024 09:59
@coveralls
Copy link

coveralls commented Jul 23, 2024

Coverage Status

coverage: 83.508% (+0.4%) from 83.088%
when pulling 583c63f on me-fix-save-gn-425
into 613f731 on main.

@jahow jahow force-pushed the me-fix-save-gn-425 branch 2 times, most recently from a56fe6f to 2541c6d Compare July 23, 2024 11:55
Copy link
Collaborator

@rcaplier rcaplier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

I'm not very quite used with the githubwork workflow stuff so I trust you on that.

Also regenerates API client

This fixes an error when trying to save a record with GN 4.2.5+
@jahow jahow force-pushed the me-fix-save-gn-425 branch 3 times, most recently from 2eeff24 to a30b458 Compare July 23, 2024 15:34
@jahow jahow force-pushed the me-fix-save-gn-425 branch from a30b458 to fc98081 Compare July 23, 2024 15:53
@jahow
Copy link
Collaborator Author

jahow commented Jul 23, 2024

The E2E tests are still flaky, I'll try to improve them

@jahow jahow force-pushed the me-fix-save-gn-425 branch from 576ee77 to ab02d71 Compare July 24, 2024 09:03
@jahow jahow force-pushed the me-fix-save-gn-425 branch from ab02d71 to 583c63f Compare July 24, 2024 10:11
@jahow jahow merged commit e6ae55a into main Jul 24, 2024
11 checks passed
@jahow jahow deleted the me-fix-save-gn-425 branch July 24, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants