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

Feature/1227 verify layers #1242

Merged
merged 10 commits into from
Nov 15, 2022
Merged

Feature/1227 verify layers #1242

merged 10 commits into from
Nov 15, 2022

Conversation

jacobwod
Copy link
Member

Please take a quick look. The code is pretty isolated and I've ensured to do some checks so it won't crash arbitrarily, but feel free to leave comments!

Closes #1227

- New endpoint
- New dep (XMLParser, as GetCapabilities are XML and we can't rely on everyone using the new OGC Feature API which returns JSON)
- Updated older deps
- This initial implementation verifies only layers from WMS services.
- If a layer is reported missing (i.e. not available in GetCapabilities) we do one more check. We request a DescribeLayer (or DescribeFeatureType, for WFS services). Depending on the response, we can determine if the layer is really missing (if so, we keep it as missing), or if there may be any other problem with it (in that case, we mark it as 'problematic' and return in the response too). I think this might be a good addition to get reliable results back.
- Tested for GeoServer and QGIS Server.
- Since Fetch API is only available in Node >=18, we do an early check to and gentle quit if fetch() does not exist.
- Added some logs to the verify function, including sending the username that invoked this request.
- Cleanups, comments.
- There's no need to force users to upgrade only to use the verify layers functionality.
- Instead, I've added a checker at start. We check if the current version is lower than the recommended one and show a nice warning about it so system admins can act upon it.
@jesade-vbg
Copy link
Contributor

jesade-vbg commented Nov 15, 2022

Note that you'll need latest LTS of node 18+.
Error: Function not supported. Please update your NodeJS runtime to at least v18.0.0. Current Node version: v16.16.0.

Just noticed in the code that this is well known :) But I think this is worth noting so people just dont deploy live and notices this later.

Copy link
Contributor

@jesade-vbg jesade-vbg left a comment

Choose a reason for hiding this comment

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

Looks good Jacob! Good addition

@jacobwod
Copy link
Member Author

Note that you'll need latest LTS of node 18+. Error: Function not supported. Please update your NodeJS runtime to at least v18.0.0. Current Node version: v16.16.0.

Just noticed in the code that this is well known :) But I think this is worth noting so people just dont deploy live and notices this later.

Yes, I thought that the best way is to allow the process to run on older Node runtimes but display this message. It's not a mission critical in my opinion, so we want it to run anyway, but it's good to hint system admin that an update is welcome. :)

@jacobwod jacobwod merged commit 00f4c7a into develop Nov 15, 2022
@jacobwod jacobwod deleted the feature/1227-verify-layers branch November 15, 2022 10:00
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.

2 participants