Skip to content

Commit 170630f

Browse files
wksqinsoon
andauthored
API migration guide. (#1133)
An *API Migration Guide* section is added to the porting guide. A symbolic link is created as `mmtk-core/API-MIGRATION.md` which can be easily discovered from the root of the repository. --------- Co-authored-by: Yi Lin <qinsoon@gmail.com>
1 parent b97f1f6 commit 170630f

13 files changed

+830
-1
lines changed

.github/scripts/ci-doc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ cargo build
2424

2525
# Install mdbook using the stable toolchain and the default target
2626
unset CARGO_BUILD_TARGET
27-
cargo +stable install mdbook
27+
cargo +stable install mdbook mdbook-admonish mdbook-hide
2828
mdbook build $project_root/docs/userguide

.github/workflows/api-check.yml

+21
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,24 @@ jobs:
3838
run: cargo install cargo-public-api
3939
- name: API Diff
4040
run: cargo public-api diff origin/${GITHUB_BASE_REF}..${{ github.event.pull_request.head.sha }} --deny=all
41+
42+
check-api-migration-update:
43+
needs: check-public-api-changes
44+
runs-on: ubuntu-latest
45+
if: ${{ always() && needs.check-public-api-changes.result == 'failure'}}
46+
env:
47+
MIGRATION_GUIDE_PATH: 'docs/userguide/src/migration/**'
48+
steps:
49+
# Check if migration guide is updated.
50+
- name: Get the update status for the migration guide.
51+
uses: tj-actions/changed-files@v44
52+
id: migration-guide-status
53+
with:
54+
files: ${{ env.MIGRATION_GUIDE_PATH }}
55+
# If the api check failed but the migration is not updated, we fail here
56+
- name: Report if the migration guide is not updated.
57+
if: ${{ steps.migration-guide-status.outputs.any_changed == 'false' }}
58+
uses: actions/github-script@v7
59+
with:
60+
script: |
61+
core.setFailed('Public API is changed, but the migration guide (${{ env.MIGRATION_GUIDE_PATH }}) is not updated. If the bindings need to be updated for the API change, the migration guide needs to be updated as well.')

.github/workflows/merge-check.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919
"ready-to-merge",
2020
"check-broken-links-in-docs",
2121
"check-public-api-changes",
22+
"check-api-migration-update",
2223
"minimal-tests-core/x86_64-unknown-linux-gnu/stable",
2324
"minimal-tests-core/i686-unknown-linux-gnu/stable",
2425
"minimal-tests-core/x86_64-apple-darwin/stable",

.github/workflows/rustdoc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
run: |
2121
sed -i 's/^version = "[0-9]\+.[0-9]\+.[0-9]\+/&-'${GITHUB_SHA}'/' Cargo.toml
2222
- name: Generate rustdoc
23+
env:
24+
# Override preprocessor.hide.hide in book.toml to hide some chapters.
25+
MDBOOK_preprocessor__hide__hide: "true"
2326
run: ./.github/scripts/ci-doc.sh
2427
- name: Copy docs
2528
# docs.mmtk.io is the root for github pages.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ To integrate MMTk with your language implementation, you need to provide an impl
8989
you can optionally call MMTk's API for your needs.
9090

9191
For more information, you can refer to our [porting guide](https://docs.mmtk.io/portingguide/prefix.html) for VM implementors.
92+
We maintain a [migration guide](https://docs.mmtk.io/migration/prefix.html) to help VM implementors to migrate MMTk to newer versions.
9293

9394
### Implement your GC
9495

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* Make the "show details" text on the third level smaller and keep the same indentation as the folded sub-list. */
2+
#api-migration-detail-body details.api-migration-level3-detail > summary {
3+
padding-left: 2em;
4+
font-size: small;
5+
}
6+
7+
/* Hide the "show details" when open, to keep the text less cluttered. */
8+
#api-migration-detail-body details[open] > summary {
9+
display: none;
10+
}

0 commit comments

Comments
 (0)