Repository navigation
Conversation
Reviewer's GuideThe PR introduces mutmut-based mutation testing and broader unit coverage, refreshes and locks development dependencies, adds package discovery/versioning updates, fixes FeedItem diagnostics and typing, and updates CI triggers and tooling. Reviewers should verify the mutmut command works with the project’s pytest configuration and address the date-format test’s overwritten parametrized inputs. Sequence diagram for FeedItem creation validationsequenceDiagram
participant Caller
participant FeedItem
participant MonzoAuth
Caller->>FeedItem: _create()
FeedItem->>FeedItem: _validate_feed_params()
alt valid feed type and parameters
FeedItem->>MonzoAuth: make_request(path=/feed, method=POST, data=data)
else invalid feed type or missing required parameter
FeedItem-->>Caller: MonzoArgumentError
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/publish.yml" line_range="8" />
<code_context>
release:
types:
- published
+ push:
+ branches:
+ - main
</code_context>
<issue_to_address>
**Main pushes publish unreleased versions**
When a commit with a not-yet-published package version reaches `main` and the checks/build pass, `pypi-publish` builds and uploads the package to PyPI without a published release. `skip-existing` does not stop the first upload, so users receive the main-branch build and the later release cannot replace it.
Trigger publishing only from a published GitHub release and remove the `main` push trigger.
</issue_to_address>
### Comment 2
<location path="tests/test_helpers.py" line_range="54" />
<code_context>
+ date: The datetime object to convert.
+ expected_date_str: The expected string representation of the datetime object.
+ """
+ date = datetime(year=2024, month=6, day=1, hour=12, minute=34, second=56, tzinfo=UTC)
+ expected_date_str = "2024-06-01T12:34:56Z"
+ assert format_date(date) == expected_date_str
</code_context>
<issue_to_address>
**Other date cases go unchecked**
When `test_format_date` runs for a non-first parametrized case, `test_format_date` overwrites both parametrized arguments with the hard-coded 2024 date and string, so every case checks the same input. Regressions for other dates pass pytest, allowing `Transaction.fetch` to send incorrectly formatted `since` or `before` filters.
Use the parametrized `date` and `expected_date_str` directly in the assertion.
</issue_to_address>
### Comment 3
<location path="pyproject.toml" line_range="61-62" />
<code_context>
-name = "local"
+[tool.mutmut]
+source_paths = [ "monzo/" ]
+runner = "uv run --locked pytest"
+pytest_add_cli_args_test_selection= [ "tests/" ]
</code_context>
<issue_to_address>
**Mutation testing is absent from CI**
When a pull request or main push runs the UV workflow, the UV workflow runs pytest but never invokes mutmut, so CI does not check whether mutants survive and the stated mutation-testing improvement is not enforced on changes.
Add a CI step that runs mutmut, or otherwise make mutation-test results a required check.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 3 findings to address first, and adding push on main to the publish workflow can automatically publish artifacts for every qualifying commit, rather than only for a published release. Reverting the workflow stops future runs but cannot remove packages or other externally visible release artifacts already published.
Blocking findings: .github/workflows/publish.yml:8, tests/test_helpers.py:54, pyproject.toml:62
Improving testing by testing mut out mutants
Fixed dependencies
Summary by Sourcery
Improve project quality and release automation by adding mutation testing, expanding test coverage, updating dependencies, and fixing feed item validation.
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests:
Chores: