Skip to content

Commit 67d9286

Browse files
committed
Merge branch 'main' into governance-refactor
2 parents 3ff2dae + 11fea43 commit 67d9286

26 files changed

+361
-203
lines changed

.github/workflows/gqm_update.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,38 @@ on:
33
push:
44
branches: [main]
55
paths:
6-
- 'measuring/goals/**'
7-
- 'measuring/questions/**'
8-
- 'measuring/metrics/**'
6+
- "measuring/goals/**"
7+
- "measuring/questions/**"
8+
- "measuring/metrics/**"
99

1010
workflow_dispatch:
1111
jobs:
12-
generateDiagram:
13-
name: Generate Diagram
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
- name: Use Node.js
19-
uses: actions/setup-node@v3
20-
with:
21-
node-version: '21.x'
22-
- run: npm install --prefix ./scripts/gqm_gen
23-
- run: npm run coverage-report --prefix ./scripts/gqm_gen
24-
- name: Report NYC coverage
25-
uses: sidx1024/[email protected]
26-
with:
27-
coverage_file: ".nyc_output/nyc-coverage-report/coverage-summary.json"
28-
- run: npm run --silent start --prefix ./scripts/gqm_gen > ./new_gqm.md.tmp
29-
- run: sh ./scripts/gqm_gen/gqm_update.sh ./new_gqm.md.tmp ./measuring/use_gqm.md > ./measuring/use_gqm.md.tmp
30-
- run: rm -f ./new_gqm.md.tmp
31-
- run: mv -f ./measuring/use_gqm.md.tmp ./measuring/use_gqm.md
32-
- run: sh ./scripts/gqm_gen/gqm_commit.sh
12+
generateDiagram:
13+
name: Generate Diagram
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
ssh-key: ${{ secrets.DEPLOY_KEY_SSH_PRIVATE_KEY }}
20+
- name: Use Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: "21.x"
24+
- run: npm install --prefix ./scripts/gqm_gen
25+
- run: npm run coverage-report --prefix ./scripts/gqm_gen
26+
- name: Report NYC coverage
27+
uses: sidx1024/[email protected]
28+
with:
29+
coverage_file: ".nyc_output/nyc-coverage-report/coverage-summary.json"
30+
- run: npm run --silent start --prefix ./scripts/gqm_gen > ./new_gqm.md.tmp
31+
- run: sh ./scripts/gqm_gen/gqm_update.sh ./new_gqm.md.tmp ./measuring/use_gqm.md > ./measuring/use_gqm.md.tmp
32+
- run: rm -f ./new_gqm.md.tmp
33+
- run: mv -f ./measuring/use_gqm.md.tmp ./measuring/use_gqm.md
34+
- name: Commit GQM Diagram
35+
working-directory: ./measuring
36+
run: |
37+
git config --local user.name "github-actions[bot]"
38+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
git add .
40+
git diff --staged --quiet || (git commit -m "Update Goals Questions Metrics Graph" && git push)

.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.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[⬑ back to the overall graph](../use_gqm.md)
2+
3+
# **Metric:** Number of InnerSource repositories
4+
5+
As projects adopt InnerSource, there are signs of such adoption on the corresponding source code repositories.
6+
Examples are the presences of a `CONTRIBUTING.md` file, a "How to Contribute" section on the `README.md` file or repository topics in GitHub such as `innersource`.
7+
8+
One challenge with this metric, is defining an InnerSource repository, as there is no clear cut definition.
9+
Some companies may have strict requirements that define an InnerSource repository, while others may adopt a _self-declaration_.
10+
11+
Another challenge is that companies that use (entirely or partially) the concept of a monorepo may need to find a different unit of measure to observe, as a single repository may be used for many projects or software packages.
12+
13+
**Synopsis**: Number of source code repositories that adopt InnerSource
14+
15+
**Unit of Measurement**: Number of repositories
16+
17+
**Interpretation**: Comparing an absolute number to a range does not make sense in this context. Comparing percentages does make sense, but there's no strong base for comparison.
18+
19+
e.g. 10% of repositories are InnerSource
20+
21+
It's more interesting to observe this metric's trend over time.
22+
23+
**Measuring**
24+
25+
Examples:
26+
- Measure the number of GitHub repositories tagged with the `innersource` topic.
27+
- Measure the number of repositories that are above a given threshold using an automated maturity score calculation
28+
29+
## Related InnerSource Patterns
30+
- [InnerSource Portal](https://patterns.innersourcecommons.org/p/innersource-portal) - typically shows the number of InnerSource projects
31+
- [Repository Activity Score](https://patterns.innersourcecommons.org/p/repository-activity-score) - defines a score for ranking active projects, usable as a criteria to identify InnerSource repositories
32+
- [Standard Base Documentation](https://patterns.innersourcecommons.org/p/base-documentation) - describe common files used to document different aspects of InnerSource projects
33+
- [Maturity Model](https://patterns.innersourcecommons.org/p/maturity-model) - defines levels of maturity for InnerSource projects and can help classify a repository as InnerSource.

measuring/questions/adoption-trend.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[⬑ back to the overall graph](../use_gqm.md)
2+
3+
# **Question:** What is the InnerSource adoption trend?
4+
5+
This question is something an InnerSource program asks while fostering the adoption of InnerSource.
6+
Lack of adoption, or stagnant adoption may reveal that it is necessary to rethink the program strategy or investigate impediments.
7+
8+
## Related Metrics
9+
10+
| **Metric** | **How it answers the question** | **Gotchas** |
11+
| --- | --- | --- |
12+
| [Number of InnerSource repositories](../metrics/number-of-innersource-repositories.md) | The number of (source code) repositories that are directly related to the adoption of the practice. | Depending on how you define _InnerSource repositories_, it can report incorrect results |

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: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
*An overview of the Goals, Questions, and Metrics (GQM) catalog.*
44

5-
This page works better in GitHub; [click here](https://bit.ly/3tOrsbO).
5+
Right-click on any node representing a goal, question, or metric to open a new tab with more detailed information.
66

77
<!---
88
@@ -31,17 +31,40 @@ graph LR;
3131
3232
subgraph GQM[Goals, Questions, Metrics]
3333
34-
find-projects.md[<a href='https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring//goals/find-projects.md'>Find InnerSource Projects</a>]
35-
reduce-duplication.md[<a href='https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring//goals/reduce-duplication.md'>Reduce duplication</a>]
36-
who-contributes.md[<a href='https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring//questions/who-contributes.md'>Who contributes to the InnerSource project?</a>]
37-
who-uses.md[<a href='https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring//questions/who-uses.md'>Who uses the InnerSource project?</a>]
38-
code-contributions.md[<a href='https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring//metrics/code-contributions.md'>Code contributions</a>]
39-
usage-count.md[<a href='https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring//metrics/usage-count.md'>Usage count</a>]
34+
%% begin nodes
35+
find-projects.md[Find InnerSource Projects]
36+
reduce-duplication.md[Reduce duplication]
37+
adoption-trend.md[What is the InnerSource adoption trend?]
38+
who-contributes.md[Who contributes to the InnerSource project?]
39+
who-uses.md[Who uses the InnerSource project?]
40+
code-contributions.md[Code contributions]
41+
contribution-distance.md[Contribution Distance]
42+
number-of-innersource-repositories.md[Number of InnerSource repositories]
43+
usage-count.md[Usage count]
44+
%% end nodes
45+
46+
%% begin edges
4047
find-projects.md-->who-uses.md
4148
find-projects.md-->who-contributes.md
4249
reduce-duplication.md-->who-uses.md
50+
adoption-trend.md-->number-of-innersource-repositories.md
4351
who-contributes.md-->code-contributions.md
52+
who-contributes.md-->contribution-distance.md
4453
who-uses.md-->usage-count.md
54+
%% end edges
55+
56+
%% begin clicks
57+
click find-projects.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/goals/find-projects.md" "Find InnerSource Projects"
58+
click reduce-duplication.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/goals/reduce-duplication.md" "Reduce duplication"
59+
click adoption-trend.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/questions/adoption-trend.md" "What is the InnerSource adoption trend?"
60+
click who-contributes.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/questions/who-contributes.md" "Who contributes to the InnerSource project?"
61+
click who-uses.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/questions/who-uses.md" "Who uses the InnerSource project?"
62+
click code-contributions.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/metrics/code-contributions.md" "Code contributions"
63+
click contribution-distance.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/metrics/contribution-distance.md" "Contribution Distance"
64+
click number-of-innersource-repositories.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/metrics/number-of-innersource-repositories.md" "Number of InnerSource repositories"
65+
click usage-count.md "https://github.com/InnerSourceCommons/managing-inner-source-projects/blob/main/measuring/metrics/usage-count.md" "Usage count"
66+
%% end clicks
67+
4568
end
4669
subgraph Legend
4770
direction TB
@@ -54,10 +77,10 @@ graph LR;
5477
class goal,find-projects.md,reduce-duplication.md goals
5578
5679
classDef questions stroke:orange,stroke-width:2px;
57-
class question,who-contributes.md,who-uses.md questions
80+
class question,adoption-trend.md,who-contributes.md,who-uses.md questions
5881
5982
classDef metrics stroke:purple,stroke-width:2px;
60-
class metric,code-contributions.md,usage-count.md metrics
83+
class metric,code-contributions.md,contribution-distance.md,number-of-innersource-repositories.md,usage-count.md metrics
6184
end
6285
6386
```

package-lock.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

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_commit.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)