Fix duplicate features in palletjack output and other upgrades - #415
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on preventing/cleaning duplicate Roadkill features in AGOL outputs and modernizing the Palletjack/Roadkill packaging + CI configuration.
Changes:
- Add a uniqueness guard for business-key IDs and switch AGOL writes to an upsert-style update.
- Introduce a one-off cleanup script to identify/delete duplicate AGOL features by business key.
- Migrate packaging from
setup.pytopyproject.toml(Hatchling) and update workflow/editor settings accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/palletjack/src/roadkill/test_main.py | Adds a pytest validating duplicate-ID detection behavior. |
| src/palletjack/src/roadkill/main.py | Adds _ensure_unique_ids, uses timezone-aware timestamps, switches to upsert/update, and adjusts handler cleanup + search selection. |
| src/palletjack/src/roadkill/config.py | Changes default log level from DEBUG to INFO. |
| src/palletjack/src/roadkill/cleanup_duplicates.py | New one-off script to find/delete duplicate AGOL features by business key. |
| src/palletjack/setup.py | Removes legacy setuptools-based packaging. |
| src/palletjack/pyproject.toml | Adds Hatchling packaging metadata + Ruff config modernization. |
| .vscode/settings.json | Updates spelling allowlist and Python tooling defaults. |
| .github/workflows/push_palletjack.yml | Updates CI cache dependency path and normalizes quoting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Enforced for: * comments * custom org name * first and last name (auto-truncated) Related to #416
This is intended to be reverted in the future once we have released the front end character limit enforcements
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/palletjack/src/roadkill/cleanup_duplicates.py:50
- _get_duplicate_object_ids paginates with result_offset/result_record_count but does not specify a stable sort order. Without an order_by_fields, offset pagination can skip or repeat features if the service does not guarantee a consistent default order, which can lead to incomplete duplicate detection/deletion sets.
result = layer.query(
where="1=1",
out_fields=f"{object_id_field},{id_column}",
return_geometry=False,
result_offset=offset,
result_record_count=max_record_count,
)
src/back/api/validation.js:26
- truncateOverlongComments destructures request.body unconditionally. If this middleware is ever invoked when request.body is undefined/non-object (e.g., unexpected content-type or upstream middleware failure), it will throw before calling next(), returning a 500 instead of allowing validation to handle it. Initialize/guard request.body before reading and writing comments.
export function truncateOverlongComments(request, _, next) {
const { comments } = request.body;
if (typeof comments === 'string' && comments.length > 512) {
acneville
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.