Skip to content

Commit adf3b01

Browse files
authored
Merge pull request #70 from JustinGOSSES/main
added new metric: contribution-distance
2 parents 1d19ce3 + ce6e5c3 commit adf3b01

File tree

7 files changed

+92
-3
lines changed

7 files changed

+92
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# We want to ignore our vale StylesPath
22
.github/vale/*
3+
gqm*[pngmd]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[⬑ back to the overall graph](../use_gqm.md)
2+
3+
# **Metric:** Contribution Distance
4+
5+
**Synopsis**: Number of organizational hops from owning team to contributing team
6+
It can be useful to know not only when contributions to a repository are made, but the distance between the
7+
owning team and contributing individual in terms of organizational distance.
8+
9+
**Unit of Measurement**: manager levels
10+
This is measured in terms of number of managers you have to move up in the hierarchy before you can go down to
11+
the contribution team. For example, if the manager in common of both parties is two jumps up the chain,
12+
then the distance is 2. Most contributions will be in-team and therefore are 0 distance. For a contribution
13+
to be "InnerSource", it has to be at least 1 distance.
14+
15+
**Interpretation**: Contribution distance is a measurable proxy for collaboration
16+
A repository with a pull request that has a high contribution distance is likely to be reflective of a
17+
repository with more impact and more effective set up for collaboration. Repositories that have pull requests
18+
with a high contribution distance are on average probably more likely to be useful to others than repositories
19+
with only a single short distance collaboration.
20+
21+
Collaboration distance and counts combined can also tell you something about the type of value a repository provides.
22+
A repository with many pull requests of 1-2 distance is likely to be reflective of partner teams working closely
23+
together to solve a shared problem. A repository with many pull requests of 3-4 distance but only a single
24+
pull request from each contributor is likely to be reflective of a repository that is being used for information
25+
sharing or as a reference. Contribution distance is a metric that can be combined with others to build up
26+
a picture of the community around each repository where InnerSource contribution behaviors are occurring.
27+
28+
**Measuring**
29+
30+
Measuring this metrics requires a mapping of your organization's hierarchy and a way to define whether the person
31+
that submits each issue or pull request is a member of the owning team or not. There are likely multiple
32+
ways to do each of these tasks and the best way will depend on your organization.
33+
34+
As an example, Microsoft determines if an individual is on the "owning team" by finding the individual that approved
35+
the majority of pull requests and then finding the manager that is accountable for that individual.
36+
37+
One possible pitfall is that manager and team relationships change over time. For this reason, it can be preferred
38+
to measure contribution distance soon after the pull request is merged and then store the distance as
39+
manager relationships will change over time degrading the data quality.

measuring/questions/who-contributes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ There are many types of contributions - e.g. code, documentation, discussion, et
99
| **Metric** | **How it answers the question** | **Gotchas** |
1010
| --- | --- | --- |
1111
| [Code Contributions](../metrics/code-contributions.md) | Each code contribution represents a contributor to the InnerSource project. | There are other types of contributions beyond code. |
12+
| [Contribution Distance](../metrics/contribution-distance.md) | Measures how far apart in the organization each InnerSource contribution is. | Depends on accurate information on the organization's hierarchy mapped to contributor identity. |

measuring/use_gqm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ Add your goals, questions, and metrics into this graph! It will help you to see
8181
You may get new ideas of what metrics answer the questions you have or what additional goals your questions can support.
8282
See [CONTRIBUTING.md#metrics].
8383

84-
[CONTRIBUTING.md#metrics]: https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/CONTRIBUTING.md#metrics
84+
[CONTRIBUTING.md#metrics]: https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/CONTRIBUTING.md#metrics

scripts/gqm_gen/README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,53 @@
22

33
Creates a Mermaid diagram from Goal, Question, Metrics (GQM) Markdown files.
44

5+
The instructions below describe how to locally run
6+
the script that builds the mermaid diagram.
7+
A GitHub Actions will re-run this script at built time
8+
and regenerate the diagram, but it is good to run
9+
locally to make sure it will build correctly.
10+
11+
Be sure to also read the instructions in the
12+
`measuring/use_gqm.md` file path.
13+
14+
## Installation
15+
16+
### Install mermaid CLI globally
17+
18+
From this folder, follow instructions on the
19+
[mermaid.js README](https://github.com/mermaid-js/mermaid-cli) to run in the terminal:
20+
```
21+
npm install -g @mermaid-js/mermaid-cli
22+
```
23+
24+
Install project specific node.js based on the package.json in this folder:
25+
```
26+
npm install
27+
```
28+
529
## Usage
630

731
Builds the mermaid diagram and outputs it to stdout.
832

933
```bash
10-
npm install
11-
npm run --silent start
34+
npm run --silent start > gqm.md && mmdc --input gqm.md --output gqm.png
1235
```
36+
37+
Note that the file ending `.mmd` is not a typo. It is mermaid markdown file.
38+
39+
This should generate a file called `gqm.png` or `gqm-1.png` in the same folder as this file.
40+
41+
You will also end up with BOTH a `gqm.md` and a `gqm.mmd` file as the later is created upon running the script.
42+
43+
## Files that impact the generation of the mermaid diagram
44+
45+
Most of the diagram is generated by the `gqm.md` file but be sure to also
46+
make changes in the files within the `measuring`, `questions`, and `goals` folders as appropriate.
47+
You'll have to create a file for a new block and edit any file that mentions that new block.
48+
For example, if you create a new metric, you'll want to create a new markdown file in the
49+
metrics folder. Additionally, as there is an arrow that goes from that metric to a question,
50+
you'll want to edit the table in the question file that talks to all the metrics that impact that question. A metric can be connected to one or more questions.
51+
52+
### Warning
53+
Files that are referenced by the mermaid diagram must not use underscores `_` in their filenames.
54+
Instead use hyphens `-`.

scripts/gqm_gen/gqm-1.png

36.3 KB
Loading

scripts/package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)