Altinn / altinn2-convert

Command line tool for converting Altinn 2 reporting services into Altinn 3 apps.
MIT License
2 stars 4 forks source link

.NET 6 #4

Closed altinnadmin closed 2 years ago

altinnadmin commented 2 years ago

We should update this tool to use .NET 6 and latest C# instead of 3.1.

https://github.com/Altinn/altinn2-convert/blob/master/Altinn2Convert.csproj#L5

ivarne commented 2 years ago

Why? This will live for only 3 years (if you make the altinn 2 deadline), and is bound to run on windows because of CabLib. We already get warnings (and crashes) because CabLib is old.

altinnadmin commented 2 years ago

Why?

.NET 3.1 is unsupported in a year, and will not get security-patches. We shouldn't require app devs to have unsupported software installed on their machines.

Also, why not? It probably does not take many minutes to do.

ivarne commented 2 years ago

Sorry, I didn't consider the option of not finishing converting everything in a year. Seems that at least development on this tool should finished by that timeframe. Maybe that is not realistic?

altinnadmin commented 2 years ago

The tool should and could be finished well within a year, converting everything for every service owner in that timeframe is a much bigger challenge.

ivarne commented 2 years ago

Yea, there will be lots of manual cleanup after this tool has done its job. The list of special cases is just too long (I think),

One solution to the CabLib problem would be to do a preprocessing step that extracts the .xsn files from infopath (and deletes .dll files that might contain api secrets) so that the final conversion only needs to read .zip files. That would work very well if we manage to get the packages directly from the TUL database. I have a draft for a azure function app that takes all packages from a blob container and does this, but I don't get CabLib to work.

altinnadmin commented 2 years ago

there will be lots of manual cleanup

Yup, the tool can automate the most boring/repetitive and time consuming tasks (generating and "wiring up" layouts, data models and texts into a running app), but converting the business logic from C#/XPath must still be done manually.

One solution to the CabLib problem would be to do a preprocessing step

Yeah, that should be possible

ivarne commented 2 years ago

Another reason for not updating is microsofts love for hardcoding version in multiple places in a way that requires pretty deep understanding to figure out why (only) some of my breakpoints suddenly doesn't work.

image

This change definitely took more than "a few minutes". But update to net5.0 was required in order to reference image

altinnadmin commented 2 years ago

Heh, nice, but as you know, .NET 5 will soon not be good enough... :) https://github.com/Altinn/altinn-studio/issues/7219

ivarne commented 2 years ago

Let's hope I remember this little quirk when you update to 6 😄 and there still are no issues running CabLib.

I tried to create an azure function that extracted xsn files and renamed from GUID to {{ServiceOwnerCode}}/{{ServiceName}} when moving between storage containers, but I did not get CabLib to work (on dotnet 4.7). Currently I try to spend more time on translating more and more features, but checkbox is hard because of datamodel inconcistency.

altinnadmin commented 2 years ago

But update to net5.0 was required in order to reference...

Is this something you can create a PR for so we're on the same codebase?

ivarne commented 2 years ago

Are you actually working on this? I just assumed the relevance would mainly be for finished functionality, not half finished broken steps between.

altinnadmin commented 2 years ago

Nah, if it's WIP and half-broken it's better to wait :)

ivarne commented 2 years ago

Half finished - fully broken.

altinnadmin commented 2 years ago

Now running on .NET 6