Skip to content

Log QA resource reuse

Mark Lapierre requested to merge ml-log-resource-reuse into master

What does this MR do and why?

Changes the debug log message shown when a resource is fabricated.

  • "Built" as previously, when a resource is created.
  • "Retrieved" when an existing resource is fetched.
  • "Retrieved for reuse" when an existing resource is fetched as a reusable resource.

Adds a ReusableGroup class so that ResuableProject is truly reusable (otherwise ResuableProject would create a new group in a different project each time).

Part of https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/1032

Examples

Previously, the debug log for fabricating a resource always said Built, like this:

==> Built a QA::Resource::Project with full_path 'gitlab-qa-sandbox-group/contribution_analytics-a630bee295505362/contribution_analytics-d94f429a07bfa22a' via api in 0.607407829 seconds

Now it still says Built when a new resource is created, but if an existing resource is fetched (instead of creating a new one), it says something like:

==> Retrieved a QA::Resource::Group with full_path 'gitlab-qa-sandbox-group/qa-test-2022-01-10-23-52-28-6e54ea33b183dbe5' via api in 1.244220592 seconds

And if it's a reusable resource:

==> Retrieved for reuse a QA::Resource::ReusableGroup with full_path 'gitlab-qa-sandbox-group/reusable_group' via api in 0.804077896 seconds

MR acceptance checklist

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

Edited by Mark Lapierre

Merge request reports