Skip to content

add settings to blueprint as json to represent user input for NORMAL mode  #1982

@klesh

Description

@klesh

Describe the solution you'd like

Each step is a independent PR
Step 1: create BlueprintSetting struct to represent user input from config-ui, provide proper api and save/load to/from db
Step 2: auto generate tasks when save to db

Blueprint setting json

{
    "ID": 0,
    "name": "MY BLUEPRINT",
    "tasks": [
        []
    ],
    "settings": {
        "version": "1.0",
        "connections": [
            {
                "connectionId": 1,
                "plugin": "github",
                "scope": [
                    {
                        "options": {
                            "owner": "merico-dev",
                            "repo": "lake"
                        },
                        "entities": [
                            "code",
                            "ticket"
                        ],
                        "transformation": {
                            "prType": "type/(.*)$",
                            "prComponent": "component/(.*)$",
                            "issueSeverity": "severity/(.*)$",
                            "issueComponent": "component/(.*)$",
                            "issuePriority": "^(highest|high|medium|low)$",
                            "issueTypeRequirement": "^(feat|feature|proposal|requirement)$",
                            "issueTypeBug": "^(bug|failure|error)$",
                            "issueTypeIncident": ""
                        }
                    },
                    {
                        "options": {
                            "owner": "merico-dev",
                            "repo": "lake"
                        },
                        "entities": [
                            "code",
                            "ticket"
                        ],
                        "transformation": {
                            "prType": "type/(.*)$",
                            "prComponent": "component/(.*)$",
                            "issueSeverity": "severity/(.*)$",
                            "issueComponent": "component/(.*)$",
                            "issuePriority": "^(highest|high|medium|low)$",
                            "issueTypeRequirement": "^(feat|feature|proposal|requirement)$",
                            "issueTypeBug": "^(bug|failure|error)$",
                            "issueTypeIncident": ""
                        }
                    }
                ]
            },
            {
                "connectionId": 1,
                "plugin": "gitlab",
                "scope": [
                    {
                        "options": {
                            "projectId": "1000"
                        },
                        "entities": [
                            "code",
                            "ticket"
                        ],
                        "transformation": {}
                    },
                    {
                        "options": {
                            "projectId": "2000"
                        },
                        "entities": [
                            "code",
                            "ticket"
                        ],
                        "transformation": {}
                    }
                ]
            },
            {
                "connectionId": 1,
                "plugin": "jenkins",
                "scope": [
                    {
                        "transformation": {},
                        "options": {},
                        "entities": [
                            "devops"
                        ]
                    }
                ]
            }
        ]
    },
    "cronConfig": "0 0 * * *",
    "enable": true
}

this BlueprintSetting should be easily utilized by config-ui.

And it would be convert to tasks before creating pipeline.
Either when saving to database or right before pipeline triggering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/feature-requestThis issue is a proposal for something new

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions