nativelink icon indicating copy to clipboard operation
nativelink copied to clipboard

Start automated aggregation and surfacing of internal documentation with Rustdoc

Open blakehatch opened this issue 11 months ago • 5 comments

First PR for leveraging rustdoc to surface existing documentation in the code. This reduces the need for redundant documentation on complex and quickly-evolving systems such as configuration files and stores.

This PR focuses on requested improvements and aggregation of information on configuring Nativelink, as well as establishing rustdoc patterns to use on the rest of the monorepo as it is continuously documented.

The change surfaces the below information from the existing nativelink-config documentation for the rust doc:

  • Example READMEs (For examples from In-flight PR from @MarcusSorealheis & Kubernetes deployment examples)
    • In order to thoroughly document the requested cas.json , scheduler.json, cas.yaml, and scheduler.yaml examples they require updating in one place

After running cargo doc in the repository, this page can be reviewed in the browser at: file:///Path/to/repo/nativelink/target/doc/nativelink_config/index.html

This change also surfaces existing documentation and mildly enhances with examples for:

  • nativelink-config/stores.rs -> enum StoreConfig

After running cargo doc in the repository, this page can be reviewed in the browser at: file:///Users/blakehatch/Projects/nativelink/target/doc/nativelink_config/stores/enum.StoreConfig.html

Upcoming PRs will focus on improving the existing now surfaced and aggregated documentation as well as the formatting of the generated Markdown in nativelink-config/src/lib.rs

#681

Type of change

  • [x] New feature (non-breaking change which adds functionality)
  • [x] This change requires a documentation update

This change is Reviewable

blakehatch avatar Mar 02 '24 01:03 blakehatch

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nativelink-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 2, 2024 1:53am

vercel[bot] avatar Mar 02 '24 01:03 vercel[bot]

Yup there goes CI blowing up lol, let me fix I thought rust format would save me 😄

blakehatch avatar Mar 02 '24 17:03 blakehatch

Nit: ```json5

MarcusSorealheis avatar Mar 05 '24 19:03 MarcusSorealheis

It seems like the lines in lib.rs pulling in the READMEs with relative paths #![doc = include_str!("../examples/README.md")] are causing issues with CI and creating the OCI image.

Any idea on a workaround @aaronmondal?

blakehatch avatar Mar 08 '24 00:03 blakehatch

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 15 '24 21:05 CLAassistant