Skip to content
flambchapPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

JenLea

A Lean 4 library for building Jenkins pipelines you can trust.

Goals

  1. Build pipelines in Lean. Describe Jenkins declarative pipelines (agents, stages, steps, when, post, …) as ordinary Lean data types instead of hand-written Groovy.
  2. Prove things about them. State and prove properties of those pipelines before they ever run, so whole classes of runtime failures can't happen. For example:
    • every stage runs on a real agent (no agent none without a per-stage agent);
    • every variable a step uses is declared, exactly once, before it is used;
    • deploy stages only run on main, and only after tests have passed.
  3. Generate Jenkinsfiles. Print a checked pipeline as a valid Jenkinsfile from a Lean program, so the file Jenkins runs is the one that was proved correct.

Approach

  • Model: the pipeline is plain Lean data, and a printer function turns it into Jenkinsfile text.
  • Checked output: only a pipeline bundled with a proof of its properties can be printed.
  • Groovy in script blocks: inline Groovy, top-level @Fields and helper functions are described by a small Groovy model, so they can be checked too. A raw Groovy escape hatch stays available for anything the model can't express yet.
  • Logic at build time: logic that needs a real program can run as a compiled Lean executable on the build agent, called from the pipeline (via sh), rather than as generated Groovy.

Limits

Proofs cover the model of the pipeline, not what shell scripts, Jenkins plugins, or Groovy itself do at runtime.

Status

Early exploration.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages