# anurag-sisodiya/jenkins-chatbot-plugin architecture

> Architecture diagram of the GitHub repository anurag-sisodiya/jenkins-chatbot-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anurag-sisodiya/jenkins-chatbot-plugin
- Repository: https://github.com/anurag-sisodiya/jenkins-chatbot-plugin

## Overview

1. **What this repository is**
   - This is a **Jenkins plugin** named *Jenkins Console Chatbot Plugin*.
   - It lives entirely inside the Jenkins controller/runtime; there is **no separate application server** or standalone backend in the repo.
   - The plugin’s purpose is to add a chatbot panel to build consoles so users can ask questions about the current build’s logs and execution.

2. **Primary architectural boundary**
   - The main boundary is between **Jenkins core extension points** and the plugin’s own logic under `com.anurag.jenkins.chatbot`.
   - The plugin is built around standard Jenkins plugin concepts: **Action**, **RunListener**, and **GlobalConfiguration**.

3. **Build lifecycle integration**
   - `ChatbotRunListener` is the lifecycle hook into Jenkins builds.
   - This component is where the plugin can observe build events and associate chatbot behavior with a specific run.
   - Architecturally, it connects the Jenkins build execution stream to the chatbot feature set.

4. **Per-build UI surface**
   - `ChatbotAction` represents the build-scoped feature exposed in the Jenkins UI.
   - The action is rendered by `src/main/resources/.../ChatbotAction/index.jelly`, which is a classic Jenkins server-side view.
   - This is the main user-facing entry point from a build console page into the chatbot experience.

5. **Chatbot request/API layer**
   - `ChatbotApi` is the likely request-handling layer for interactions coming from the chatbot panel.
   - In architecture terms, it sits between the UI and whatever logic answers questions using build context.
   - Because this is a Jenkins plugin, these calls are expected to stay inside the Jenkins process and operate on the current build data.

6. **Global configuration**
   - `ChatbotGlobalConfiguration` provides instance-wide plugin settings.
   - The presence of `config.jelly` and the help files for `apiUrl` and `modelName` indicates configurable integration points for chatbot behavior.
   - This is the plugin’s global settings boundary: admin-configured values that affect all builds.

7. **UI resources and Jenkins views**
   - The `src/main/resources` Jelly files define the Jenkins configuration and build-page UI.
   - `src/main/webapp/help/*` provides inline Jenkins help text for configuration fields.
   - These resources show that the plugin uses Jenkins’ native UI rendering rather than a separate frontend application.

8. **Data flow through the plugin**
   - A build runs in Jenkins.
   - `ChatbotRunListener` observes the run and the plugin attaches or exposes `ChatbotAction`.
   - The build page loads the chatbot panel through the Jelly view.
   - User questions are handled through `ChatbotApi`, which uses the current build context and global settings to produce a response.

9. **Configuration vs. runtime context**
   - Global settings such as API endpoint and model name are stored in `ChatbotGlobalConfiguration`.
   - Runtime context comes from the active Jenkins build/run and is accessed through the action/listener path.
   - This separation is important for an architecture diagram: **admin configuration is global**, while **chat interaction is build-specific**.

10. **Packaging and platform**
   - The project is built with **Maven** and packaged as a Jenkins `.hpi` plugin.
   - `pom.xml`, `.mvn/*`, and `Jenkinsfile` indicate standard Java plugin build and CI flow.
   - This is a Java-based Jenkins extension, not a microservice or containerized app.

11. **Repository automation**
   - GitHub Actions are used for security scanning and release drafting.
   - `dependabot.yml` suggests dependency update automation.
   - These are repo/maintenance concerns, not part of the plugin’s runtime architecture, but they shape delivery and release flow.

12. **Testing boundary**
   - The test suite is small and centered on `ChatbotActionTest`.
   - That implies the most important verified behavior is likely the action/UI-facing plugin behavior rather than a large standalone service layer.

13. **What is notably absent**
   - There is no separate database, queue, message broker, or external service code in the repo tree.
   - The architecture appears intentionally lightweight: Jenkins plugin + Jenkins UI + plugin configuration + build-context interaction.

Main entry points: [`pom.xml`](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/pom.xml) (Jenkins Plugin), [`src/main/java/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration.java`](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration.java) (Global Config), [`src/main/java/com/anurag/jenkins/chatbot/ChatbotAction.java`](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotAction.java) (Chatbot Action), [`src/main/resources/com/anurag/jenkins/chatbot/ChatbotAction/index.jelly`](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/com/anurag/jenkins/chatbot/ChatbotAction/index.jelly) (Action View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Jenkins plugin runtime"]
  node_n1["Chatbot Action<br/>build action<br/>[ChatbotAction.java]"]
  node_n2["Run Listener<br/>lifecycle hook"]
  node_n3["Chatbot API<br/>request handler<br/>[ChatbotApi.java]"]
end

subgraph group_g2["Jenkins UI"]
  node_n5["Action View<br/>Jelly view<br/>[index.jelly]"]
  node_n9["Root View<br/>Jelly view<br/>[index.jelly]"]
end

subgraph group_g3["Plugin configuration"]
  node_n4["Global Config<br/>plugin config"]
  node_n6["Config View<br/>Jelly view<br/>[config.jelly]"]
  node_n7["Help apiUrl<br/>help text<br/>[help-apiUrl.html]"]
  node_n8["Help modelName<br/>help text"]
end

subgraph group_g4["Build and delivery"]
  node_n10["Jenkins Plugin<br/>packaging<br/>[pom.xml]"]
  node_n11["Maven Config<br/>build tool<br/>[maven.config]"]
  node_n12["Maven Extensions<br/>build tool<br/>[extensions.xml]"]
  node_n13["Jenkinsfile<br/>CI pipeline"]
  node_n14["Security Scan<br/>GitHub Action"]
  node_n15["Release Drafter<br/>GitHub Action"]
  node_n16["Action Test<br/>unit test"]
end

node_n2 -->|"attaches"| node_n1
node_n1 -->|"renders"| node_n5
node_n1 -->|"invokes"| node_n3
node_n3 -->|"uses settings"| node_n4
node_n2 -.->|"reads config"| node_n4
node_n4 -->|"configured by"| node_n6
node_n4 -.->|"explains"| node_n7
node_n4 -.->|"explains"| node_n8
node_n10 -->|"packages"| node_n1
node_n10 -->|"packages"| node_n4
node_n10 -->|"bundles"| node_n5
node_n10 -->|"bundles"| node_n6
node_n13 -->|"builds"| node_n10
node_n14 -.->|"checks"| node_n10
node_n15 -.->|"releases"| node_n10
node_n16 -->|"verifies"| node_n1
node_n9 -.->|"shares UI"| node_n5

click node_n1 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotAction.java"
click node_n2 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotRunListener.java"
click node_n3 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotApi.java"
click node_n4 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration.java"
click node_n5 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/com/anurag/jenkins/chatbot/ChatbotAction/index.jelly"
click node_n6 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration/config.jelly"
click node_n7 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/webapp/help/help-apiUrl.html"
click node_n8 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/webapp/help/help-modelName.html"
click node_n9 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/index.jelly"
click node_n10 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/pom.xml"
click node_n11 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.mvn/maven.config"
click node_n12 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.mvn/extensions.xml"
click node_n13 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/tree/main/Jenkinsfile"
click node_n14 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.github/workflows/jenkins-security-scan.yml"
click node_n15 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.github/workflows/release-drafter.yml"
click node_n16 "https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/test/java/com/anurag/jenkins/chatbot/ChatbotActionTest.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n1,node_n2,node_n3 toneBlue
class node_n5,node_n9 toneAmber
class node_n4,node_n6,node_n7,node_n8 toneMint
class node_n10,node_n11,node_n12,node_n13,node_n14,node_n15,node_n16 toneRose
```

## Components

### Jenkins plugin runtime

Core plugin classes running inside the Jenkins controller and build lifecycle.

- [Chatbot Action](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotAction.java): build action · Build-scoped entry point exposed on a run page. · `src/main/java/com/anurag/jenkins/chatbot/ChatbotAction.java`
- [Run Listener](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotRunListener.java): lifecycle hook · Observes Jenkins run events and connects builds to chatbot behavior. · `src/main/java/com/anurag/jenkins/chatbot/ChatbotRunListener.java`
- [Chatbot API](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotApi.java): request handler · Handles chatbot interactions using build context and plugin settings. · `src/main/java/com/anurag/jenkins/chatbot/ChatbotApi.java`

### Jenkins UI

Server-side views and build-page surfaces rendered by Jenkins.

- [Action View](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/com/anurag/jenkins/chatbot/ChatbotAction/index.jelly): Jelly view · Build-page UI for the chatbot action. · `src/main/resources/com/anurag/jenkins/chatbot/ChatbotAction/index.jelly`
- [Root View](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/index.jelly): Jelly view · Top-level Jelly resource used by the plugin UI. · `src/main/resources/index.jelly`

### Plugin configuration

Global settings and inline help exposed in Jenkins configuration.

- [Global Config](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/java/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration.java): plugin config · Stores instance-wide settings such as API endpoint and model name. · `src/main/java/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration.java`
- [Config View](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/resources/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration/config.jelly): Jelly view · Global configuration form rendered in Jenkins. · `src/main/resources/com/anurag/jenkins/chatbot/ChatbotGlobalConfiguration/config.jelly`
- [Help apiUrl](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/webapp/help/help-apiUrl.html): help text · Inline help for the API URL configuration field. · `src/main/webapp/help/help-apiUrl.html`
- [Help modelName](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/main/webapp/help/help-modelName.html): help text · Inline help for the model name configuration field. · `src/main/webapp/help/help-modelName.html`

### Build and delivery

Maven build, Jenkins CI, and repo automation files.

- [Jenkins Plugin](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/pom.xml): packaging · Maven-built Jenkins .hpi plugin packaging and metadata. · `pom.xml`
- [Maven Config](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.mvn/maven.config): build tool · Maven wrapper and extension settings for building the plugin. · `.mvn/maven.config`
- [Maven Extensions](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.mvn/extensions.xml): build tool · Maven extension wiring for the repository build. · `.mvn/extensions.xml`
- [Jenkinsfile](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/tree/main/Jenkinsfile): CI pipeline · Jenkins-based automation for building and validating the plugin. · `Jenkinsfile`
- [Security Scan](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.github/workflows/jenkins-security-scan.yml): GitHub Action · Workflow for Jenkins security scanning. · `.github/workflows/jenkins-security-scan.yml`
- [Release Drafter](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/.github/workflows/release-drafter.yml): GitHub Action · Workflow for preparing release drafts. · `.github/workflows/release-drafter.yml`
- [Action Test](https://github.com/anurag-sisodiya/jenkins-chatbot-plugin/blob/main/src/test/java/com/anurag/jenkins/chatbot/ChatbotActionTest.java): unit test · Focused test coverage for the build action behavior. · `src/test/java/com/anurag/jenkins/chatbot/ChatbotActionTest.java`

## Connections

- Run Listener → Chatbot Action: attaches · Run events lead to a build-scoped chatbot action.
- Chatbot Action → Action View: renders · The action is presented through the build-page Jelly view.
- Chatbot Action → Chatbot API: invokes · UI interactions from the action route into the API layer.
- Chatbot API → Global Config: uses settings · Request handling depends on global plugin configuration.
- Run Listener → Global Config: reads config · Lifecycle behavior can be influenced by instance-wide settings.
- Global Config → Config View: configured by · The config model is rendered by the Jenkins configuration view.
- Global Config → Help apiUrl: explains · Help text documents the API URL field.
- Global Config → Help modelName: explains · Help text documents the model name field.
- Jenkins Plugin → Chatbot Action: packages · The Maven plugin build packages the runtime classes.
- Jenkins Plugin → Global Config: packages · The build includes global configuration classes.
- Jenkins Plugin → Action View: bundles · Jelly resources are bundled with the plugin artifact.
- Jenkins Plugin → Config View: bundles · Configuration views ship inside the plugin artifact.
- Jenkinsfile → Jenkins Plugin: builds · Jenkins CI executes the plugin build.
- Security Scan → Jenkins Plugin: checks · Security scanning runs against the plugin project.
- Release Drafter → Jenkins Plugin: releases · Release automation prepares publishing metadata.
- Action Test → Chatbot Action: verifies · Tests focus on build-action behavior.
- Root View → Action View: shares UI · Repository Jelly resources support the plugin UI surface.
