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

Check API version compatiblity #710

Merged
merged 4 commits into from
Dec 11, 2023
Merged

Check API version compatiblity #710

merged 4 commits into from
Dec 11, 2023

Conversation

fgravin
Copy link
Member

@fgravin fgravin commented Dec 2, 2023

This PR ensures the API version compatibility by explicitly testing the compatibility and throwing an error if the API is not compatible.
=> if the GeoNetwork API version is lower then 4.2.2

The error is not silent anymore and is logged in the console. One improvement could be to modify the user error message accordingly.

It introduces a new dependency semver for semantic version comparisons.

Screenshot from 2023-12-02 16-57-24

@fgravin fgravin added the enhancement Proposal for a new feature label Dec 2, 2023
@fgravin fgravin added this to the 2.1.0 milestone Dec 2, 2023
@fgravin fgravin self-assigned this Dec 2, 2023
Copy link
Contributor

github-actions bot commented Dec 2, 2023

Affected libs: api-repository, feature-catalog, feature-record, feature-router, feature-search, feature-map, feature-dataviz, feature-auth, common-domain, api-metadata-converter, feature-editor, ui-search, common-fixtures, util-shared, ui-elements, ui-catalog, ui-widgets, ui-inputs, ui-map, ui-dataviz, data-access-datafeeder, util-data-fetcher, data-access-gn4, util-app-config, ui-layout, util-i18n,
Affected apps: metadata-editor, datahub, demo, webcomponents, search, map-viewer, datafeeder, metadata-converter, data-platform,

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

@fgravin fgravin linked an issue Dec 2, 2023 that may be closed by this pull request
@fgravin fgravin requested a review from jahow December 4, 2023 10:18
@f-necas f-necas self-requested a review December 7, 2023 09:33
Copy link
Collaborator

@f-necas f-necas left a comment

Choose a reason for hiding this comment

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

Everythings works well, thanks @fgravin.

There's just the toString() thing to check if it doesn't break anything.

@@ -37,6 +37,6 @@ export class Gn4PlatformMapper {
credentialsNonExpired,
...user
} = apiUser
return { ...apiUser, id: id + '' } as UserModel
return { ...apiUser, id: id.toString() } as UserModel
Copy link
Collaborator

Choose a reason for hiding this comment

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

The old way ensure a value is set and no Error is thrown. Didn't dig deeper but it may have impact.

Copy link
Member Author

Choose a reason for hiding this comment

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

I also used to know that it was better too, @jahow wanted me to change that though.
Maybe id?.toString() 😄

@fgravin fgravin merged commit 10efb71 into main Dec 11, 2023
9 checks passed
@fgravin fgravin deleted the check-version branch December 11, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datahub: organizations request failure not explicit
2 participants