SaaS index worker: Deduplicate namespaces and remove root check

Description

This improves the Active Context SaaS indexing worker. It is a follow-up from !206226 (comment 2787062599).

  1. Deduplicates the possible duplicated namespaces. I think the root namespace could have multiple add-on types, for example: duo_core and duo_enterprise and it would appear twice in the query results.
  2. Removes the unnecessary root check. I've tried to create a spec scenario, but it's not possible because namespace.root? is redundant. GitlabSubscriptions::AddOnPurchase has a valid_namespace that includes namespace.root?.

Related to #569746 (closed).

Merge request reports

Loading