Stop polluting global context via plugin helpers
Problems
All the plugins and their helpers methods are all globally available in the policy file context.
Some helpers are using very common names, which are highly likely to conflict with other plugins and/or helpers.
When this happened, it can cause bizarre errors which is not obvious to spot, making it more difficult to understand and debug.
Side notes
Note that marking methods private
in the plugin helpers doesn't really do anything, because we're never using those methods by another instance. We're always being able to use any private methods, and since we include everything into the context, everything is accessible everywhere, essentially everything is globally available.
Proposed solutions
See each discussion threads.
The following discussion from !2410 (merged) should be addressed:
-
@godfat-gitlab started a discussion: This has the same global pollution issue. However I see we're doing the same in
lib/slo_breach_helper.rb
so even without this, the pollution is already there. :sad-panda:I think I'll make an issue talking about reworking the whole plugin system.
I would be fine to keep this as-is for now.
Todos
-
missed_resource_helper.rb
, MR: !2666 (closed) -
untriaged_helper.rb
-
team_member_helper.rb
-
slo_breach_helper.rb
-
group_triage_helper.rb
-
bug_prioritization_helper.rb
-
growth_refine_automation_helper.rb
-
idle_mr_helper.rb
-
priority_mapping_helper.rb
-
timeframe_helper.rb
-
stale_resources_helper.rb
-
resource_helper.rb
-
missing_milestone_helper.rb
-
labels_helper.rb
-
community_contribution_helper.rb