Repository navigation
fix(plugins): return the opsgenie and pagerduty incidents collector error - #9357
Open
ShivamSharma43 wants to merge 1 commit into
Open
ShivamSharma43 wants to merge 1 commit into
ShivamSharma43 wants to merge 1 commit into
Conversation
…rror CollectIncidents in both plugins returned nil when NewStatefulApiCollectorForFinalizableEntity failed, e.g. when the previous collector state couldn't be loaded or the cursor over unfinished incidents failed. The subtask was marked successful without collecting anything, and the error was lost. Return it, like the Opsgenie teams and users collectors do. Closes apache#9356 Generated-by: Claude Code (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
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.
Summary
The Opsgenie and PagerDuty
collectIncidentssubtasks returnednilwhen their collector couldn't be created, so they were marked successful without collecting anything and the error was lost.Both
CollectIncidentsfunctions did this afterapi.NewStatefulApiCollectorForFinalizableEntity:The constructor fails when, for example, it can't load the previous collector state from
_devlake_collector_latest_state, or when the cursor over unfinished incidents fails in an incremental run. The pipeline then went on to extract and convert whatever raw data was already there.Changes:
plugins/opsgenie/tasks/incidents_collector.go,plugins/pagerduty/tasks/incidents_collector.go:return err, like the Opsgenie teams and users collectors.plugins/{opsgenie,pagerduty}/tasks/incidents_collector_test.go(new):TestCollectIncidentsReturnsCollectorSetupErrormakes the collector state query fail through a mockeddal.Daland checks thatCollectIncidentsreturns the error.Does this close any open issues?
Closes #9356
Screenshots
N/A
Other Information
go test ./plugins/opsgenie/tasks/ ./plugins/pagerduty/tasks/: pass. The new tests fail onmain(CollectIncidentsreturnsnil).go build,go vet,gofmtandgolangci-lint run ./plugins/opsgenie/... ./plugins/pagerduty/...: clean. The pagerduty e2e tests needE2E_DB_URL, which I didn't run locally; they don't reach this error path.return nilafter building its collector.pr-type/bug-fix.Generated-by:trailer per the ASF generative tooling guidance.🤖 Generated with Claude Code