Skip to content

Let a grouping put one dependency under several values #112

Description

@irskep

GroupingConfig.getValue returns one value per dependency, so toGroupingPages files each dependency under exactly one group. That works for a partition (a compliance tier, a policy) but not for a dimension where membership overlaps.

I group dependencies by the team that owns the code using them. Most dependencies here have several owners: four apps across three teams use @apollo/client. A single grouping has to pick one of those teams, and the other two lose the dependency from their page.

The workaround is a grouping per team, each returning its own label or undefined. It does give every team a page with everything it depends on, and a nav link, which is what I wanted. Two things come out wrong though:

  • Every grouping has exactly one value, so each detail page is titled {label}: {value}, which renders as "Growth: Growth".
  • Each grouping's index page lists a single entry, so there's a redundant hop from the nav to the page you wanted.

If getValue could return string | readonly string[] | undefined, one grouping keyed on team would cover it: the index lists every team with its counts, each team's detail page has all of its dependencies including shared ones, and the title reads "Team: Growth". The bucketing loop is the only place that needs to change, and a single string keeps working.


🧑‍🦲 I'll send a PR for this soon

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions