Skip to content

Add logging when an implementation issue is rejected

Robert Speicher requested to merge rs-implementation-issue-logging into master

This is a first iteration for gitlab-com/gl-infra/delivery#1162 (closed), which adds a log message when a security implementation issue is rejected, citing the reason.

Example logging from test:

release-tools rs-implementation-issue-logging % bat log/test.log| grep Reject
2020-09-04 13:55:18.463660 W [dry-run] ReleaseTools::Security::ImplementationIssue -- Rejecting implementation issue due to invalid merge requests -- {:url=>"https://gitlab.com/gitlab-org/security/gitlab/-/issues/1"}
2020-09-04 13:55:18.464939 W [dry-run] ReleaseTools::Security::ImplementationIssue -- Rejecting implementation issue due to invalid merge requests -- {:url=>"https://gitlab.com/gitlab-org/security/gitlab/-/issues/1"}
2020-09-04 13:55:18.465994 W [dry-run] ReleaseTools::Security::ImplementationIssue -- Rejecting implementation issue due to too few merge requests -- {:url=>"https://gitlab.com/gitlab-org/security/gitlab/-/issues/1"}
2020-09-04 13:55:18.468689 W [dry-run] ReleaseTools::Security::ImplementationIssue -- Rejecting implementation issue due to invalid merge requests -- {:url=>"https://gitlab.com/gitlab-org/security/gitlab/-/issues/1"}
2020-09-04 13:55:18.471000 W [dry-run] ReleaseTools::Security::ImplementationIssue -- Rejecting implementation issue due to disallowed project -- {:url=>"https://gitlab.com/gitlab-org/security/gitlab/-/issues/1"}

We can later expand the reject method to set an attribute on the instance, which we can add to the Slack message.

Merge request reports

Loading