Skip to main content
  1. Posts/

Explain Error Plugin Updated Again—Two Practical New Features from User Feedback

·518 words·2 mins· ·
Xianpeng Shen
Author
Xianpeng Shen
DevOps & Build Engineer | Python Enthusiast | Open Source Maintainer
Table of Contents

Recently, I received some user feedback, and I immediately enhanced the Explain Error Plugin, adding two very practical features:

  1. Support for specifying the language of explanation content output
  2. Support for obtaining AI return values in Pipeline

This update makes the plugin more flexible and user-friendly in multilingual support and automated usage scenarios.

I. Support for Specifying the Language of Explanation Content Output
#

Background and Feature
#

In previous versions, the error explanation generated by the plugin was in English by default, which was not very user-friendly for non-English speakers.

Through PR #76, I added an optional language parameter to explainError(), allowing users to specify the language in which they want to receive the error explanation.

This means you can have AI explain Jenkins build failure logs in Chinese, Japanese, or other languages, better serving team members from different linguistic backgrounds.

How to Use
#

You can use it in a Jenkins Pipeline like this:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                sh 'make build'  // Simulate build process
            }
        }
    }
    post {
        failure {
            // Specify language as Chinese
            explainError(language: '中文')
        }
    }
}

With the above configuration, when a build fails, the plugin will pass the language parameter to the AI, which will then generate the error explanation content in the specified language.


II. Support for Return Values for Programmatic Use in Pipeline
#

Background and Feature
#

In some usage scenarios, users not only want to see the error explanation content in the Jenkins UI but also want to be able to obtain this content within the Pipeline script for further automated processing, such as sending notifications, emails, or pushing to chat tools.

Through PR #77, the plugin added return value support: now the explainError() step can return a string result, making it convenient to save and use within a Pipeline.

How to Use Return Values
#

Example Pipeline:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                sh 'make build'
            }
        }
    }
    post {
        failure {
            script {
                // Get the explanation content
                def explanation = explainError(language: '中文')
                echo "AI Explanation Result: ${explanation}"

                // You can do more automated processing here
                // e.g., send to Slack or email
            }
        }
    }
}

This way, you can not only see the AI-generated explanation content on the Jenkins page but also seamlessly integrate it into your CI/CD workflow.


Summary
#

FeatureDescription
🌐 Multilingual SupportAllows AI explanation content to be returned in a specified language (Chinese, Japanese, etc.) via the language: parameter.
🔁 Return Value SupportExplanation content can be returned as a Pipeline step value for automated processing.

These two new features make Explain Error Plugin even more practical in terms of internationalization and automation, and closer to real-world CI/CD usage scenarios.

Welcome to update to the latest version to experience these new features. If you have any suggestions or feedback, you are also very welcome to raise them on GitHub. Happy CI/CD! 🚀


Related

Jenkins Multibranch Pipeline

·405 words·2 mins
Discusses the use of Jenkins Multibranch Pipeline to manage multiple branches in a project, enabling parallel builds for pull requests and efficient code review processes.