Skip to content

Commit f29606c

Browse files
committed
fix: reference warnings
fix: caching and install logic fix: mdbook links failing from link check
1 parent 220afde commit f29606c

4 files changed

Lines changed: 74 additions & 58 deletions

File tree

.github/workflows/mdbook.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,26 @@ jobs:
4444
restore-keys: |
4545
${{ runner.os }}-cargo-registry-
4646
47-
- name: Cache Rust toolchains
47+
# Cache full RUSTUP_HOME (rustc + toolchain + settings) so rustup does minimal work on restore.
48+
- name: Cache Rust toolchain (rustc)
4849
uses: actions/cache@v4
4950
with:
50-
path: |
51-
${{ env.RUSTUP_HOME }}/toolchains
52-
${{ env.RUSTUP_HOME }}/update-hashes
51+
path: ${{ env.RUSTUP_HOME }}
5352
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('scripts/install-mdbook.sh') }}
5453
restore-keys: |
5554
${{ runner.os }}-rust-toolchain-
5655
56+
# Exact key only (no restore-keys) so we never restore a bin/ missing a tool (e.g. linkcheck2).
5757
- name: Cache installed mdBook binaries
5858
id: mdbook-cache
5959
uses: actions/cache@v4
6060
with:
6161
path: |
6262
${{ env.CARGO_HOME }}/bin
6363
key: ${{ runner.os }}-mdbook-bin-${{ hashFiles('scripts/install-mdbook.sh') }}
64-
restore-keys: |
65-
${{ runner.os }}-mdbook-bin-
6664

65+
# Script skips install when cached binaries already match versions in install-mdbook.sh
6766
- name: Install mdBook
68-
if: steps.mdbook-cache.outputs.cache-hit != 'true'
6967
run: bash scripts/install-mdbook.sh
7068
env:
7169
REPO_ROOT: ${{ github.workspace }}
@@ -104,17 +102,17 @@ jobs:
104102
restore-keys: |
105103
${{ runner.os }}-cargo-registry-
106104
107-
- name: Cache Rust toolchains
105+
# Cache full RUSTUP_HOME (rustc + toolchain + settings) so rustup does minimal work on restore.
106+
- name: Cache Rust toolchain (rustc)
108107
if: github.event.action != 'closed'
109108
uses: actions/cache@v4
110109
with:
111-
path: |
112-
${{ env.RUSTUP_HOME }}/toolchains
113-
${{ env.RUSTUP_HOME }}/update-hashes
110+
path: ${{ env.RUSTUP_HOME }}
114111
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('scripts/install-mdbook.sh') }}
115112
restore-keys: |
116113
${{ runner.os }}-rust-toolchain-
117114
115+
# Exact key only (no restore-keys) so we never restore a bin/ missing a tool (e.g. linkcheck2).
118116
- name: Cache installed mdBook binaries
119117
if: github.event.action != 'closed'
120118
id: mdbook-cache
@@ -123,11 +121,10 @@ jobs:
123121
path: |
124122
${{ env.CARGO_HOME }}/bin
125123
key: ${{ runner.os }}-mdbook-bin-${{ hashFiles('scripts/install-mdbook.sh') }}
126-
restore-keys: |
127-
${{ runner.os }}-mdbook-bin-
128124

125+
# Script skips install when cached binaries already match versions in install-mdbook.sh
129126
- name: Install mdBook
130-
if: github.event.action != 'closed' && steps.mdbook-cache.outputs.cache-hit != 'true'
127+
if: github.event.action != 'closed'
131128
run: bash scripts/install-mdbook.sh
132129
env:
133130
REPO_ROOT: ${{ github.workspace }}

measuring/references.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
[^1]: A pull request is the action of submitting a piece of for
2-
reviewing. This term comes from the open source communities and was
3-
basically raised by the collaborative way that GitHub works
1+
# References
42

5-
[^2]: Software modeling and measurement: the goal question metric
6-
paradigm. Victor R. Basili
3+
1. A pull request is the action of submitting a piece of work for
4+
reviewing. This term comes from the open source communities and was
5+
basically raised by the collaborative way that GitHub works.
76

8-
[^3]: There are great talks and even handbooks around the Web stating
9-
the goals of InnerSource. The proposed list of main goals does not
10-
aim at being exhaustive, but an introduction to the InnerSource
11-
context. This could be also seen as a summary of the following talks
12-
and handbooks: “Getting Started with InnerSource. Keys to
13-
collaboration and productivity inside your company” by Andy Oram.
14-
“Inner Sourcing. Enterprise Lessons Learned from the Open Source
15-
Community” by Jim Jagielski. And “Community Development Practices in
16-
Corporate IT. InnerSource Fundamentals” by Guy Martin and Andrew
17-
Aitken.
7+
2. Software modeling and measurement: the goal question metric
8+
paradigm. Victor R. Basili.
189

19-
[^4]: “Best Kept Secrets of Peer Code Review” by Jason Cohen, Steven
20-
Teleki, Eric Brown and others.
10+
3. There are great talks and even handbooks around the Web stating
11+
the goals of InnerSource. The proposed list of main goals does not
12+
aim at being exhaustive, but an introduction to the InnerSource
13+
context. This could be also seen as a summary of the following talks
14+
and handbooks: "Getting Started with InnerSource. Keys to
15+
collaboration and productivity inside your company" by Andy Oram.
16+
"Inner Sourcing. Enterprise Lessons Learned from the Open Source
17+
Community" by Jim Jagielski. And "Community Development Practices in
18+
Corporate IT. InnerSource Fundamentals" by Guy Martin and Andrew
19+
Aitken.
2120

22-
[^5]: These two are referenced in the great book “Software Development
23-
Metrics” by David Nicolette. The third one, motivational aspects,
24-
from our perspective, should be taken into account and being in this
25-
same level, as specific actions can be carried out when building
26-
InnerSource organizations as in the same way open source
27-
organizations work this community building aspect
21+
4. "Best Kept Secrets of Peer Code Review" by Jason Cohen, Steven
22+
Teleki, Eric Brown and others.
2823

29-
[^6]: Software modeling and measurement: the goal question metric
30-
paradigm. Victor R. Basili.
24+
5. These two are referenced in the great book "Software Development
25+
Metrics" by David Nicolette. The third one, motivational aspects,
26+
from our perspective, should be taken into account and being in this
27+
same level, as specific actions can be carried out when building
28+
InnerSource organizations as in the same way open source
29+
organizations work this community building aspect.
3130

32-
[^7]: Java vs JS case
31+
6. Software modeling and measurement: the goal question metric
32+
paradigm. Victor R. Basili.
33+
34+
7. Java vs JS case.

scripts/install-mdbook.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,31 @@ fi
2424
rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --profile minimal
2525
rustup default "${RUST_TOOLCHAIN_VERSION}"
2626

27+
# Skip install when binary exists and reports the expected version (e.g. from CI cache).
28+
# All four tools (mdbook, mdbook-mermaid, mdbook-embedify, mdbook-linkcheck2) are checked.
29+
# Install with --force when missing or version mismatch so we overwrite.
30+
bin_dir="${CARGO_HOME}/bin"
31+
has_version() {
32+
[[ -x "${bin_dir}/$1" ]] && "${bin_dir}/$1" --version 2>/dev/null | grep -qF "$2"
33+
}
34+
35+
install_if_needed() {
36+
local name=$1 version=$2
37+
if has_version "$name" "$version"; then
38+
echo "$name $version already installed (cached), skipping."
39+
else
40+
cargo install --version "$version" "$name" --force
41+
fi
42+
}
43+
2744
# https://github.com/rust-lang/mdBook
28-
cargo install --version "${MDBOOK_VERSION}" mdbook
45+
install_if_needed mdbook "${MDBOOK_VERSION}"
2946
# https://github.com/badboy/mdbook-mermaid
30-
cargo install --version "${MDBOOK_MERMAID_VERSION}" mdbook-mermaid
47+
install_if_needed mdbook-mermaid "${MDBOOK_MERMAID_VERSION}"
3148
# https://github.com/rust-lang/mdbook-embedify
32-
cargo install --version "${MDBOOK_EMBEDIFY_VERSION}" mdbook-embedify
49+
install_if_needed mdbook-embedify "${MDBOOK_EMBEDIFY_VERSION}"
3350
# https://github.com/Michael-F-Bryan/mdbook-linkcheck
34-
cargo install --version "${MDBOOK_LINKCHECK2_VERSION}" mdbook-linkcheck2
51+
install_if_needed mdbook-linkcheck2 "${MDBOOK_LINKCHECK2_VERSION}"
3552

3653
echo "Done. To build the book, use the project mdbook (do not use your global 'mdbook'):"
3754
echo " ${CARGO_HOME}/bin/mdbook build"

tooling/innersource-tooling.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ for a perspective focused entirely on security.
2222
- [Pros and Cons of InnerSource Dedicated Environment](./github-strategy.md#pros-and-cons-of-innersource-dedicated-environment)
2323
- [Variations in how repository read access is distributed](./github-strategy.md#variations-in-how-repository-read-access-is-distributed)
2424
- [Conclusion: High Level Guideline](./github-strategy.md#conclusion-high-level-guideline)
25-
- [GitHub InnerSource Configuration](./github-configuration.md/#github-innersource-configuration)
26-
- [Enterprise Setting](./github-configuration.md/#enterprise-setting)
27-
- [Repository policies](./github-configuration.md/#repository-policies)
28-
- [Base permissions](./github-configuration.md/#base-permissions)
29-
- [Repository creation](./github-configuration.md/#repository-creation)
30-
- [Repository forking (Private / Internal)](./github-configuration.md/#repository-forking-private--internal)
31-
- [Organization Setting](./github-configuration.md/#organization-setting)
32-
- [Member privileges](./github-configuration.md/#member-privileges)
33-
- [Base permissions](./github-configuration.md/#base-permissions-1)
34-
- [Repository creation](./github-configuration.md/#repository-creation-1)
35-
- [Repository forking](./github-configuration.md/#repository-forking)
36-
- [GitHub Enterprise Server Setting](./github-configuration.md/#github-enterprise-server-setting)
37-
- [GitHub Connect - Server statistics](./github-configuration.md/#github-connect---server-statistics)
38-
- [Resources](./github-configuration.md/#resources)
25+
- [GitHub InnerSource Configuration](./github-configuration.md#github-innersource-configuration)
26+
- [Enterprise Setting](./github-configuration.md#enterprise-setting)
27+
- [Repository policies](./github-configuration.md#repository-policies)
28+
- [Base permissions](./github-configuration.md#base-permissions)
29+
- [Repository creation](./github-configuration.md#repository-creation)
30+
- [Repository forking (Private / Internal)](./github-configuration.md#repository-forking-private--internal)
31+
- [Organization Setting](./github-configuration.md#organization-setting)
32+
- [Member privileges](./github-configuration.md#member-privileges)
33+
- [Base permissions](./github-configuration.md#base-permissions-1)
34+
- [Repository creation](./github-configuration.md#repository-creation-1)
35+
- [Repository forking](./github-configuration.md#repository-forking)
36+
- [GitHub Enterprise Server Setting](./github-configuration.md#github-enterprise-server-setting)
37+
- [GitHub Connect - Server statistics](./github-configuration.md#github-connect---server-statistics)
38+
- [Resources](./github-configuration.md#resources)
3939

4040
### GitLab

0 commit comments

Comments
 (0)