Skip to content

Add TUI tool for working with the Launchpad upload queue#15

Draft
Copilot wants to merge 33 commits intomainfrom
copilot/add-small-tui-tool
Draft

Add TUI tool for working with the Launchpad upload queue#15
Copilot wants to merge 33 commits intomainfrom
copilot/add-small-tui-tool

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 31, 2026

  • Add QUEUE_STATUSES list and export it from launchpad.py
  • Add QueueStatusScreen modal in app.py (modeled after SeriesScreen)
  • Add f3 key binding (action_switch_queue_status) to QueueApp
  • Track self.queue_status in QueueApp, default to QUEUE_STATUS_UNAPPROVED
  • Pass self.queue_status to get_queue_items() in all load paths
  • Add 7 tests for QueueStatusScreen and the queue status switching flow
  • All 77 tests pass, no new lint issues

Copilot AI linked an issue Mar 31, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits March 31, 2026 16:39
Create a standalone TUI tool for managing the Ubuntu Launchpad upload
queue. This initial commit provides the project skeleton with:

- pyproject.toml with dependencies (launchpadlib, textual)
- lp_queue/launchpad.py: LaunchpadQueue class and QueueItem dataclass
  with stub methods for connect, get_queue_items, get_debdiff, accept,
  and reject
- lp_queue/app.py: Textual TUI application with ReviewScreen,
  RejectScreen, and QueueApp with placeholder action handlers
- tests/test_launchpad.py: Initial unit tests
- README.md: Documentation and usage instructions

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/e30960b7-6a71-4012-be79-2b99750788cd

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Implement all LaunchpadQueue methods:
- connect(): authenticate via launchpadlib OAuth
- get_queue_items(): fetch upload queue with sync detection
- get_debdiff(): download source files and run debdiff, with
  changes file fallback for new packages
- accept(): delegate to LP acceptFromQueue API
- reject(): delegate to LP rejectFromQueue API with comment

Wire the TUI with async workers so network operations run in
background threads, keeping the UI responsive. Add comprehensive
tests for launchpad module (21 tests) and TUI app (5 async tests).

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/e30960b7-6a71-4012-be79-2b99750788cd

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Replace pytest.importorskip("subprocess") with a direct import of
subprocess.TimeoutExpired, since subprocess is a standard library
module that does not need conditional importing.

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/e30960b7-6a71-4012-be79-2b99750788cd

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot AI changed the title [WIP] Add small TUI to work with the Launchpad queue Add TUI tool for working with the Launchpad upload queue Mar 31, 2026
Copilot AI requested a review from Hyask March 31, 2026 16:50
@Hyask
Copy link
Copy Markdown
Collaborator

Hyask commented Apr 1, 2026

@copilot Great, now add a status bar to tell the user when something is happening in the background, such as "loading queue list", "fetching debdiff", etc...

@Hyask
Copy link
Copy Markdown
Collaborator

Hyask commented Apr 1, 2026

@copilot You encountered an issue last time, so let's try again.

Great, now make the status bar visible to tell the user when something is happening in the background, such as "loading queue list", "fetching debdiff", etc... It seems there is already something in the code, but it's not visible from the UI.

- Add width: 100% to .status-bar CSS so it spans the full terminal
- Add busy/error/success CSS classes with distinct background colors
- Update _set_status() to accept a state parameter and toggle classes
- Add emoji prefixes (⏳/❌/✔) to all status messages for clarity

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/01684a6e-0b54-4ab5-8ddc-0276a05e4f76

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot AI changed the title Add TUI tool for working with the Launchpad upload queue Make TUI status bar visible with state-based styling Apr 1, 2026
Copilot finished work on behalf of Hyask April 1, 2026 10:56
Copilot AI and others added 2 commits April 1, 2026 21:57
Add a RichLog-based debug panel below the DataTable that records every
Launchpad API call made by LaunchpadQueue.  The panel is hidden by
default and can be toggled with the ~ (Shift+backtick) shortcut.

Changes:
- launchpad.py: add set_log_callback() / _log() and instrument all
  LP API calls (connect, lp_user_name, get_queue_items, get_debdiff,
  accept, reject, _get_current_source)
- app.py: add #debug-panel Vertical with RichLog, CSS for
  hidden/visible states, "tilde" keybinding, and callback wiring
- tests: add TestDebugPanel (4 tests) and TestLaunchpadQueue log
  callback tests (2 tests)

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/88021ed5-9f29-4d2a-8064-d9c993cdcfaf

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot AI and others added 2 commits April 1, 2026 22:06
…es switcher

Add ConfirmScreen modal shown before Accept and Reject actions proceed.
Add SeriesScreen modal with F2 shortcut to list and switch Ubuntu series.
Add get_all_series() and switch_series() to LaunchpadQueue.
Add 15 new tests covering all new features (47 total).

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/3ae9d084-070e-4f70-b737-d967d21b0c9b

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot AI and others added 2 commits April 2, 2026 09:50
Replace _download_debian_source() and its helpers (_debian_pool_prefix,
_strip_epoch, _parse_dsc_files) with a new _get_debian_source() method
that uses lp.distributions["debian"].main_archive.getPublishedSources()
to locate Debian source packages, then downloads files via sourceFileUrls().

This removes manual URL construction, .dsc file parsing, and component
iteration in favor of the standard launchpadlib API.

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/292b2bdd-88a1-482b-9242-7fac594d9acd

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot finished work on behalf of Hyask April 2, 2026 09:53
Copilot AI and others added 2 commits April 2, 2026 12:24
- Remove _run_debdiff from imports (now an instance method)
- Update display_name assertions: space → slash separator
- Rewrite TestRunDebdiff to test via LaunchpadQueue instance with work_dir
- Fix timeout test to account for diffoscope+xdg-open calls before debdiff
- Update TestDebdiffSyncFallback for new get_debdiff flow:
  syncs go directly to _get_debian_source, _run_debdiff is instance method

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/deee44af-cb6c-4e3b-a4d1-c8f3efa5c789

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot finished work on behalf of Hyask April 2, 2026 12:28
@Hyask Hyask changed the title Make TUI status bar visible with state-based styling Add TUI tool for working with the Launchpad upload queue Apr 2, 2026
Copilot AI and others added 2 commits April 2, 2026 13:04
Use rich.syntax.Syntax with 'diff' lexer to render debdiff content
in the ReviewScreen's RichLog widget for better visual output.
Add test to verify the diff highlighter is used.

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/f1317c71-fe0e-4ec8-96c4-d3c88d27deed

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot finished work on behalf of Hyask April 2, 2026 13:06
- Add `authors` field to QueueItem dataclass
- Add `_extract_lp_username()` to extract LP usernames from API links
- Add `_build_authors()` to format author info per upload type:
  - Syncs: show the requestor
  - Regular uploads: show the signer, plus sponsor when different
- Add "Author(s)" column to the DataTable
- Add tests for new helpers and integration

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/a031ccbc-2261-4fbf-a64e-6cce2ff876f8

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
- Add QUEUE_STATUSES list in launchpad.py
- Add QueueStatusScreen modal (modeled after SeriesScreen)
- Add F3 key binding to open the queue status selector
- Track queue_status on QueueApp, default QUEUE_STATUS_UNAPPROVED
- Pass queue_status to all get_queue_items() call sites
- Add 7 tests for QueueStatusScreen and status switching flow

Agent-Logs-Url: https://github.com/ubuntu/ubuntu-release/sessions/9c52e4a6-3022-42fa-a9f7-1f2ecf7145ac

Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Copilot finished work on behalf of Hyask April 3, 2026 09:32
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.

Have a small TUI to work with the Launchpad queue

2 participants