Resolve Decimal version to use v3#98
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates project dependencies to use Decimal 3.x (with an override guard for hex publishing), expands mix_audit to run in dev and test, and documents the Decimal security fix in the changelog. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Overriding
:decimalto~> 3.0in a library that depends onecto(which currently targetsdecimal2.x) risks subtle incompatibilities for downstream applications; it may be safer to leavedecimalunpinned here and document/communicate the advisory so consuming apps can manage the override themselves.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Overriding `:decimal` to `~> 3.0` in a library that depends on `ecto` (which currently targets `decimal` 2.x) risks subtle incompatibilities for downstream applications; it may be safer to leave `decimal` unpinned here and document/communicate the advisory so consuming apps can manage the override themselves.
## Individual Comments
### Comment 1
<location path="mix.exs" line_range="56" />
<code_context>
+ # Severity: moderate
+ # Vulnerable versions: >= 0.1.0, < 3.0.0
+ # First patched versions: 3.0.0
+ {:decimal, "~> 3.0", override: System.get_env("HEX_PUBLISH") != "true"}
]
end
</code_context>
<issue_to_address>
**🚨 issue (security):** Environment-dependent override may lead to different dependency trees between publish and non-publish builds.
Because `override` is tied to `HEX_PUBLISH`, dependency resolution differs between local and publish builds: locally you force Decimal `~> 3.0`, but during publish the override is off and transitive deps can select another version. This can both hide publish-time issues during local testing and allow a vulnerable Decimal version despite the advisory above. Please make the behavior consistent (e.g., always constrain/override `:decimal` and handle `HEX_PUBLISH` via profiles or lockfile management instead).
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| # Severity: moderate | ||
| # Vulnerable versions: >= 0.1.0, < 3.0.0 | ||
| # First patched versions: 3.0.0 | ||
| {:decimal, "~> 3.0", override: System.get_env("HEX_PUBLISH") != "true"} |
There was a problem hiding this comment.
🚨 issue (security): Environment-dependent override may lead to different dependency trees between publish and non-publish builds.
Because override is tied to HEX_PUBLISH, dependency resolution differs between local and publish builds: locally you force Decimal ~> 3.0, but during publish the override is off and transitive deps can select another version. This can both hide publish-time issues during local testing and allow a vulnerable Decimal version despite the advisory above. Please make the behavior consistent (e.g., always constrain/override :decimal and handle HEX_PUBLISH via profiles or lockfile management instead).
Fixes #97
Summary by Sourcery
Update dependencies to enforce Decimal v3 usage and mitigate a known DoS vulnerability.
Bug Fixes:
Enhancements:
Documentation: