Tutorial 1: Team/code owner usage
Step-by-step tutorial to add Team/Codeowner information to components and analyze them.
Last updated
Step-by-step tutorial to add Team/Codeowner information to components and analyze them.
Last updated
In this tutorial, we'll create a hook script that'll process the CODEOWNERS
file and add the owner information as a custom component property to each component. This will help you analyze the design system adoption across different teams.
CODEOWNERS
is a file used in many repositories (e.g., GitHub, GitLab, Bitbucket) to define the owners of specific files or directories in a codebase. Here is an example of a CODEOWNERS
file:
Before stepping into the hook script, make sure that the codeowners
package is installed as a dependency to your project. It'll help us process the CODEOWNER
file:
Once the CLI scan complete, the Codeowner
property will be associated with each component.
Navigate to the "Components" page. From the "Custom properties" filter, click Codeowner
and select some of the owners from the revealed dropdown. This will list all the components assigned to the selected owners.
You can create a tag based on this filter to easily access it later on and generate charts for your specific needs.
To analyze component usage, open your Analytics dashboard and click "Create new analysis" button on top-right. Under the Analyze section, select "Codeowner" from "Custom properties". Total number of component usages for each Codeowner will be listed.
You can break down the chart to gain deeper insights into how teams are utilizing components. For example, adding a “Tag” breakdown will allow you to compare each team’s design system usage to overall component usage.
Use the --hook-script
argument with the analyze
command, specifying the path to your script:
Feel free to customize the script based on your setup—reach us at support@omlet.dev for any questions/feedback.