Skip to content

[AV-128954] Add acceptance tests for events datasources#624

Open
panigrahisubhrajit wants to merge 5 commits into
mainfrom
AV-128954-acceptance-tests
Open

[AV-128954] Add acceptance tests for events datasources#624
panigrahisubhrajit wants to merge 5 commits into
mainfrom
AV-128954-acceptance-tests

Conversation

@panigrahisubhrajit
Copy link
Copy Markdown
Contributor

@panigrahisubhrajit panigrahisubhrajit commented May 29, 2026

Jira

Description

Adds acceptance tests for the events, event, project_events, and project_event datasources covering filtering, pagination, sort, time range, and error cases.

Also fixes a bug in the project_events datasource where omitting project_id produced a malformed URL (/projects//events), causing a 400 from the API. When project_id is not provided the datasource now falls back to the org-level events endpoint, which matches the optional schema declaration.

Type of Change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).

Manual Testing Approach

How was this change tested and do you have evidence? (REQUIRED: Select at least 1)

  • Acceptance tested

Testing

Testing

All 27 events acceptance tests passed manually against Azure and GCP clusters:

Pattern Result
TestAccDatasourceEvent* PASS
TestAccDatasourceEvents* PASS
TestAccDatasourceProjectEvent* PASS
TestAccDatasourceProjectEvents* PASS

Further comments

panigrahisubhrajit and others added 4 commits May 25, 2026 22:46
Covers org-level events (list, filter by project/cluster/severity, time
range, pagination, sort asc/desc, invalid org, missing required fields,
invalid sort direction), single event (happy path with runtime-fetched ID,
not-found, invalid org, missing id), project events (list with/without
project_id, pagination, sort, filter by cluster, invalid org, invalid sort),
and single project event (happy path, not-found, invalid project, missing
required fields).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When project_id is omitted the URL was built as /projects//events,
causing a 400 from the API. Fall back to the org-level events endpoint
when project_id is not provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 08:58
@panigrahisubhrajit panigrahisubhrajit requested a review from a team as a code owner May 29, 2026 08:58
@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request labels May 29, 2026
@factory-droid
Copy link
Copy Markdown
Contributor

factory-droid Bot commented May 29, 2026

Droid finished @panigrahisubhrajit's task —— View job


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds acceptance coverage for Capella Events-related datasources and fixes a URL construction bug in project_events when project_id is omitted, aligning runtime behavior with the datasource schema (optional project_id).

Changes:

  • Add a comprehensive acceptance test suite for events, event, project_events, and project_event datasources (filters, pagination/sort, time range, and error cases).
  • Fix project_events datasource URL generation to fall back to the org-level events endpoint when project_id is not provided.
  • Add coverage specifically validating project_events behavior when project_id is omitted.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/datasources/project_events.go Fixes malformed project events URL when project_id is omitted by falling back to org-level events endpoint.
acceptance_tests/events_acceptance_test.go Introduces acceptance tests for events/event/project_events/project_event datasources, including filtering, pagination, sorting, time range, and error scenarios.

Comment on lines +463 to +464
}

},
})
}

Copy link
Copy Markdown
Contributor

@factory-droid factory-droid Bot left a comment

Choose a reason for hiding this comment

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

Validated all candidates against the diff and reporting gate. No candidate met the approval bar for a concrete, actionable bug with a proven trigger path and observable incorrect behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants