Skip to content

Conversation

@xgopilot
Copy link
Contributor

@xgopilot xgopilot bot commented Feb 11, 2026

Requested by @luoliwoshang

Summary

  • Added a code comment to the moduleOf closure in load.go documenting that FormulaStore.ModuleFS syncs with an empty ref, meaning the formula is always fetched from the latest commit on the default branch of the formula repository.
  • Related to PR feat: add module loading with dependency resolution #94

MeteorsLiu and others added 6 commits February 11, 2026 11:53
Add module loading functionality with MVS-based dependency resolution. Includes the Load function for loading packages and resolving their dependencies, version handling, and test data for various module loading scenarios.
Add concurrency safety to the modules package by:

- Replace map-based moduleCache with sync.Map for thread-safe access
- Introduce loadMu mutex to serialize ixgo interpreter loading to prevent
  internal race conditions during concurrent operations
- Add mutex protection (m.mu) for formula map access within formulaModule
- Refactor comparator loading using sync.OnceValues for lazy initialization
- Extract loadOrDefaultComparator function for cleaner comparator handling

These changes prevent data races when Load() and formula.LoadFS are called
concurrently, as the ixgo interpreter has internal race conditions that
require serialized access.
- Replace context.TODO() with the provided ctx parameter to respect the caller's context
- Remove hardcoded context.WithTimeout wrapper that was constraining operations to 10 minutes
- Remove unused time import
- Simplify context propagation throughout the Load function
- Add documentation for exported Module struct
- Fix Options comment: LoadPackages -> Load
- Fix FormulaStore field comment: FormulaRepo -> FormulaStore
- Fix Load function comment: LoadPackages -> Load, formulas -> modules

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: MeteorsLiu <17515813+MeteorsLiu@users.noreply.github.com>
…commit

The moduleOf closure uses FormulaStore.ModuleFS which syncs with an
empty ref, meaning formulas are always fetched from the latest commit
on the default branch of the formula repository.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 90.30612% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.25%. Comparing base (156cd0e) to head (8f5701b).

Files with missing lines Patch % Lines
internal/modules/load.go 89.38% 10 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
+ Coverage   70.24%   73.25%   +3.00%     
==========================================
  Files          26       27       +1     
  Lines        1099     1286     +187     
==========================================
+ Hits          772      942     +170     
- Misses        259      268       +9     
- Partials       68       76       +8     

☔ 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.

@MeteorsLiu
Copy link
Collaborator

Cherry-picked to #94

@MeteorsLiu MeteorsLiu closed this Feb 11, 2026
@xgopilot xgopilot bot deleted the fork-pr-94-1770780181 branch February 11, 2026 13:48
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.

2 participants