Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include inter-class and inter-collection relationship graphs in schema documentation #265

Conversation

eecavanna
Copy link

@eecavanna eecavanna commented Sep 27, 2024

In this branch, I updated two GitHub Actions workflows—one that builds and deploys the production documentation website and one that builds and deploys the preview documentation website—so that they use refgraph (part of refscan, a homegrown referential integrity checker tool) to generate a pair of diagrams and include them in the resulting schema documentation.

Specifically, the workflows run $ pipx run refgraph {options} to generate a graph (a.k.a. network diagram) in which the circles (nodes) represent Mongo collections and the arrows (edges) represent relationships between those collections. An arrow from circle A to circle B means that the schema allows a document in collection A to contain a reference to a document in collection B.

Similarly, the workflows then run $ pipx run refgraph {different options} to generate a graph where the circles (nodes) represent classes instead of collections.

The graphs are web-based and are stored in files named:

  • collection-graph.html
  • class-graph.html

Both graphs (files) are injected into the schema documentation website's file tree at "build time" (i.e. when the GitHub Actions workflow is compiling the schema documentation website from source). They are not stored in the repository.

Finally, I updated the MkDocs configuration file so that the website's left-hand sidebar contains hyperlinks to the two graphs.

Screenshots

Two new links in the sidebar:

image

class-graph.html:

image

collection-graph.html:

image

Copy link

github-actions bot commented Sep 27, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://microbiomedata.github.io/berkeley-schema-fy24/pr-preview/pr-265/
on branch gh-pages at 2024-10-26 22:15 UTC

@eecavanna eecavanna changed the title WIP: Include refscan (refgraph) diagrams in schema documentation Include refscan (refgraph) diagrams in schema documentation Sep 27, 2024
@eecavanna
Copy link
Author

eecavanna commented Oct 1, 2024

⚠️ The PR preview documentation site for this PR doesn't work anymore (at least not at: https://microbiomedata.github.io/berkeley-schema-fy24/pr-preview/pr-265/). I think, when someone else opens a PR, the "PR Preview Actions" will clobber any existing preview site.

@eecavanna eecavanna changed the title Include refscan (refgraph) diagrams in schema documentation Include refscan-generated diagrams in schema documentation Oct 3, 2024
@eecavanna eecavanna changed the title Include refscan-generated diagrams in schema documentation Include inter-class and inter-collection diagrams in schema documentation Oct 3, 2024
@eecavanna eecavanna changed the title Include inter-class and inter-collection diagrams in schema documentation Include inter-class reference and inter-collection reference graphs in schema documentation Oct 3, 2024
@eecavanna eecavanna changed the title Include inter-class reference and inter-collection reference graphs in schema documentation Include inter-class relationship and inter-collection relationship graphs in schema documentation Oct 3, 2024
@eecavanna eecavanna changed the title Include inter-class relationship and inter-collection relationship graphs in schema documentation Include inter-class and inter-collection relationship graphs in schema documentation Oct 3, 2024
Comment on lines -38 to -40
mkdir -p docs
touch docs/.nojekyll
make gendoc
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 lines were moved to an earlier step (i.e. to lines 36-38) so that a documentation website file tree exists by the time we try to inject the graphs into it (i.e. on lines 50-51).

- name: Generate web-based documentation
run: |
mkdir -p docs
touch docs/.nojekyll
make gendoc
poetry run mkdocs build -d site
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that this command is present in this test_pages_build.yaml file, but not in the deploy-docs.yaml file. I don't know why it's necessary in one situation, but not the other. Maybe it's because the author wanted the documentation website's file tree to also be generated in a directory named site (instead of—or in addition to—the default directory).

@eecavanna eecavanna marked this pull request as ready for review October 3, 2024 01:32
@eecavanna eecavanna requested a review from sujaypatil96 October 3, 2024 01:32
@eecavanna eecavanna requested a review from turbomam October 3, 2024 01:32
@eecavanna
Copy link
Author

I'm OK with this being merged after the Berkeley Schema Roll Out is done (i.e. after October 15, 2024). I'm interested in getting feedback/input before then.

@eecavanna
Copy link
Author

If microbiomedata#2198 gets merged into nmdc-schema/main, then I will consider this PR to be redundant and will close it.

@eecavanna
Copy link
Author

Closing because there is a pair of PRs in the upstream nmdc-schema repo that, together, cover what this one did. In addition, one of those PRs has already been merged into that repo. So, this PR is redundant.

@eecavanna eecavanna closed this Nov 11, 2024
@eecavanna eecavanna deleted the 2188-berkeley-incorporate-refscan-graphs-into-schema-documentation branch November 11, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

berkeley: Incorporate refscan graphs into schema documentation
1 participant