Skip to content

Conversation

@estellesoulard
Copy link
Contributor

@estellesoulard estellesoulard commented Nov 4, 2025

#3427

  • I had initially added some tests without any filters, but this led to a huge cassette with a lot of info (listing all events on a whole organization for the past hour). This is why I opted to always include a filter on the test project to limit this.

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 0% with 123 lines in your changes missing coverage. Please review.
✅ Project coverage is 1.77%. Comparing base (122b030) to head (a968a21).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
internal/services/audittrail/event_data_source.go 0.00% 114 Missing ⚠️
internal/services/audittrail/helpers.go 0.00% 8 Missing ⚠️
provider/sdkv2.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #3445      +/-   ##
=========================================
- Coverage    1.78%   1.77%   -0.01%     
=========================================
  Files         401     403       +2     
  Lines       44084   44207     +123     
=========================================
- Hits          786     784       -2     
- Misses      43211   43335     +124     
- Partials       87      88       +1     

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

@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from a2394cc to fe22129 Compare November 4, 2025 11:12
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch 2 times, most recently from 51a35a1 to 93bf6a6 Compare November 5, 2025 15:11
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from 93bf6a6 to 2f056d3 Compare November 5, 2025 17:28
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from f5a6215 to 12845fc Compare November 6, 2025 13:32
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from 0039116 to 982f867 Compare November 7, 2025 16:04
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from defd74e to a8b738e Compare November 7, 2025 16:38
@estellesoulard estellesoulard marked this pull request as ready for review November 7, 2025 16:47
"product_name": {
Type: schema.TypeString,
Description: "Scaleway product associated with the listed events in a hyphenated format",
Optional: true,
Copy link
Member

Choose a reason for hiding this comment

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

Is there a list of those product somewhere? It could be helpful to provide hint

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There appears to be no public list, and they're only pattern validated (no enum on sdk side).
I have contacted the team to see if they could add a list to their docs for those entries.
In the meantime I built a list from the sources and I included it in the .mds.

},
"service_name": {
Type: schema.TypeString,
Description: "Name of the service of the API call performed",
Copy link
Member

Choose a reason for hiding this comment

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

Is there a list of those service_name? It could be helpful to provide hinting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There appears to be no public list, and they're only pattern validated (no enum on sdk side).
I have contacted the team to see if they could add a list to their docs for those entries.
In the meantime I built a list from the sources and I included it in the .mds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The list is available from their ListProducts endpoint, however i'm not sure we'd want to add an API call in the Datasource function purely for informative value. Leaving it as is for now, let me know what you think!

},
{
PreConfig: func() { waitForAuditTrailEvents(t, ctx, auditTrailAPI, project) },
Config: fmt.Sprintf(`
Copy link
Member

Choose a reason for hiding this comment

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

Why all this step are required? You could have a single event and then define several blocks of data resource and perform checks on each of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed!! I have reworked the tests, should be better now :)

@estellesoulard estellesoulard marked this pull request as draft November 18, 2025 09:29
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from 5060ec7 to 39f1c26 Compare November 18, 2025 14:32
@estellesoulard estellesoulard force-pushed the feat/audit-trail-event-data-source branch from 7908e83 to a968a21 Compare November 19, 2025 13:47
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