Commit Graph

9 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] f1ce263b5a Update lockdown cache to initialize once per test function
Build and Test Go Project / build (windows-latest) (push) Has been cancelled
Build and Test Go Project / build (macos-latest) (push) Has been cancelled
Build and Test Go Project / build (ubuntu-latest) (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
License Check / license-check (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
- Added ResetInstance() function to lockdown package for test cleanup
- Updated lockdown_test.go to reset singleton before and after each test
- Updated issues_test.go to initialize cache once per test function (4 functions)
- Updated pullrequests_test.go to initialize cache once per test function (7 functions)
- All tests now explicitly reset and initialize cache at the beginning of each test function
- This prevents race conditions and ensures each test has proper cache state

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
2025-11-18 12:48:10 +00:00
JoannaaKL 2d630e5d57 Update mutexes 2025-11-18 11:28:25 +01:00
Copilot 5bba60add6 Make RepoAccessCache a singleton (#1426)
* Initial plan

* Implement RepoAccessCache as a singleton pattern

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Complete singleton implementation and verification

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Remove cacheIDCounter as requested

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
2025-11-18 11:15:46 +01:00
JoannaaKL 215b2db3b5 Use muesli for cache 2025-11-18 10:44:25 +01:00
Copilot b27f1e26ff [WIP] Replace custom cache in lockdown.go with cache2go struct (#1425)
* Initial plan

* Replace custom cache with cache2go library

- Added github.com/muesli/cache2go dependency
- Replaced custom map-based cache with cache2go.CacheTable
- Removed manual timer management (scheduleExpiry, ensureEntry methods)
- Removed timer field from repoAccessCacheEntry struct
- Updated GetRepoAccessInfo to use cache2go's Value() and Add() methods
- Updated SetTTL to flush and re-add entries with new TTL
- Used unique cache names per instance to avoid test interference
- All existing tests pass with the new implementation

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

* Final verification complete

Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JoannaaKL <67866556+JoannaaKL@users.noreply.github.com>
2025-11-18 10:19:09 +01:00
JoannaaKL e29a179d1f Unlock in defer 2025-11-17 17:24:25 +01:00
JoannaaKL 55623350cc Add cache 2025-11-17 16:57:50 +01:00
JoannaaKL 2f7f3abee4 Apply lockdown mode to issues and pull requests 2025-11-17 14:26:19 +01:00
JoannaaKL 2e5418093f Add lockdown mode to filter issue (#1371)
* Add lockdown mode to filter issue

* Update flag name

* Update pkg/lockdown/lockdown.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Merge two graphql queries into one

* Don't use Issue.Repository

* Add function signature

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 17:01:21 +01:00