Writing large jenkins plugin for embedded developers

Hi! Our team is planning to develop large Jenkins plugin to help embedded developers with testing of their products. Actual details will be described in spoiler below.

Concept details

Our customer is developing network embedded devices and uses Jenkins to build firmware for devices and test it. One day an idea came up to implement e2e testing using Groovy shared library. We called it Test Executor.

Main role of Test Executor is to:

  1. Upload build artifacts on NFS
  2. Power on devices using SNMP (devices preconfigured to boot from NFS)
  3. Execute some steps defined in YAML configuration. For example run command on device, run command locally, copy files between workspace and device using SCP, publish HTML reports, etc.

This shared library works successfully more than one year but has few cons. For example, we still have no way how to store actual hardware in a single place (device IPs, SNMP agents, port numbers, etc.).

Now we decided that a good way is to develop Jenkins plugin that will allow to store and configure Hardware Configuration through Jenkins configuration.

In future we plan to move all TestExecutor functionality to Jenkins plugin and share it with people. We hope it will allow to develop embedded solutions much easier.
Example of TestConfig.yaml located inside github repository:

  - id: ExecuteUnitTests
    enabled: true
    group: main_ci_setup
    timeout: 900
          - sh_command_to_run_unit_test
          type: GoogleTest
            - /tmp/Test-results.xml

In this example random free setup with devices will be picked by lockable resource plugin. Lockable resource plugin configured accordingly to HardwareConfiguration. On device with type central_node commands will be executed using sshCommand plugin. Report will be copied to the Jenkins agent (using the same plugin) and will be published by XUnit.

Here is the list of questions that I’m trying to find answer:

  1. Do we really need to move whole TestExecutor to Jenkins plugin. If nobody except us will use it, we will stop on moving HardwareConfiguration to Jenkins Global Configuration.
  2. Our library executes pipeline steps depending on YAML configuration (example can be found in concept details) Is it possible to call other pipeline plugins from plugin? Development would be much longer if we will implement sh, archiveArtifacts, sshCommand, parallel, lockableResources and lot of other steps by ourselves. If it is not possible, the best option for us would be using plugins as dependencies and write wrappers that will call their code directly without changes. Could somebody help with that with one plugin to understand concept?
  3. Where I can find up to date documentation to correctly understand how actually pipeline plugin works? What is actual difference between pipeline compatible plugins and regular? In which cases and where I need to use descriptors? Why when I tried to call other plugin from my plugin, I’ve got CPS warnings? Code sample below.
        FlowExecutionOwner flowExecutionOwner = context.get(FlowExecution.class).getOwner();
        DSL dsl = new DSL(flowExecutionOwner);
        BatchScriptStep batStep = new BatchScriptStep(script);
        StepExecution batStepExecution = batStep.start(context);
        dsl.invokeMethod("bat", script);
        DurableTaskStep taskStep = new BatchScriptStep(script);
        StepExecution execution = taskStep.start(context);

I will be very grateful for any help!