Skip to content

Conversation

@maxim-lobanov
Copy link
Contributor

Context

We need to add new additional property for Node.js versions-manifest.json to show lts title based on https://raw.githubusercontent.com/nodejs/Release/main/schedule.json

We shouldn't implement any node-specific logic on manifest-generator level because we need to keep it generic.
I have decided to add support for custom expressions on config level.

How it works

Manifest generator imports lts_rule_expression from config, run it and use expression result as a source of rules for LTS decision

Drawbacks

It is not super convenient to keep PowerShell expression as a JSON property but it will allow us to stay generic.

How Node.js config will look like

{
    "regex": "node-\\d+\\.\\d+\\.\\d+-(\\w+)-(x\\d+)",
    "groups": {
        "arch": 2,
        "platform": 1
    },
    "lts_rule_expression": "(Invoke-RestMethod 'https://raw.githubusercontent.com/nodejs/Release/main/schedule.json').PSObject.Properties | Where-Object { $_.Value.codename } | ForEach-Object { @{ Name = $_.Name.TrimStart('v'); Value = $_.Value.codename } }"
}

@maxim-lobanov maxim-lobanov merged commit 46a901f into main Jun 16, 2021
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.

7 participants