Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

fix: dev setup tweaks#83

Merged
christopherwxyz merged 4 commits into
officialunofficial:mainfrom
marthendalnunes:chore/dev-setup
Feb 3, 2026
Merged

fix: dev setup tweaks#83
christopherwxyz merged 4 commits into
officialunofficial:mainfrom
marthendalnunes:chore/dev-setup

Conversation

@marthendalnunes

@marthendalnunes marthendalnunes commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Description

This PR:

  • Makes make migrate report the latest migration dynamically instead of a stale hardcoded filename.
  • Fixes WAYPOINT_HUB__SHARD_INDICES parsing to accept comma‑separated values (no brackets). This was broken: .env.example uses WAYPOINT_HUB__SHARD_INDICES=1,2,3, but Config::load() would fail with “expected a string for key HUB.SHARD_INDICES”. You can reproduce on main with "WAYPOINT_HUB__SHARD_INDICES=1,2,3 cargo run" and see the config load error. Adds a comma_separated deserializer and a unit test for it.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I have verified that my changes do not introduce regressions

@christopherwxyz

Copy link
Copy Markdown
Contributor

@marthendalnunes I pushed a commit with some improvements:

Makefile fix:

  • sort -V is GNU-specific and unavailable on macOS
  • Replaced with sort which works since migrations use zero-padded numbers (001_, 002_, etc.)

comma_separated deserializer improvements:

  • Use idiomatic serde lifetime naming ('de instead of 'a)
  • Renamed inner enum from Value<T> to StringOrVec<U> for clarity
  • Added doc comment explaining the function's purpose
  • Added #[inline] attribute
  • Use str::trim instead of closure

Test coverage:

  • Added test for JSON array input: [1,2,3]
  • Added test for whitespace-only string
  • Added test for trailing/leading commas
  • Added test for invalid value error message
  • Consolidated into single test to avoid dead code warning

- Replace `sort -V` with `sort` in Makefile for macOS compatibility
  (zero-padded migration numbers sort correctly lexicographically)
- Use idiomatic serde lifetime naming (`'de` instead of `'a`)
- Rename inner enum to `StringOrVec` for clarity
- Add doc comment and `#[inline]` attribute
- Expand test coverage: JSON array, whitespace, trailing/leading commas
- Add error case test to verify parse failure messages
@marthendalnunes

marthendalnunes commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

@christopherwxyz thanks for the improvements. All look good, I just added a few extra comma_separated tests for:

  • Multiple consecutive commas (e.g., "1,,2,,3")
  • Only commas (e.g., ",,,")
  • Empty JSON array ([])
  • Single element JSON array ([42])
  • Negative number parsing error
  • Overflow parsing error
  • Single value as string (e.g., "42")

@christopherwxyz
christopherwxyz merged commit f8e68a2 into officialunofficial:main Feb 3, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants