Skip to content

Commit 6685f5b

Browse files
authored
Merge pull request #107 from InnerSourceCommons/add-ai-section
feat: add InnerSource and AI section
2 parents 44fa9e1 + 75da1f8 commit 6685f5b

File tree

17 files changed

+261
-65
lines changed

17 files changed

+261
-65
lines changed

.github/act/pull_request.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"act": true,
3+
"action": "synchronize",
4+
"repository": {
5+
"fork": false,
6+
"default_branch": "main",
7+
"name": "managing-innersource-projects",
8+
"full_name": "InnerSourceCommons/managing-innersource-projects"
9+
},
10+
"pull_request": {
11+
"number": 107,
12+
"head": {
13+
"repo": {
14+
"full_name": "InnerSourceCommons/managing-innersource-projects"
15+
}
16+
}
17+
}
18+
}

.github/act/push.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"act": true,
3+
"repository": {
4+
"fork": false,
5+
"default_branch": "main"
6+
}
7+
}

.github/workflows/mdbook.yml

Lines changed: 82 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
# Workflow for building and deploying a mdBook site to GitHub Pages.
2-
# Serves the main book at / and PR previews at /pr-<number>/ by merging
3-
# pr-* directories from the gh-pages branch (pushed by mdbook-pr-preview.yml)
4-
# into the deployed artifact. Works with Pages source "GitHub Actions".
2+
# - On push to main: deploys to the root of gh-pages.
3+
# - On pull_request: deploys a preview under pr-preview/pr-<number>/ on gh-pages,
4+
# comments the preview URL, and cleans up when the PR closes.
5+
#
6+
# Repo Settings required:
7+
# Pages -> Source: "Deploy from a branch" -> gh-pages / (root)
8+
# Actions -> General -> Workflow permissions: "Read and write permissions"
59
#
610
# See: https://rust-lang.github.io/mdBook/index.html
711
name: Deploy mdBook site to Pages
812

913
on:
1014
push:
1115
branches: ["main"]
16+
pull_request:
17+
types: [opened, synchronize, reopened, closed]
1218
workflow_dispatch:
1319

1420
permissions:
15-
contents: read
16-
pages: write
17-
id-token: write
18-
19-
concurrency:
20-
group: "pages"
21-
cancel-in-progress: false
21+
contents: write
22+
pull-requests: write
2223

2324
jobs:
24-
build:
25+
deploy:
26+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
2527
runs-on: ubuntu-latest
28+
concurrency:
29+
group: pages
30+
cancel-in-progress: false
2631
env:
2732
CARGO_HOME: ${{ github.workspace }}/.cargo
2833
RUSTUP_HOME: ${{ github.workspace }}/.rustup
@@ -71,40 +76,73 @@ jobs:
7176
- name: Build with mdBook
7277
run: ${{ env.CARGO_HOME }}/bin/mdbook build
7378

74-
- name: Merge PR previews from gh-pages into artifact
75-
run: |
76-
set -e
77-
echo "Fetching gh-pages branch..."
78-
git fetch origin gh-pages 2>/dev/null || true
79-
if ! git rev-parse -q origin/gh-pages >/dev/null 2>&1; then
80-
echo "No gh-pages branch found; skipping PR preview merge."
81-
exit 0
82-
fi
83-
PR_DIRS=$(git ls-tree -d --name-only origin/gh-pages 2>/dev/null | grep -E '^pr-[0-9]+$' || true)
84-
if [ -z "$PR_DIRS" ]; then
85-
echo "No pr-* directories on gh-pages; skipping."
86-
exit 0
87-
fi
88-
echo "Merging PR preview dirs: $PR_DIRS"
89-
for d in $PR_DIRS; do
90-
echo " -> merging $d"
91-
git archive origin/gh-pages "$d" | tar -x -C book
92-
done
93-
echo "Done. Contents of book/ after merge:"
94-
ls -la book/ | head -30
95-
96-
- name: Upload artifact
97-
uses: actions/upload-pages-artifact@v3
79+
- name: Deploy to GitHub Pages
80+
uses: peaceiris/actions-gh-pages@v4
9881
with:
99-
path: ./book
82+
github_token: ${{ secrets.GITHUB_TOKEN }}
83+
publish_dir: ./book
84+
keep_files: true
10085

101-
deploy:
102-
environment:
103-
name: github-pages
104-
url: ${{ steps.deployment.outputs.page_url }}
86+
preview:
87+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
10588
runs-on: ubuntu-latest
106-
needs: build
89+
concurrency: preview-${{ github.ref }}
90+
env:
91+
CARGO_HOME: ${{ github.workspace }}/.cargo
92+
RUSTUP_HOME: ${{ github.workspace }}/.rustup
10793
steps:
108-
- name: Deploy to GitHub Pages
109-
id: deployment
110-
uses: actions/deploy-pages@v4
94+
- uses: actions/checkout@v4
95+
96+
- name: Cache Cargo registry and git index
97+
if: github.event.action != 'closed'
98+
uses: actions/cache@v4
99+
with:
100+
path: |
101+
${{ env.CARGO_HOME }}/registry
102+
${{ env.CARGO_HOME }}/git
103+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('scripts/install-mdbook.sh') }}
104+
restore-keys: |
105+
${{ runner.os }}-cargo-registry-
106+
107+
- name: Cache Rust toolchains
108+
if: github.event.action != 'closed'
109+
uses: actions/cache@v4
110+
with:
111+
path: |
112+
${{ env.RUSTUP_HOME }}/toolchains
113+
${{ env.RUSTUP_HOME }}/update-hashes
114+
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('scripts/install-mdbook.sh') }}
115+
restore-keys: |
116+
${{ runner.os }}-rust-toolchain-
117+
118+
- name: Cache installed mdBook binaries
119+
if: github.event.action != 'closed'
120+
id: mdbook-cache
121+
uses: actions/cache@v4
122+
with:
123+
path: |
124+
${{ env.CARGO_HOME }}/bin
125+
key: ${{ runner.os }}-mdbook-bin-${{ hashFiles('scripts/install-mdbook.sh') }}
126+
restore-keys: |
127+
${{ runner.os }}-mdbook-bin-
128+
129+
- name: Install mdBook
130+
if: github.event.action != 'closed' && steps.mdbook-cache.outputs.cache-hit != 'true'
131+
run: bash scripts/install-mdbook.sh
132+
env:
133+
REPO_ROOT: ${{ github.workspace }}
134+
135+
- name: Add Cargo bin to PATH
136+
if: github.event.action != 'closed'
137+
run: echo "${CARGO_HOME}/bin" >> "$GITHUB_PATH"
138+
139+
- name: Build with mdBook
140+
if: github.event.action != 'closed'
141+
run: ${{ env.CARGO_HOME }}/bin/mdbook build
142+
143+
- name: Deploy PR preview
144+
uses: rossjrw/pr-preview-action@v1
145+
with:
146+
source-dir: ./book
147+
preview-branch: gh-pages
148+
umbrella-dir: pr-preview

MDBOOK.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@ cargo install mdbook --version 0.4.52
2020
Install required preprocessors:
2121

2222
```sh
23-
# Install mdbook-mermaid v0.10.0 (compatible with mdbook 0.4.52)
24-
cargo install mdbook-mermaid --version 0.10.0
25-
26-
# Install mdbook-embedify for embedding external content
23+
cargo install mdbook-mermaid
2724
cargo install mdbook-embedify
2825
```
2926

30-
**Note:** These specific versions are required for compatibility. mdbook-embedify 0.2.18 is not compatible with mdbook 0.5.x, so we use mdbook 0.4.52 and a compatible version of mdbook-mermaid.
31-
3227
## Usage
3328

3429
To build the book, run the following command:

SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
* [References](measuring/references.md)
3232
* [Authors and Reviewers](measuring/authors.md)
3333
* [Governance](governance/governance.md)
34+
* [InnerSource and AI](innersource-and-ai/innersource-and-ai.md)
35+
* [Why InnerSource Matters When Adopting AI](innersource-and-ai/why-innersource-matters-with-ai.md)
36+
* [Shaping Repositories and Practices for AI](innersource-and-ai/shaping-for-ai.md)
37+
* [Risks and Guardrails](innersource-and-ai/risks-and-guardrails.md)
38+
* [Authors and Reviewers](innersource-and-ai/authors.md)
3439
* [Tooling](tooling/innersource-tooling.md)
3540
* [GitHub Strategy](tooling/github-strategy.md)
3641
* [GitHub Configuration](tooling/github-configuration.md)

book.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ giscus.loading = "lazy"
2020
giscus.crossorigin = "anonymous"
2121

2222
[output.html]
23+
# Required for correct asset and 404 paths on GitHub Pages (project site and PR preview subpaths).
24+
site-url = "/managing-innersource-projects/"
2325
additional-js = ["mermaid.min.js", "mermaid-init.js"]

governance/governance.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ organization and its context and find other goals InnerSource may
250250
contribute towards. Then communicate it and get as much air cover
251251
from your executives as you can.
252252

253+
For how governance and transparency support responsible use of AI in development, see [InnerSource and AI](/innersource-and-ai/innersource-and-ai.md), in particular [Risks and Guardrails](/innersource-and-ai/risks-and-guardrails.md).
254+
253255
[^1]: http://oss-watch.ac.uk/resources/governancemodels
254256

255257
[^2]: https://ospo-alliance.org/ggi/

innersource-and-ai/authors.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Authors and Reviewers
2+
3+
## Authors
4+
5+
Chronological order:
6+
7+
* InnerSource Program Office (ISPO) Working Group, [InnerSource Commons](https://innersourcecommons.org/).
8+
9+
## Reviewers
10+
11+
Chronological order:
12+
13+
* Jeff Bailey
14+
* Russ Rutledge
15+
* Micaela Eller
16+
17+
This section was drafted as a discussion starter and is open for contributions. If you would like to be listed as an author or reviewer, please open a pull request or get in touch via [Slack](https://innersourcecommons.org/slack).
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# InnerSource and AI
2+
3+
Organizations are increasingly adopting AI in the workplace—from generative AI assistants to agentic coding tools that can write, refactor, and review code. This shift is changing how developers work: less time on typing code, more on defining requirements, guiding AI, and making sure systems are reliable and maintainable. For InnerSource program leads, the question is whether InnerSource still matters in this new landscape.
4+
5+
It does. InnerSource is potentially *more* important than ever. Shared repositories, clear boundaries, documentation, and collaborative practices help AI systems—and the people using them—work with the right context, reuse existing components, and keep quality high. This section explains why InnerSource matters when adopting AI, how to shape your repositories and practices for AI-assisted development, and what risks and guardrails to keep in mind.
6+
7+
The following articles in this section go deeper:
8+
9+
- [Why InnerSource Matters When Adopting AI](why-innersource-matters-with-ai.md) — Relevance of InnerSource in an AI-augmented world, reuse, and production readiness.
10+
- [Shaping Repositories and Practices for AI](shaping-for-ai.md) — Repository design, documentation, and workflow integration so both humans and AI can contribute effectively.
11+
- [Risks and Guardrails](risks-and-guardrails.md) — Balancing speed with safety, the role of code review, and organizational best practices for AI use.
12+
13+
AI tooling and practices are evolving quickly. This section will be updated as the community learns more and as survey and research data become available. If you are new to InnerSource, we recommend starting with [Getting Started with InnerSource](http://www.oreilly.com/programming/free/getting-started-with-innersource.csp) and the [Introduction](/introduction/introduction.md) to this book.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Risks and Guardrails
2+
3+
AI is the ultimate InnerSource contributor. Like any external contributor, AI agents generate code that must be reviewed, validated, and integrated thoughtfully into your systems. The same InnerSource practices that enable trusted external contributions—code review, clear guidelines, transparent decision-making, and systems thinking—are exactly what you need to safely and sustainably adopt AI in development.
4+
5+
Adopting AI without these guardrails can deliver short-term gains in speed and productivity, but at the cost of long-term risks to quality, security, and maintainability. The good news: if your organization has built a strong InnerSource culture, you already have the foundations in place.
6+
7+
## Transparency and stakeholder involvement
8+
9+
Involving stakeholders and keeping development transparent supports responsible AI deployment. When decisions about tools, patterns, and policies are visible and discussable, teams can align on what is acceptable and what is not. This aligns with InnerSource principles of openness and collaboration and helps prevent AI from being used in ways that conflict with organizational values or compliance requirements.

0 commit comments

Comments
 (0)