Skip to content

Reduce resource access token AuditEvent queries

Serena Fang requested to merge sfang-audit-event-query-reduction into master

What does this MR do?

Minor refactor.

Instead of executing a query in the database 2-3 times, only execute it once by saving AuditEvent.last into a local variable. Also, fetch the specified AuditEvent by author_id instead of AuditEvent.last-- fetching the last one could cause flaky failures.

From !52543 (comment 494501938)

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Serena Fang

Merge request reports