Skip to content

Fix duplicate features in palletjack output and other upgrades - #415

Merged
stdavis merged 9 commits into
mainfrom
fix/palletjack-duplicates
Aug 10, 2026
Merged

Fix duplicate features in palletjack output and other upgrades#415
stdavis merged 9 commits into
mainfrom
fix/palletjack-duplicates

Conversation

@stdavis

@stdavis stdavis commented Aug 7, 2026

Copy link
Copy Markdown
Member

No description provided.

@stdavis
stdavis enabled auto-merge (rebase) August 7, 2026 18:59
@stdavis
stdavis requested a lite review from Copilot August 7, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to pyproject.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.

Comment thread src/palletjack/src/roadkill/main.py
Comment thread src/palletjack/src/roadkill/main.py Outdated
Comment thread src/palletjack/src/roadkill/cleanup_duplicates.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@stdavis
stdavis requested a review from acneville August 7, 2026 19:07
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
Comment thread src/back/app.js Dismissed
Comment thread src/back/app.js Dismissed
Comment thread src/back/app.js Dismissed
Comment thread src/back/app.js Dismissed
Comment thread src/back/app.js Dismissed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

@stdavis
stdavis merged commit 3573304 into main Aug 10, 2026
13 checks passed
@stdavis
stdavis deleted the fix/palletjack-duplicates branch August 10, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants