Skip to content

feat: store harvester version, errors and warnings - #172

Merged
turegjorup merged 3 commits into
developfrom
feature/8363-harvester-envelope
Nov 4, 2026
Merged

turegjorup merged 3 commits into
developfrom
feature/8363-harvester-envelope

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Link to ticket

https://leantime.itkdev.dk/#/tickets/showTicket/8363

Description

Store the harvester version, errors and warnings that the Python harvester sends with each detection result.

Changes:

  • DetectionResult gets harvesterVersion (nullable string), and errors and warnings (JSON lists, default []), all writable through the API. Results from the TypeScript harvester, which sends none of them, still validate.
  • Migration adds the columns and fills [] into existing rows before making the JSON columns NOT NULL.
  • PersistDetectionResultHandler keeps the hash as it is. An existing result takes the latest version, errors and warnings along with lastContact, without reprocessing.
  • Detection result admin: harvester version on the index, errors and warnings as formatted JSON on the detail page.
  • API spec regenerated.

Why: API Platform drops unknown fields, so the harvester's envelope was accepted and thrown away. Failed commands, such as the composer audit behind every docker result's "audit":"unknown", never reached ITKsites. Keeping the envelope out of the hash means a result shows its current errors without creating new rows.

No screenshots yet: the dev database holds a production dump from the TypeScript harvester, so the new fields are empty.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

@turegjorup turegjorup self-assigned this Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

API Specification - Non-breaking changes

API Changelog 1.0.0 vs. 1.0.0

API Changes

POST /api/detection_results

  • added the new optional request property errors (media type: application/json)
  • added the new optional request property errors (media type: application/ld+json)
  • added the new optional request property harvesterVersion (media type: application/json)
  • added the new optional request property harvesterVersion (media type: application/ld+json)
  • added the new optional request property warnings (media type: application/json)
  • added the new optional request property warnings (media type: application/ld+json)

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.84%. Comparing base (12fc5ac) to head (64ef2ba).
⚠️ Report is 26 commits behind head on develop.

Files with missing lines Patch % Lines
src/Entity/DetectionResult.php 78.94% 4 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #172      +/-   ##
=============================================
+ Coverage      69.27%   76.84%   +7.57%     
- Complexity      1300     1354      +54     
=============================================
  Files            168      172       +4     
  Lines           3987     4151     +164     
=============================================
+ Hits            2762     3190     +428     
+ Misses          1225      961     -264     
Flag Coverage Δ
unittests 76.84% <87.09%> (+7.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@turegjorup
turegjorup merged commit 525b276 into develop Nov 4, 2026
15 checks passed
@turegjorup
turegjorup deleted the feature/8363-harvester-envelope branch November 4, 2026 21:09
@turegjorup turegjorup mentioned this pull request Nov 4, 2026
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.

2 participants