Skip to content

Add documentation for available audit event types

What does this MR do and why?

  1. Create a rake task to auto generate documentation for all the available audit event types.
  2. Also added it to the lefthook pre-push check so that the MR author updates the docs whenever a new audit event type YML is added.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Execute bundle exec rake gitlab:audit_event_types:check_docs to see if the docs are up to date or not.
  2. Execute bundle exec rake gitlab:audit_event_types:compile_docs to compile the latest doc.
  3. Visit the doc page, eg: http://gdk.test:3005/ee/administration/audit_event_streaming/audit_event_types.html and verify that a non-empty table is rendered.
  4. Add a new audit event type YML for testing by adding a file inside ee/config/audit_events/types/ directory OR you can also update any existing audit event type YML file.
  5. Run bundle exec rake gitlab:audit_event_types:check_docs again and ensure that it throws an error that the doc is outdated.
  6. Run bundle exec rake gitlab:audit_event_types:compile_docs to update the docs. Check the generated diff and ensure that it's correct.

We can also test by running the rake on terminal after updating the file manually and then re-running it again to fix the unintended changes to the docs. (see the screenshot below)

image

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #411557 (closed)

Edited by Huzaifa Iftikhar

Merge request reports