Skip to content

Add Jenkins job trigger and improve CI link handling#6

Open
etnt wants to merge 3 commits into
sharyari:mainfrom
etnt:start-jenkins-job
Open

Add Jenkins job trigger and improve CI link handling#6
etnt wants to merge 3 commits into
sharyari:mainfrom
etnt:start-jenkins-job

Conversation

@etnt

@etnt etnt commented May 14, 2026

Copy link
Copy Markdown
  • Add 'J' key binding to start a Jenkins PR pipeline build from the UI, with a confirmation dialog showing job name and branch details
  • New py/jenkins.py module reads credentials from ~/.ghmanager_tokens (same as ghmanager) and triggers builds via Jenkins buildWithParameters API
  • Auto-refresh PR after successful trigger to pick up new CI status
  • Query dashboard API (dashboard.tail-f.com) for the latest build URL when pressing 'b', ensuring running builds are shown immediately
  • Construct correct dashboard URL format with branch path and build ID
  • Update help screen, CSS, config template, and README

Copilot AI review requested due to automatic review settings May 14, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class Jenkins triggering and improves CI link freshness by integrating Jenkins build start and a dashboard API lookup into the prtui workflow.

Changes:

  • Add J keybinding + modal confirmation to trigger a Jenkins PR pipeline build from the UI.
  • Introduce py/jenkins.py to read ~/.ghmanager_tokens and trigger buildWithParameters via Jenkins API.
  • Improve CI URL handling by querying dashboard.tail-f.com for the latest (including running) build URL.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Documents Jenkins integration setup and usage.
py/prtui.tcss Adds styling for the Jenkins confirmation modal.
py/prtui.py Adds J binding, confirmation screen, Jenkins trigger workflow, and dashboard-based CI open behavior.
py/jenkins.py New Jenkins client module: credential parsing, crumb fetch, and build trigger call.
py/ghapi.py Adds dashboard CI URL lookup and prefers it when determining CI URL.
Comments suppressed due to low confidence (1)

py/prtui.py:630

  • action_open_ci now performs a blocking HTTP request (ghapi.get_dashboard_ci_url(..., timeout=10)) on the UI thread. This can freeze the TUI while the request is in-flight or timing out. Consider moving the dashboard lookup into a background thread (similar to action_refresh_pr) and then opening the URL from call_from_thread, or rely on the already-stored ci_url from the last refresh when possible.
        table = self._focused_table()
        pr = self.prs.get(table.id or "", [])[table.cursor_row]
        # Try the dashboard API for the freshest build URL
        url = ghapi.get_dashboard_ci_url(pr.get("head_ref"))
        if not url:
            url = store.get_ci_url(repo, int(number))
        if not url:
            self.notify("No CI link found", severity="warning")
            return
        webbrowser.open(url)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread py/prtui.py Outdated
Comment thread py/prtui.py Outdated
Comment thread py/jenkins.py Outdated
Comment thread py/jenkins.py
- Add 'J' key binding to start a Jenkins PR pipeline build from the UI,
  with a confirmation dialog showing job name and branch details
- New py/jenkins.py module reads credentials from ~/.ghmanager_tokens
  (same as ghmanager) and triggers builds via Jenkins buildWithParameters API
- Auto-refresh PR after successful trigger to pick up new CI status
- Query dashboard API (dashboard.tail-f.com) for the latest build URL
  when pressing 'b', ensuring running builds are shown immediately
- Construct correct dashboard URL format with branch path and build ID
- Update help screen, CSS, config template, and README
@etnt etnt force-pushed the start-jenkins-job branch from b03d043 to 61f6343 Compare May 14, 2026 12:37
etnt added 2 commits May 20, 2026 09:40
- Add CI state column tracking: fetch combined commit status from GitHub
  to show ✓ (passed), ✗ (failed), or ◆ (running) in the CI column
- Add ci_state column to DB with migration for existing databases
- Re-fetch PRs with missing ci_state on poll to backfill existing rows
- Fix crumb URL path (add leading slash)
- Guard against None head_ref when opening CI links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants