Improve TiCS#16283
Merged
tomponline merged 23 commits intocanonical:mainfrom Aug 26, 2025
Merged
Conversation
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
kadinsayani
requested changes
Aug 25, 2025
There was a problem hiding this comment.
Pull Request Overview
This pull request improves TiCS (likely a code quality tool or static analysis) by addressing various code quality issues and enhancing error handling throughout the LXD codebase.
- Enhances error handling by properly checking return values from functions like
tcp.ExtractConn()andfile.Close() - Consolidates duplicate IP address scope detection logic into more concise conditional statements
- Adds test coverage for LXD subcommands and fork subcommands
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/suites/basic.sh | Adds comprehensive test coverage for LXD subcommands and fork subcommands |
| shared/ws/upgrader.go | Improves error handling for TCP connection extraction |
| shared/netutils/network_linux_cgo.go | Consolidates IP address scope detection logic |
| lxd/response/response.go | Enhances error checking for TCP connection extraction |
| lxd/resources/network.go | Consolidates duplicate IP scope detection code |
| lxd/migration_connection.go | Improves TCP connection error handling |
| lxd/metrics/metrics.go | Simplifies CPU device name parsing using strings.CutPrefix |
| lxd/main_forkfile.go | Moves root privilege check after help/version argument handling |
| lxd/instance_sftp.go | Adds proper error checking for TCP connection extraction |
| lxd/instance/drivers/driver_lxc.go | Adds bounds checking for filesystem stats parsing |
| lxd/api_internal.go | Improves error handling for root disk device detection |
| lxd-benchmark/benchmark/report.go | Enhances file closing error handling with proper logging |
| client/lxd_events.go | Adds error handling for connection info retrieval |
| client/lxd.go | Improves error handling for response body closing and event listeners |
| client/devlxd.go | Enhances TCP connection error checking |
Comments suppressed due to low confidence (1)
lxd/main_forkfile.go:1
- The variable
listenfdis being overwritten on line 34 without being used, which means the first argument retrieved on line 29 is lost. This appears to be a logic error in argument parsing.
package main
b6f817e to
042d74b
Compare
042d74b to
599b939
Compare
Point to `man 5 fstab` for a description of each fields. Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
…vice()` Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
This fixes a problem with the replaced implementation considering `127:db8::1` as a link local IP despite being a valid global IPv6. Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
599b939 to
3a7bdc6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.