Refactored audit events for project creation and updation
What does this MR do and why?
Refactors project services to use Gitlab::Audit::Auditor for creating audit events for project creation and default branch updation.
- Adds new audit event types under
ee/config/audit_events/types
. - Adds default options for audit context author + target
How to set up and validate locally
- Setup external audit event streaming destination for a group by following steps here. Please note the group must have at least
Ultimate
licence. - All the audit events related to group will be sent to the endpoint added above.
- Perform following actions for the projects of the group and check the respective audit events on the remote destination is the event_type is coming for each one or not:
- Create a new project.
- Change the default branch of a project.
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.
Related to #374105 (closed)
Merge request reports
Activity
changed milestone to %15.11
assigned to @hraghuvanshi
1 Warning Please add a merge request subtype to this merge request. Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Marcos Rocha (
@mc_rocha
) (UTC-4, 9.5 hours behind@hraghuvanshi
)Mayra Cabrera (
@mayra-cabrera
) (UTC-6, 11.5 hours behind@hraghuvanshi
)test for spec/features/*
Mark Lapierre (
@mlapierre
) (UTC+10, 4.5 hours ahead of@hraghuvanshi
)Maintainer review is optional for test for spec/features/*
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 2 commits
- Resolved by Hitesh Raghuvanshi
added 146 commits
Toggle commit listadded 9 commits
-
4b189896...85dc78f8 - 2 commits from branch
master
- f93af22d - Refactored audit events for projects
- 337d3d74 - Added audit yml files
- 880c0de8 - Fixed failing rspecs
- 5540aaba - Fixed audit event feature spec
- 99e751d5 - Fixed audit event feature spec
- b7b31f20 - Replaced let with letitbe
- a4622327 - Fixed rspec query count
Toggle commit list-
4b189896...85dc78f8 - 2 commits from branch
added 869 commits
-
a4622327...3f1610fa - 868 commits from branch
master
- ad0571ae - Merge branch 'master' into 374105-refactor-project-audit-2
-
a4622327...3f1610fa - 868 commits from branch
19 19 "#{action_text} via system job. Reason: #{@details[:reason]}" 20 20 elsif impersonated_event? 21 21 "#{action_text} (by #{@details[:impersonated_by]})" 22 elsif @details[:author_class].to_s == "Gitlab::Audit::ImpersonatedAuthor" && 23 @details[:custom_message].present? 24 @details[:custom_message] changed this line in version 11 of the diff
added 233 commits
-
d7ecd9fc...2c30e772 - 232 commits from branch
master
- 908395da - Merge branch 'master' into 374105-refactor-project-audit-2
-
d7ecd9fc...2c30e772 - 232 commits from branch
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
- Resolved by Ethan Urie
requested review from @jmontal
changed milestone to %16.0
added missed:15.11 label
@jmontal
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
mentioned in issue #374105 (closed)
- Resolved by Ethan Urie
- Resolved by Ethan Urie
- Resolved by Ethan Urie
- Resolved by Ethan Urie
- Resolved by Harsha Muralidhar
- Resolved by Ethan Urie
- Resolved by Ethan Urie
- Resolved by Ethan Urie
@hraghuvanshi It's looking good. I left some questions and comments for you. Also, there appears to be a conflict that needs to be resolved.
added 997 commits
-
e5e6ff85...ba601d8b - 996 commits from branch
master
- 7a3a9129 - Merge branch 'master' into 374105-refactor-project-audit-2
-
e5e6ff85...ba601d8b - 996 commits from branch
1 Warning Please add a merge request subtype to this merge request. 1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Sashi Kumar Kumaresan (
@sashi_kumar
) (UTC+0, 5.5 hours behind@hraghuvanshi
)Charlie Ablett (
@cablett
) (UTC+12, 6.5 hours ahead of@hraghuvanshi
)test for spec/features/*
Harsha Muralidhar (
@hmuralidhar
) (UTC+10, 4.5 hours ahead of@hraghuvanshi
)Maintainer review is optional for test for spec/features/*
To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 260 commits
-
b33f7466...b44d1829 - 259 commits from branch
master
- 9b2b762c - Merge branch 'master' into 374105-refactor-project-audit-2
-
b33f7466...b44d1829 - 259 commits from branch
- Resolved by Ethan Urie
@hraghuvanshi It's looking good. I left some questions and comments for you. Also, there appears to be a conflict that needs to be resolved.
added 205 commits
-
9b2b762c...fd4b3ebc - 204 commits from branch
master
- a1ac0949 - Merge branch 'master' into 374105-refactor-project-audit-2
-
9b2b762c...fd4b3ebc - 204 commits from branch
requested review from @mlapierre
requested review from @hmuralidhar and removed review request for @mlapierre
- Resolved by Mark Lapierre
added 136 commits
-
fc6a74e5...4b60a358 - 135 commits from branch
master
- a8dcd6cd - Merge branch 'master' into 374105-refactor-project-audit-2
-
fc6a74e5...4b60a358 - 135 commits from branch
enabled an automatic merge when the pipeline for 3e11d5dc succeeds
mentioned in commit da5158da
added workflowstaging-canary label and removed workflowin review label
mentioned in issue #409538 (closed)
mentioned in commit 0d510792
mentioned in merge request !119396 (merged)
mentioned in issue gitlab-com/gl-infra/production#10785 (closed)
mentioned in issue gitlab-org/quality/pipeline-triage#196 (closed)
mentioned in commit 883e6c0a
Hello @hraghuvanshi and @eurie. This MR had to be reverted as it was identified as causing QA failures on staging canary, blocking deployments. Please see gitlab-com/gl-infra/production#10785 (closed) for more details.
@sabrams Sorry for the issue, and thanks for creating the revert MR. I will fix the issue and raise another MR.
No problem at all @hraghuvanshi! These things can be difficult to detect when developing.
added workflowcanary label and removed workflowstaging-canary label
Allure report
allure-report-publisher
generated test report!e2e-package-and-test:
test report for a8dcd6cdexpand test summary
+-------------------------------------------------------------+ | suites summary | +--------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +--------+--------+--------+---------+-------+-------+--------+ | Govern | 226 | 5 | 0 | 40 | 231 | ❌ | +--------+--------+--------+---------+-------+-------+--------+ | Total | 226 | 5 | 0 | 40 | 231 | ❌ | +--------+--------+--------+---------+-------+-------+--------+
added workflowstaging label and removed workflowcanary label
/cc @hraghuvanshi
We forgot to fix the E2E spec which blocked deployment to staging-canary. This line needs to be changed to reflect the new event name: https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa/specs/features/ee/browser_ui/10_govern/project/project_audit_logs_spec.rb#L44
Thanks @hmuralidhar for letting me know, I will fix this.
added workflowproduction label and removed workflowstaging label
mentioned in merge request !119462 (merged)
added releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!2145 (merged)