Skip to content

Conversation

@maksii
Copy link

@maksii maksii commented Jan 29, 2026

Add proper signal handling (SIGINT/SIGTERM) for a clean shutdown
Fix the WebUI server to respond to a single Ctrl+C
Should support Docker docker stop graceful shutdown
Improve startup/shutdown messages with a clickable URL

before

Starting Web UI server on 127.0.0.1:5000...
^C^C^C
asyncio.exceptions.CancelledError
KeyboardInterrupt

After

Web UI server started
Access at: http://localhost:5000
Press Ctrl+C to stop the server

^C
Received SIGINT, shutting down gracefully...
Web UI server stopped
Shutdown complete

webui "Kill and Clear" requires some rework on the UI side or server side to properly handle the kill event during execution, as it currently struggles to do so(when run in same proces without the use of UA_WEBUI_USE_SUBPROCESS).
As that's corner cases, even not sure if we should redo it or just adjust UI to block kill button, while process running(eg, wait till we get to some point, like confirmation ask)

Summary by CodeRabbit

  • New Features

    • Web UI can run in background mode with coordinated lifecycle, startup/shutdown sequencing, and displays the access URL.
  • Bug Fixes

    • Improved handling of interrupts and system signals for graceful, timeout-bounded cleanup.
    • Cleaner shutdown messaging and safer cross-thread shutdown synchronization.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds global shutdown state, signal handlers, a shutdown event, and web UI server lifecycle management; runs Waitress in a background thread for -webui, displays access URL, waits for shutdown to stop the server gracefully, and conditions async cleanup and final messaging on web UI vs non-web UI modes. (38 words)

Changes

Cohort / File(s) Summary
Shutdown State & Signal Handling
upload.py
Adds global shutdown variables and handlers (_reset_shutdown_state(), _handle_shutdown_signal(...)) and registers signal handlers to coordinate graceful termination on SIGINT/SIGTERM.
Web UI Lifecycle
upload.py
Introduces _shutdown_event and _webui_server, creates a Waitress server via create_server, starts a dedicated thread to serve the web UI when -webui is used, displays access URL, and waits on the shutdown event to stop the server gracefully.
Startup, Main Flow & Cleanup
upload.py
Resets shutdown state at startup, updates main entry to sequence web UI vs normal runs, handles KeyboardInterrupt/SystemExit to trigger shutdown, and conditions async cleanup and timeout-bound cleanup behavior on web UI mode; prints final shutdown message accordingly.

Sequence Diagram

sequenceDiagram
    participant Main as Main Process
    participant Sig as Signal Handler
    participant Web as Web UI Server (thread)
    participant Event as Shutdown Event

    Main->>Main: _reset_shutdown_state() & register signal handlers
    Main->>Web: start Waitress server thread (if -webui)
    Web->>Main: display access URL
    Note over Main,Web: serving requests

    Sig->>Event: receive SIGINT/SIGTERM -> set shutdown event
    Event->>Web: notify to stop
    Web->>Web: graceful shutdown, stop serving
    Event->>Main: allow cleanup to proceed
    Main->>Main: perform conditional async cleanup / timeout
    Main->>Main: print "Shutdown complete" and exit
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nudged the thread with a careful paw,

A tiny flag, a graceful close of law,
The web UI hummed, then softly slept,
Signals called, and promises were kept,
I hop away as logs say "shutdown" — aw.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: implementing graceful shutdown handling for both the upload script and web UI server, which aligns with the core modifications shown in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Analysis Results

🔍 Pyright Type Checking

=== Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Pyright ===
/home/runner/work/Upload-Assistant/Upload-Assistant/upload.py
  /home/runner/work/Upload-Assistant/Upload-Assistant/upload.py:1304:34 - error: "create_server" is unknown import symbol (reportAttributeAccessIssue)
1 error, 0 warnings, 0 informations

🧹 Ruff Lint

=== Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Ruff ===
W291 Trailing whitespace
 --> data/version.py:6:2
  |
4 | Release Notes for version v7.0.0 (2026-01-28):
5 |
6 | # 
  |  ^
7 | # ## RELEASE NOTES
8 | #  - Pushing this release as version 7, given the significant code changes.
  |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:20:2
   |
18 | #  - richardr1126 added arm64 support for docker.
19 | #  - CptCherry added TOS support. TOS has some specific support for using NFO files, as is required by their rules. See help for --kee…
20 | #  
   |  ^^
21 | #  ## SECURITY
22 | #  - There have been a number of changes in the UA coding process, with the specific intent of improving security.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:25:2
   |
23 | #  - Some of the changes protect against malicious attacks that could have occurred, under quite specific circumstances, such as attac…
24 | #  - There have been significant updates to the webui, see below.
25 | # 
   |  ^
26 | # ## CONFIG VALIDATION
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:29:2
   |
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
28 | # - Alternatively, for users new to Upload Assistant, the config editing in the webui will be useful.
29 | # 
   |  ^
30 | # ## New config options - see example.py
31 | #  - suppress_warnings - which will suppress config validation warnings.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:34:2
   |
32 | #  - Sharex image host.
33 | #  - rehash_cooldown - set in seconds. adds that specified small delay to trackers needing specific torrent rehashing, which allows al…
34 | # 
   |  ^
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:37:2
   |
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
37 | #  
   |  ^^
38 | # ## Aither/LST trump processing
39 | # - For the initial rollout, this will only work in full manual mode.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:51:2
   |
49 | # - In debug mode. it will do everything except actually file the report.
50 | # - This process will be streamlined in the future, to further increase automation and reduce prompting.
51 | # 
   |  ^
52 | # ## WEBUI
53 | # - User who have previously run the webui, should take particular note at the changes.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:58:2
   |
56 | # - See other docs in https://github.com/Audionut/Upload-Assistant/tree/master/docs
57 | # - Expect some further refinement on the config pages.
58 | # 
   |  ^
59 | # ---
60 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:60:2
   |
58 | # 
59 | # ---
60 | # 
   |  ^
61 | # ## What's Changed
62 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:62:2
   |
60 | # 
61 | # ## What's Changed
62 | # 
   |  ^
63 | # * manual dispatch latest by @Audionut in bfb5780
64 | # * YUS: Updated Banned Release Groups (#1090) by @FortKnox1337 in f5e1b25
   |
help: Remove trailing whitespace

W291 Trailing whitespace
   --> data/version.py:200:2
    |
198 | # * fix(LCD): resolution mapping for 1080i (#1184) by @wastaken7 in 1c2d7db
199 | # * release notes by @Audionut in 185e7dc
200 | # 
    |  ^
201 | # **Full Changelog**: https://github.com/Audionut/Upload-Assistant/compare/v6.3.2...v7.0.0
202 | """
    |
help: Remove trailing whitespace

ARG001 Unused function argument: `frame`
  --> upload.py:75:42
   |
75 | def _handle_shutdown_signal(signum: int, frame: Any) -> None:
   |                                          ^^^^^
76 |     """Handle SIGTERM/SIGINT for graceful shutdown."""
77 |     global _shutdown_requested, _webui_server
   |

SIM105 Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass`
  --> upload.py:89:13
   |
87 |           # If running webui, close the server
88 |           if _webui_server is not None:
89 | /             try:
90 | |                 _webui_server.close()
91 | |             except Exception:
92 | |                 pass
   | |____________________^
93 |       else:
94 |           # Second signal = force exit
   |
help: Replace `try`-`except`-`pass` with `with contextlib.suppress(Exception): ...`

Found 13 errors.
No fixes available (12 hidden fixes can be enabled with the `--unsafe-fixes` option).

🔒 Bandit Security Analysis

=== Python 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Bandit ===
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: B603,B703,B605,B110,B607,B108,B404
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[main]	INFO	using config: bandit.yaml
[main]	INFO	running on Python 3.10.19
[tester]	WARNING	nosec encountered (B112), but no failed test on line 213
[tester]	WARNING	nosec encountered (B112), but no failed test on line 226
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:09
Run started:2026-01-29 09:58:08.752050+00:00

Test results:
>> Issue: [B104:hardcoded_bind_all_interfaces] Possible binding to all interfaces.
   Severity: Medium   Confidence: Medium
   CWE: CWE-605 (https://cwe.mitre.org/data/definitions/605.html)
   More Info: https://bandit.readthedocs.io/en/1.9.3/plugins/b104_hardcoded_bind_all_interfaces.html
   Location: ./upload.py:1326:54
1325	                # Build clickable URL (use localhost for 0.0.0.0 display)
1326	                display_host = "localhost" if host == "0.0.0.0" else host
1327	                url = f"http://{display_host}:{port}"

--------------------------------------------------

Code scanned:
	Total lines of code: 55096
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 22

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
Files skipped (0):

=== Python 3.9 — Bandit ===
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: B108,B605,B703,B603,B607,B404,B110
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[main]	INFO	using config: bandit.yaml
[main]	INFO	running on Python 3.9.25
[tester]	WARNING	nosec encountered (B112), but no failed test on line 213
[tester]	WARNING	nosec encountered (B112), but no failed test on line 226
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:10
Run started:2026-01-29 09:58:24.112537

Test results:
>> Issue: [B104:hardcoded_bind_all_interfaces] Possible binding to all interfaces.
   Severity: Medium   Confidence: Medium
   CWE: CWE-605 (https://cwe.mitre.org/data/definitions/605.html)
   More Info: https://bandit.readthedocs.io/en/1.8.6/plugins/b104_hardcoded_bind_all_interfaces.html
   Location: ./upload.py:1326:54
1325	                # Build clickable URL (use localhost for 0.0.0.0 display)
1326	                display_host = "localhost" if host == "0.0.0.0" else host
1327	                url = f"http://{display_host}:{port}"

--------------------------------------------------

Code scanned:
	Total lines of code: 55096
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 21

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
Files skipped (0):

This comment was automatically generated by the CI pipeline.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@upload.py`:
- Around line 75-97: The custom signal handler _handle_shutdown_signal currently
swallows the first SIGINT which prevents asyncio.run() from receiving
KeyboardInterrupt; update _handle_shutdown_signal so that for SIGINT when not
running webui (i.e., _webui_server is None) you delegate to the default INT
handler or re-raise KeyboardInterrupt instead of just setting _shutdown_event,
while preserving the graceful shutdown path for webui runs (keep setting
_shutdown_requested, _shutdown_event and closing _webui_server when present);
ensure SIGTERM behavior remains the graceful shutdown path and only call
signal.default_int_handler(signum, frame) or raise SystemExit/KeyboardInterrupt
for non-webui SIGINT to allow asyncio task cancellation.

@github-actions
Copy link

🔍 Code Analysis Results

🔍 Pyright Type Checking

=== Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Pyright ===
/home/runner/work/Upload-Assistant/Upload-Assistant/upload.py
  /home/runner/work/Upload-Assistant/Upload-Assistant/upload.py:1307:34 - error: "create_server" is unknown import symbol (reportAttributeAccessIssue)
1 error, 0 warnings, 0 informations

🧹 Ruff Lint

=== Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Ruff ===
W291 Trailing whitespace
 --> data/version.py:6:2
  |
4 | Release Notes for version v7.0.0 (2026-01-28):
5 |
6 | # 
  |  ^
7 | # ## RELEASE NOTES
8 | #  - Pushing this release as version 7, given the significant code changes.
  |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:20:2
   |
18 | #  - richardr1126 added arm64 support for docker.
19 | #  - CptCherry added TOS support. TOS has some specific support for using NFO files, as is required by their rules. See help for --kee…
20 | #  
   |  ^^
21 | #  ## SECURITY
22 | #  - There have been a number of changes in the UA coding process, with the specific intent of improving security.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:25:2
   |
23 | #  - Some of the changes protect against malicious attacks that could have occurred, under quite specific circumstances, such as attac…
24 | #  - There have been significant updates to the webui, see below.
25 | # 
   |  ^
26 | # ## CONFIG VALIDATION
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:29:2
   |
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
28 | # - Alternatively, for users new to Upload Assistant, the config editing in the webui will be useful.
29 | # 
   |  ^
30 | # ## New config options - see example.py
31 | #  - suppress_warnings - which will suppress config validation warnings.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:34:2
   |
32 | #  - Sharex image host.
33 | #  - rehash_cooldown - set in seconds. adds that specified small delay to trackers needing specific torrent rehashing, which allows al…
34 | # 
   |  ^
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:37:2
   |
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
37 | #  
   |  ^^
38 | # ## Aither/LST trump processing
39 | # - For the initial rollout, this will only work in full manual mode.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:51:2
   |
49 | # - In debug mode. it will do everything except actually file the report.
50 | # - This process will be streamlined in the future, to further increase automation and reduce prompting.
51 | # 
   |  ^
52 | # ## WEBUI
53 | # - User who have previously run the webui, should take particular note at the changes.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:58:2
   |
56 | # - See other docs in https://github.com/Audionut/Upload-Assistant/tree/master/docs
57 | # - Expect some further refinement on the config pages.
58 | # 
   |  ^
59 | # ---
60 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:60:2
   |
58 | # 
59 | # ---
60 | # 
   |  ^
61 | # ## What's Changed
62 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:62:2
   |
60 | # 
61 | # ## What's Changed
62 | # 
   |  ^
63 | # * manual dispatch latest by @Audionut in bfb5780
64 | # * YUS: Updated Banned Release Groups (#1090) by @FortKnox1337 in f5e1b25
   |
help: Remove trailing whitespace

W291 Trailing whitespace
   --> data/version.py:200:2
    |
198 | # * fix(LCD): resolution mapping for 1080i (#1184) by @wastaken7 in 1c2d7db
199 | # * release notes by @Audionut in 185e7dc
200 | # 
    |  ^
201 | # **Full Changelog**: https://github.com/Audionut/Upload-Assistant/compare/v6.3.2...v7.0.0
202 | """
    |
help: Remove trailing whitespace

ARG001 Unused function argument: `frame`
  --> upload.py:75:42
   |
75 | def _handle_shutdown_signal(signum: int, frame: Any) -> None:
   |                                          ^^^^^
76 |     """Handle SIGTERM/SIGINT for graceful shutdown."""
77 |     global _shutdown_requested, _webui_server
   |

SIM105 Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass`
  --> upload.py:89:13
   |
87 |           # If running webui, close the server (main thread handles exit via event)
88 |           if _webui_server is not None:
89 | /             try:
90 | |                 _webui_server.close()
91 | |             except Exception:
92 | |                 pass
   | |____________________^
93 |           else:
94 |               # Non-webui mode: raise to let asyncio handle task cancellation
   |
help: Replace `try`-`except`-`pass` with `with contextlib.suppress(Exception): ...`

Found 13 errors.
No fixes available (12 hidden fixes can be enabled with the `--unsafe-fixes` option).

🔒 Bandit Security Analysis

=== Python 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Bandit ===
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: B607,B605,B108,B110,B703,B404,B603
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[main]	INFO	using config: bandit.yaml
[main]	INFO	running on Python 3.10.19
[tester]	WARNING	nosec encountered (B112), but no failed test on line 213
[tester]	WARNING	nosec encountered (B112), but no failed test on line 226
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:09
Run started:2026-01-29 10:25:33.143829+00:00

Test results:
>> Issue: [B104:hardcoded_bind_all_interfaces] Possible binding to all interfaces.
   Severity: Medium   Confidence: Medium
   CWE: CWE-605 (https://cwe.mitre.org/data/definitions/605.html)
   More Info: https://bandit.readthedocs.io/en/1.9.3/plugins/b104_hardcoded_bind_all_interfaces.html
   Location: ./upload.py:1329:54
1328	                # Build clickable URL (use localhost for 0.0.0.0 display)
1329	                display_host = "localhost" if host == "0.0.0.0" else host
1330	                url = f"http://{display_host}:{port}"

--------------------------------------------------

Code scanned:
	Total lines of code: 55098
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 22

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
Files skipped (0):

=== Python 3.9 — Bandit ===
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: B703,B607,B108,B605,B603,B110,B404
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[main]	INFO	using config: bandit.yaml
[main]	INFO	running on Python 3.9.25
[tester]	WARNING	nosec encountered (B112), but no failed test on line 213
[tester]	WARNING	nosec encountered (B112), but no failed test on line 226
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
[tester]	WARNING	nosec encountered (B105), but no failed test on line 2046
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:10
Run started:2026-01-29 10:25:42.245525

Test results:
>> Issue: [B104:hardcoded_bind_all_interfaces] Possible binding to all interfaces.
   Severity: Medium   Confidence: Medium
   CWE: CWE-605 (https://cwe.mitre.org/data/definitions/605.html)
   More Info: https://bandit.readthedocs.io/en/1.8.6/plugins/b104_hardcoded_bind_all_interfaces.html
   Location: ./upload.py:1329:54
1328	                # Build clickable URL (use localhost for 0.0.0.0 display)
1329	                display_host = "localhost" if host == "0.0.0.0" else host
1330	                url = f"http://{display_host}:{port}"

--------------------------------------------------

Code scanned:
	Total lines of code: 55098
	Total lines skipped (#nosec): 0
	Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 21

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 1
		High: 0
Files skipped (0):

This comment was automatically generated by the CI pipeline.

…waitress import. fix for related Code Analysis Results
@github-actions
Copy link

🔍 Code Analysis Results

🧹 Ruff Lint

=== Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Ruff ===
W291 Trailing whitespace
 --> data/version.py:6:2
  |
4 | Release Notes for version v7.0.0 (2026-01-28):
5 |
6 | # 
  |  ^
7 | # ## RELEASE NOTES
8 | #  - Pushing this release as version 7, given the significant code changes.
  |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:20:2
   |
18 | #  - richardr1126 added arm64 support for docker.
19 | #  - CptCherry added TOS support. TOS has some specific support for using NFO files, as is required by their rules. See help for --kee…
20 | #  
   |  ^^
21 | #  ## SECURITY
22 | #  - There have been a number of changes in the UA coding process, with the specific intent of improving security.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:25:2
   |
23 | #  - Some of the changes protect against malicious attacks that could have occurred, under quite specific circumstances, such as attac…
24 | #  - There have been significant updates to the webui, see below.
25 | # 
   |  ^
26 | # ## CONFIG VALIDATION
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:29:2
   |
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
28 | # - Alternatively, for users new to Upload Assistant, the config editing in the webui will be useful.
29 | # 
   |  ^
30 | # ## New config options - see example.py
31 | #  - suppress_warnings - which will suppress config validation warnings.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:34:2
   |
32 | #  - Sharex image host.
33 | #  - rehash_cooldown - set in seconds. adds that specified small delay to trackers needing specific torrent rehashing, which allows al…
34 | # 
   |  ^
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:37:2
   |
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
37 | #  
   |  ^^
38 | # ## Aither/LST trump processing
39 | # - For the initial rollout, this will only work in full manual mode.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:51:2
   |
49 | # - In debug mode. it will do everything except actually file the report.
50 | # - This process will be streamlined in the future, to further increase automation and reduce prompting.
51 | # 
   |  ^
52 | # ## WEBUI
53 | # - User who have previously run the webui, should take particular note at the changes.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:58:2
   |
56 | # - See other docs in https://github.com/Audionut/Upload-Assistant/tree/master/docs
57 | # - Expect some further refinement on the config pages.
58 | # 
   |  ^
59 | # ---
60 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:60:2
   |
58 | # 
59 | # ---
60 | # 
   |  ^
61 | # ## What's Changed
62 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:62:2
   |
60 | # 
61 | # ## What's Changed
62 | # 
   |  ^
63 | # * manual dispatch latest by @Audionut in bfb5780
64 | # * YUS: Updated Banned Release Groups (#1090) by @FortKnox1337 in f5e1b25
   |
help: Remove trailing whitespace

W291 Trailing whitespace
   --> data/version.py:200:2
    |
198 | # * fix(LCD): resolution mapping for 1080i (#1184) by @wastaken7 in 1c2d7db
199 | # * release notes by @Audionut in 185e7dc
200 | # 
    |  ^
201 | # **Full Changelog**: https://github.com/Audionut/Upload-Assistant/compare/v6.3.2...v7.0.0
202 | """
    |
help: Remove trailing whitespace

Found 11 errors.
No fixes available (11 hidden fixes can be enabled with the `--unsafe-fixes` option).

This comment was automatically generated by the CI pipeline.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@upload.py`:
- Around line 1336-1347: The current shutdown loop only checks _shutdown_event
and can wait forever if server_thread (running _webui_server.run) dies silently;
modify the loop to also check server_thread.is_alive() each iteration and if the
thread is no longer alive, break the wait and surface the error (e.g., log/raise
an exception or set _shutdown_event) so shutdown proceeds; after detecting the
thread death, ensure _webui_server.close() and server_thread.join(timeout=5.0)
are still called to perform graceful cleanup.

@github-actions
Copy link

🔍 Code Analysis Results

🧹 Ruff Lint

=== Python 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 (identical results) — Ruff ===
W291 Trailing whitespace
 --> data/version.py:6:2
  |
4 | Release Notes for version v7.0.0 (2026-01-28):
5 |
6 | # 
  |  ^
7 | # ## RELEASE NOTES
8 | #  - Pushing this release as version 7, given the significant code changes.
  |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:20:2
   |
18 | #  - richardr1126 added arm64 support for docker.
19 | #  - CptCherry added TOS support. TOS has some specific support for using NFO files, as is required by their rules. See help for --kee…
20 | #  
   |  ^^
21 | #  ## SECURITY
22 | #  - There have been a number of changes in the UA coding process, with the specific intent of improving security.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:25:2
   |
23 | #  - Some of the changes protect against malicious attacks that could have occurred, under quite specific circumstances, such as attac…
24 | #  - There have been significant updates to the webui, see below.
25 | # 
   |  ^
26 | # ## CONFIG VALIDATION
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:29:2
   |
27 | # - UA now performs some config validation, and gives better feedback on hard loading errors. Did you accidentally edit out a pesky li…
28 | # - Alternatively, for users new to Upload Assistant, the config editing in the webui will be useful.
29 | # 
   |  ^
30 | # ## New config options - see example.py
31 | #  - suppress_warnings - which will suppress config validation warnings.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:34:2
   |
32 | #  - Sharex image host.
33 | #  - rehash_cooldown - set in seconds. adds that specified small delay to trackers needing specific torrent rehashing, which allows al…
34 | # 
   |  ^
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:37:2
   |
35 | # ## New command argument
36 | # - -ddc or --double-dupe-check, if you want to race uploads, but tend to lose, this arg will perform a secondary dupe check right bef…
37 | #  
   |  ^^
38 | # ## Aither/LST trump processing
39 | # - For the initial rollout, this will only work in full manual mode.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:51:2
   |
49 | # - In debug mode. it will do everything except actually file the report.
50 | # - This process will be streamlined in the future, to further increase automation and reduce prompting.
51 | # 
   |  ^
52 | # ## WEBUI
53 | # - User who have previously run the webui, should take particular note at the changes.
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:58:2
   |
56 | # - See other docs in https://github.com/Audionut/Upload-Assistant/tree/master/docs
57 | # - Expect some further refinement on the config pages.
58 | # 
   |  ^
59 | # ---
60 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:60:2
   |
58 | # 
59 | # ---
60 | # 
   |  ^
61 | # ## What's Changed
62 | # 
   |
help: Remove trailing whitespace

W291 Trailing whitespace
  --> data/version.py:62:2
   |
60 | # 
61 | # ## What's Changed
62 | # 
   |  ^
63 | # * manual dispatch latest by @Audionut in bfb5780
64 | # * YUS: Updated Banned Release Groups (#1090) by @FortKnox1337 in f5e1b25
   |
help: Remove trailing whitespace

W291 Trailing whitespace
   --> data/version.py:200:2
    |
198 | # * fix(LCD): resolution mapping for 1080i (#1184) by @wastaken7 in 1c2d7db
199 | # * release notes by @Audionut in 185e7dc
200 | # 
    |  ^
201 | # **Full Changelog**: https://github.com/Audionut/Upload-Assistant/compare/v6.3.2...v7.0.0
202 | """
    |
help: Remove trailing whitespace

Found 11 errors.
No fixes available (11 hidden fixes can be enabled with the `--unsafe-fixes` option).

This comment was automatically generated by the CI pipeline.

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.

1 participant