DEV Community

project-laguardia
project-laguardia

Posted on

LuCI on MGMT - Day 7

Hurdle 7: Backtracking on ucode Files

Previously:

After some realization, it was discovered that ucode files were being omitted from the search results.

Luckily, LuCI on ucode is still in its early stages, so only a minimal amount of files were missed:

Hurdle 8: Identifying Any rpc Interop

Here are the results of the rpc code search:

Hurdle 9: Identifying Any ubus Interop

Here are the results of the ubus code search:

Hurdle 10: Identifying Any Other Languages Used

At this point, we need to ensure that we have identified all languages used in LuCI.

For this, we will be adding Enry to our dev chain. We will be using temporary installs to avoid polluting the system with Go dependencies.

Task 1: Setup Enry

$languages = & {
    $tmp = New-TemporaryFile | % { rm $_; ni $_ -ItemType Directory }
    & {
        pushd $tmp
        go mod init tempmod
        go get github.com/go-enry/enry
        go build -o ./enry github.com/go-enry/enry
        popd
    } | Write-Host
    & {
        pushd luci
        & "$tmp/enry" -all -json
        popd
    }
    rm -r $tmp -Force | Out-Null
} | ConvertFrom-Json
Enter fullscreen mode Exit fullscreen mode

When enry is used like this, it is only good for summarizing the languages within cwd. I will have to iterate over each file in order to create the language mapping that I want.

... (6 hours later) ...

Took a lot to get language detection working, but ~search.ps1 has been updated to use Enry to detect languages.

This should be the final hurdle in the research phase of porting LuCI to LuMI. A quick review of the updated results will be needed to make that determination.

Task 2: Reviewing the new results

A few new results were found:

At this point, we have a pretty good idea of what needs to be ported. We can even treat the search results as a sort of "porting roadmap."

The next 2 challenges are to organize the ports then also ensure that changes from LuCI can be propagated to LuMI.

Top comments (0)