How mrraj470/keypirinha-jenkins works
Project type and purpose
• This is a Keypirinha plugin written in Python whose sole responsibility is to let Keypirinha users quickly search and launch Jenkins jobs, agents, or labels in their web browser.
• It is not a full-stack web application but rather a desktop plugin that integrates with an external REST service (Jenkins).
File structure
• Top‐level files:
• sample_config_file.ini: example of how to configure one or more Jenkins endpoints and command names
• CHANGELOG.md, LICENSE, README.md: documentation and metadata
• make.cmd: build or packaging script for Windows
• src/ directory: the actual plugin code
• src/jenkins.py: main plugin entrypoint that implements Keypirinha’s plugin interface
• src/helper.py: utility functions (e.g. HTTP request wrappers, parsing)
• src/jenkins.ini: default plugin configuration shipped with the package
README for additional insights
• Describes two commands (jobs and agents), how they are named, how multi-section configuration lets you target multiple Jenkins servers
• Shows a GIF of interactive search and browser launching
a. Main components
1. Keypirinha Host (proprietary launcher)
2. Jenkins Plugin (Python scripts in src/)
3. Configuration Store (INI files: sample_config_file.ini, src/jenkins.ini, user overrides)
4. Jenkins Server(s) (one or more HTTP REST endpoints)
5. Web Browser (to open job/agent URLs)
b. Relationships & data flows
• On startup, Keypirinha Host loads the Jenkins Plugin
• Plugin reads configuration from the INI file(s)
• Plugin registers commands (e.g., “Jenkins-<section>:” and “Agent-<section>:”) with the host
• User invokes a command → Plugin issues HTTP GETs to Jenkins Server’s API
• User selects an item → Plugin calls OS “open URL” to launch Web Browser to the selected Jenkins job/agent page
c. Architectural patterns & design principles
• Event-driven plugin pattern: commands are callbacks triggered by Keypirinha
• Single-responsibility modules: jenkins.py for host integration; helper.py for network & parsing logic
• Config-driven behaviour: multi-section INI enables plugging in multiple servers without code changes
d. Key technologies/frameworks/libraries
• Python 3.x (Keypirinha requires 3.x plugin compatibility)
• Keypirinha plugin API
• Standard library modules (configparser, urllib or requests if vendored)
• OS default browser invocation