Add documentation for available audit event types
What does this MR do and why?
- Create a rake task to auto generate documentation for all the available audit event types.
- 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.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Execute
bundle exec rake gitlab:audit_event_types:check_docs
to see if the docs are up to date or not. - Execute
bundle exec rake gitlab:audit_event_types:compile_docs
to compile the latest doc. - 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. - 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. - Run
bundle exec rake gitlab:audit_event_types:check_docs
again and ensure that it throws an error that the doc is outdated. - 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)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #411557 (closed)
Edited by Huzaifa Iftikhar