Validate non-positive :stages values before materialization
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 1.6k
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
At master ef648c8f2f673793862acc9c87a9f2de2af15468, Flow.from_enumerable([1], stages: 0) accepts the option because Flow.stages/1 passes any present value through. During materialization, Flow.Materialize.start_stages/7 iterates 0..(stages - 1); non-positive values therefore form a descending range instead of being rejected as invalid stage counts. stages: -1 has the same problem, and non-integer values fail later with an arithmetic error. Expected: reject non-positive and non-integer :stages values with a clear ArgumentError before starting stages. Suggested regression coverage: zero, negative, and non-integer values across the flow constructors. Source references: lib/flow.ex:1539-1547 and lib/flow/materialize.ex:80-107.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Flow.stages/1 in lib/flow.ex:1539-1547 and follow its use into Flow.Materialize.start_stages/7 in lib/flow/materialize.ex:80-107. Add regression coverage for zero, negative, and non-integer :stages values across the flow constructors, and confirm each is rejected with a clear ArgumentError before materialization starts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100