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

Fix xml parser prior to upgrading to node v22 #2656

Merged
merged 6 commits into from
Nov 21, 2024

Conversation

jonathangoulding
Copy link
Collaborator

@jonathangoulding jonathangoulding commented Nov 20, 2024

https://eaflood.atlassian.net/browse/WATER-4729

We want to upgrade to node v22, but we have a blocker with the xml parser we are using.

The tool being used is libxmljs and has some open issues:

Mainly the issues are:

  • is it being maintained
  • is there going to be a release to make it work with node v22.

Rebuilding the package locally during our npm install has not worked, (through minimum effort) and if we did make it to build there is no guarantee it will actually work when built.

This spike investigates the effort required to get any xml parser to work with the least possible effort.

The change suggest using libxmljs2. Which works.

However, if you look at the documentation it states : "LibXML bindings for node.js This package was forked as the original one is fairly unmaintained."

Sounds good. But now it clearly now states it is "NO LONGER MAINTAINED".

https://eaflood.atlassian.net/browse/WATER-4729

We want to upgrade to node v22, but we have a blocker with the xml parser we are using.

The tool being used is libxmljs and has some open issues:

libxmljs/libxmljs#664
libxmljs/libxmljs#660

Mainly the issues are:
- is it being maintained
- is there going to be a release to make it work with node v22.

Rebuilding the package locally during our npm install has not worked, (through minimum effort) and if we did make it to build there is no guarantee it will actually work when built.

This spike investigates the effort required to get any xml parser to work with the least possible effort.

The change suggest using libxmljs2. Which works.

However, if you look at the documentation it states : "LibXML bindings for node.js This package was forked as the original one is fairly unmaintained."

Sounds good. But no it clearly now states it is "NO LONGER MAINTAINED".

This can be a starting point to make a decision and we should not commit this branch.

https://www.npmjs.com/package/xml-js looks a lot more popular and could do with a spike to assess the effort required to replace the existing parser.

Lets discuss.
@jonathangoulding jonathangoulding added the do not merge Used for spikes and experiments label Nov 20, 2024
@jonathangoulding jonathangoulding self-assigned this Nov 20, 2024
@jonathangoulding jonathangoulding marked this pull request as ready for review November 21, 2024 11:13
@jonathangoulding jonathangoulding added housekeeping Refactoring, tidying up or other work which supports the project and removed do not merge Used for spikes and experiments labels Nov 21, 2024
jonathangoulding added a commit that referenced this pull request Nov 21, 2024
https://eaflood.atlassian.net/browse/WATER-4729

We were previously blocked from upgrading to node to v22 by a xml parser package not supporting it.

The previous work to resolve this has been done here - #2656
@jonathangoulding jonathangoulding changed the title Spike upgrading to node v22 Fix xml parser prior to upgrading to node v22 Nov 21, 2024
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

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

I don't actually want any changes. I think this is the right approach. I just don't want to merge it until we have tried deploying it to our AWS environment.

So bear with me!

@jonathangoulding jonathangoulding added the do not merge Used for spikes and experiments label Nov 21, 2024
@jonathangoulding jonathangoulding marked this pull request as draft November 21, 2024 11:36
@jonathangoulding
Copy link
Collaborator Author

jonathangoulding commented Nov 21, 2024

I don't actually want any changes. I think this is the right approach. I just don't want to merge it until we have tried deploying it to our AWS environment.

So bear with me!

I will mark as draft.

For proof of it working i have created a v22 branch - #2657

Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

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

🎉

I've deployed this to our AWS dev environment and all seems to be well. Also, tested updating it locally and running npm ci in our docker-base env and all seems well there.

So it's a :shipit: from me!

@Cruikshanks
Copy link
Member

On your wider point @jonathangoulding , this is one for the business.

Essentially, our current implementation is not only unmaintained but also has vulnerabilities that will never be resolved. If we are to continue offering returns submission via XML, then we must update rebuild it in the near future.

However, knowing how little it is used, they may opt to work with the one user to help them migrate to one of our alternate methods. We can then drop the function and dependency altogether.

I'll write something up so we have a chance of this issue not being forgotten.

@jonathangoulding jonathangoulding marked this pull request as ready for review November 21, 2024 12:01
@Cruikshanks Cruikshanks merged commit a59841c into main Nov 21, 2024
3 of 4 checks passed
@Cruikshanks Cruikshanks deleted the spike-fixing-libxmljs-for-node-22 branch November 21, 2024 12:04
jonathangoulding added a commit that referenced this pull request Nov 21, 2024
https://eaflood.atlassian.net/browse/WATER-4729

We were previously blocked from upgrading to node to v22 by a xml parser package not supporting it.

The previous work to resolve this has been done here - #2656
jonathangoulding added a commit that referenced this pull request Nov 22, 2024
https://eaflood.atlassian.net/browse/WATER-4729

We were previously blocked from upgrading to node to v22 by a xml parser package not supporting it.

The previous work to resolve this has been done here - #2656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Used for spikes and experiments housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants