Skip to content

dev: extract tls optional before TLS setup (supersedes #1429)#1735

Merged
josecelano merged 1 commit intotorrust:developfrom
josecelano:1429-supersede-extract-tls-optional
May 7, 2026
Merged

dev: extract tls optional before TLS setup (supersedes #1429)#1735
josecelano merged 1 commit intotorrust:developfrom
josecelano:1429-supersede-extract-tls-optional

Conversation

@josecelano
Copy link
Copy Markdown
Member

Summary

Why

PR #1429 no longer applies cleanly to current develop. This PR carries the same behavioral intent while resolving code drift in current call sites.

Validation

  • cargo test -p torrust-axum-server -p torrust-axum-http-tracker-server -p torrust-axum-rest-tracker-api-server

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR supersedes #1429 by updating the TLS setup flow so make_rust_tls is only invoked after unwrapping the optional TLS configuration at call sites, and by changing make_rust_tls to accept a concrete TslConfig reference.

Changes:

  • Updated make_rust_tls to take &TslConfig instead of &Option<TslConfig>.
  • Updated tracker job and server/environment call sites to unwrap Option<TslConfig> before calling make_rust_tls.
  • Adjusted axum-server TLS unit tests to match the new make_rust_tls signature.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/bootstrap/jobs/tracker_apis.rs Unwraps optional TLS config before calling make_rust_tls when starting the Tracker API job.
src/bootstrap/jobs/http_tracker.rs Unwraps optional TLS config before calling make_rust_tls when starting the HTTP tracker job.
packages/axum-server/src/tsl.rs Changes make_rust_tls signature to accept &TslConfig and updates tests accordingly.
packages/axum-rest-tracker-api-server/src/server.rs Updates test TLS setup to unwrap optional TLS config before calling make_rust_tls.
packages/axum-rest-tracker-api-server/src/environment.rs Updates environment initialization TLS setup to unwrap optional TLS config before calling make_rust_tls.
packages/axum-http-tracker-server/src/server.rs Updates test TLS setup to unwrap optional TLS config before calling make_rust_tls.
packages/axum-http-tracker-server/src/environment.rs Updates environment initialization TLS setup to unwrap optional TLS config before calling make_rust_tls.

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

Comment thread packages/axum-server/src/tsl.rs
Comment thread packages/axum-server/src/tsl.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 74.28571% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.64%. Comparing base (bd5d120) to head (ddb4cfb).

Files with missing lines Patch % Lines
...ckages/axum-http-tracker-server/src/environment.rs 33.33% 1 Missing and 1 partial ⚠️
packages/axum-http-tracker-server/src/server.rs 33.33% 1 Missing and 1 partial ⚠️
...es/axum-rest-tracker-api-server/src/environment.rs 33.33% 1 Missing and 1 partial ⚠️
...ackages/axum-rest-tracker-api-server/src/server.rs 33.33% 1 Missing and 1 partial ⚠️
packages/axum-server/src/tsl.rs 95.65% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1735      +/-   ##
===========================================
+ Coverage    79.60%   79.64%   +0.03%     
===========================================
  Files          368      368              
  Lines        27049    27057       +8     
  Branches     27049    27057       +8     
===========================================
+ Hits         21532    21549      +17     
+ Misses        5238     5227      -11     
- Partials       279      281       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- extract optional TLS config before TLS setup\n- update bootstrap job call sites to pass concrete TslConfig references\n- preserve behavior when TLS is not configured
@josecelano josecelano force-pushed the 1429-supersede-extract-tls-optional branch from 9723099 to ddb4cfb Compare May 7, 2026 06:14
@josecelano
Copy link
Copy Markdown
Member Author

ACK ddb4cfb

@josecelano josecelano merged commit 4b5b4d8 into torrust:develop May 7, 2026
25 of 26 checks passed
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.

3 participants