🐛 Fix: Do not block on zero results from JSON endpoint.#66
Open
jbostoen wants to merge 1 commit intoCombodo:masterfrom
Open
🐛 Fix: Do not block on zero results from JSON endpoint.#66jbostoen wants to merge 1 commit intoCombodo:masterfrom
jbostoen wants to merge 1 commit intoCombodo:masterfrom
Conversation
Hipska
reviewed
Dec 31, 2025
Collaborator
Hipska
left a comment
There was a problem hiding this comment.
To me it looks like it should be a static instead. The child class can then override the value. The default value should be the current behavior.
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.
Base information
Symptom (bug) / Objective (enhancement)
I consider it a bug - you might consider it an enhancement.
For a custom collector, a JSON API may return an empty array (no results); even if the API call is successful.
This means the
Preparemethod results infalse, and this result is also returned byCollect.itop-data-collector-base/core/collector.class.inc.php
Lines 548 to 582 in f8077b5
Now, when
Collectreturnsfalse, this may break the orchestration (and thus prevents any subsequent and possibly non-related/non-dependent collectors to be executed).itop-data-collector-base/core/orchestrator.class.inc.php
Lines 235 to 249 in f8077b5
Reproduction procedure (bug)
Cause (bug)
See above.
Proposed solution (bug and enhancement)
I raise this PR for visibility, and for the technical explanation.
It offers one solution; where the developer of the collector decides whether no results should mean a full stop of processing.
It can of course be discussed if this should be an XML setting instead (my two cents: it should be in the implementation, it's not really a customization option); or where to catch it.
Perhaps the orchestrator logic should be addressed instead and still continue?
Or the setting could be on the orchestrator?
I believe the way I propose now, is probably the most flexible one; allow specifying it per collector.
Then of course: what should the default value be?
Don't stop processing seems to be the proper one; but this does mean it's a change from before?
Checklist before requesting a review
Checklist of things to do before PR is ready to merge
Decide on preferred solution.