• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Alan-Jowett / CoPilot-For-Consensus / 20728592266
81%

Build:
DEFAULT BRANCH: main
Ran 05 Jan 2026 08:44PM UTC
Jobs 27
Files 130
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Jan 2026 08:43PM UTC coverage: 76.989% (+0.1%) from 76.848%
20728592266

push

github

web-flow
Defer JWKS fetch to background thread to prevent service startup blocking (#746)

* Initial plan

* Make JWKS fetch non-blocking during middleware initialization

- Add defer_jwks_fetch parameter (default: True) to avoid blocking service startup
- Start background thread to fetch JWKS asynchronously during init
- Add thread-safe lock for JWKS cache updates
- Implement emergency on-demand JWKS fetch if request arrives before background fetch completes
- Wait up to 5 seconds for background thread if JWKS not yet loaded during first request
- Maintains backward compatibility with defer_jwks_fetch=False for synchronous behavior

Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>

* Add tests for deferred JWKS fetch and update existing tests

- Add test_middleware_deferred.py with comprehensive tests for deferred loading
- Test non-blocking initialization behavior
- Test emergency on-demand fetch when request arrives before background completes
- Test backward compatibility with defer_jwks_fetch=False
- Test thread-safe cache updates
- Update all existing tests to use defer_jwks_fetch=False for deterministic behavior
- All tests pass successfully

Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>

* Fix factory function to pass through defer_jwks_fetch parameter

- Add defer_jwks_fetch parameter to create_jwt_middleware factory function
- Default to True for deferred loading but allow override
- Pass parameter through to JWTMiddleware constructor
- Update docstring to document new parameter
- Addresses code review feedback

Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>

* Fix race condition and test issues from code review

- Add thread-safe locking to _fetch_jwks_with_retry for cache updates
- Remove unused imports (jwt, TestClient) from test_middleware_deferred.py
- Fix unused variable warning in test_deferred_jwks_fetch_emergency_on_demand
- Remove incorrect middleware usag... (continued)

30 of 47 new or added lines in 1 file covered. (63.83%)

6243 of 8109 relevant lines covered (76.99%)

0.86 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
17
52.31
10.47% adapters/copilot_auth/copilot_auth/middleware.py
Jobs
ID Job ID Ran Files Coverage
1 copilot_events - 20728592266.1 05 Jan 2026 08:46PM UTC 12
63.42
GitHub Action Run
2 copilot_schema_validation_integration - 20728592266.2 05 Jan 2026 08:45PM UTC 7
40.75
GitHub Action Run
3 copilot_embedding - 20728592266.3 05 Jan 2026 08:44PM UTC 3
92.0
GitHub Action Run
4 embedding - 20728592266.4 05 Jan 2026 08:44PM UTC 2
90.17
GitHub Action Run
5 copilot_vectorstore - 20728592266.5 05 Jan 2026 08:45PM UTC 8
71.73
GitHub Action Run
6 copilot_storage - 20728592266.6 05 Jan 2026 08:46PM UTC 6
72.57
GitHub Action Run
7 orchestrator - 20728592266.7 05 Jan 2026 08:45PM UTC 2
67.29
GitHub Action Run
8 copilot_metrics - 20728592266.8 05 Jan 2026 08:46PM UTC 6
41.74
GitHub Action Run
9 copilot_chunking - 20728592266.9 05 Jan 2026 08:44PM UTC 2
93.75
GitHub Action Run
10 copilot_reporting - 20728592266.10 05 Jan 2026 08:46PM UTC 5
73.17
GitHub Action Run
11 ingestion - 20728592266.11 05 Jan 2026 08:44PM UTC 5
82.34
GitHub Action Run
12 copilot_storage_integration - 20728592266.12 05 Jan 2026 08:45PM UTC 6
29.94
GitHub Action Run
13 copilot_schema_validation - 20728592266.13 05 Jan 2026 08:45PM UTC 7
87.46
GitHub Action Run
14 copilot_archive_fetcher_integration - 20728592266.14 05 Jan 2026 08:45PM UTC 9
45.68
GitHub Action Run
15 parsing - 20728592266.15 05 Jan 2026 08:44PM UTC 7
84.27
GitHub Action Run
16 copilot_draft_diff - 20728592266.16 05 Jan 2026 08:46PM UTC 6
98.77
GitHub Action Run
17 copilot_auth - 20728592266.17 05 Jan 2026 08:45PM UTC 12
48.62
GitHub Action Run
18 chunking - 20728592266.18 05 Jan 2026 08:44PM UTC 2
83.25
GitHub Action Run
19 copilot_logging - 20728592266.19 05 Jan 2026 08:46PM UTC 7
71.7
GitHub Action Run
20 copilot_summarization - 20728592266.20 05 Jan 2026 08:46PM UTC 8
96.65
GitHub Action Run
21 copilot_consensus - 20728592266.21 05 Jan 2026 08:44PM UTC 3
98.67
GitHub Action Run
22 copilot_vectorstore_integration - 20728592266.22 05 Jan 2026 08:44PM UTC 8
20.29
GitHub Action Run
23 summarization - 20728592266.23 05 Jan 2026 08:45PM UTC 2
92.56
GitHub Action Run
24 copilot_config - 20728592266.24 05 Jan 2026 08:45PM UTC 14
75.44
GitHub Action Run
25 reporting - 20728592266.25 05 Jan 2026 08:46PM UTC 2
90.0
GitHub Action Run
26 copilot_events_integration - 20728592266.26 05 Jan 2026 08:46PM UTC 12
34.81
GitHub Action Run
27 copilot_archive_fetcher - 20728592266.27 05 Jan 2026 08:45PM UTC 9
67.49
GitHub Action Run
Source Files on build 20728592266
  • Tree
  • List 130
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20728592266
  • 1b678dad on github
  • Prev Build on main (#20728319907)
  • Next Build on main (#20735671210)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc