Deploying SAW's Written Materials #2197
Labels
documentation debt
Documentation tasks previously deferred, postponed, etc.; technical debt in documentation
documentation
Issues involving documentation
tooling: release engineering
Issues involving releases, release processes, or other release engineering concerns
type: enhancement
Issues describing an improvement to an existing feature or capability
Milestone
Deploying the SAW Manual and Tutorials
This issue summarizes my investigation into deploying the critical written
SAW materials (the manual, the LLVM/Java tutorial, and the Rust tutorial).
A sensible deployment scheme is necessary to (1) make long-needed structural
and content changes to these resources for accuracy and cohesion now and in the
future, (2) deploy new releases of SAW, and (3) keep the online versions of
these resources, now available at https://tools.galois.com/saw, up-to-date.
First, I outline the current state of how these materials are handled.
I then propose an approach to deployment for the team's consideration that makes
use of pre-existing mechanisms for synchronizing content on GitHub with content
on GitBook.
The Current State of Things
We currently store the SAW manual and tutorials (as Markdown / TeX sources and
rendered PDFs) in the
saw-script
repository.Updating these materials (properly) currently entails:
Steps 2 (with the second clause of 3) and 4 are notably unideal: The former
because we are already version-controlling the sources from which the PDFs are
built, and the sources ought to be the source of truth; the latter because human
memory is fallible, and it is extremely easy for the in-repository and
published-online versions to fall out of sync (indeed, as of this writing, that
is the case).
Furthermore, because I am currently the only developer with access to both
saw-script
and the GitBook instance powering the online versions of thesematerials, the final step relies on me tracking PRs here for manual/tutorial
changes that need to be published, performing those updates manually on GitBook..
Ideally, we would have a scheme that entailed only:
Where the PDFs are generated as part of CI (or, we abandon that particular
rendering entirely2) and the final step is handled by the solution
suggested below.
This would lower the burden on all SAW contributors, who before may have
been incentivized to avoid updating the manual or tutorials alongside their
other work, due to the extra efforts necessary.
The (Potential) Future State of Things
Disclaimer: I don't have a good testing strategy in mind for this, seeing as
most of what we would want to test is the deployment to GitBook itself.
Much like CI, we may just need to make attempts until we get it working.
If it is possible to create unpublished spaces in GitBook, that would be about
as well as we could do in terms of testing deployment isolated from the existing
SAW space with which we'd like to be synchronized.
If/when I am granted elevated GitBook permissions, I will explore this
possibility.
Before outlining the solution I have come up with, there is a seemingly even
easier option worth stating explicitly:
This solution has a glaring disadvantage that invalidates it immediately: There
is extremely limited access to the GitBook instance due to its pricing model,
leaving no way for an arbitrary SAW contributor to update documentation
(e.g. when adding/updating features or deprecating commands) without being
artificially bottlenecked by said limited access.
The solution I propose addresses this concern by, instead of removing one of the
version-controlled instances, synchronizing the two going forward, using the
"GitHub Sync" feature of GitBook.
This approach allows for bi-directional content updates subject to a review
process (PRs on GitHub, "change requests" on GitBook).
My GitHub and GitBook accounts are already associated with one another, meaning
(with AndrewS's permission/help) I can connect the SAW space to
all or part of a GitHub repository.
Additionally, we are already on our way towards a proper setup of the
saw-script
repository to synchronize with the SAW space on https://tools.galois.com.Below, I detail what changes we'll need to make to make sure nothing at the new
site inadvertently breaks upon implementing this new setup.
Preparing
saw-script
The following will need to be updated in this repository before GitHub Sync can
be enabled and perform the synchronization that we desire:
The content in
doc/
must be rearranged and augmented to, uponsynchronization, maintain what is currently available at https://tools.galois.com/saw.
This is (mostly) bookkeeping of names, and adding suitable Markdown files for
all of the pages not currently maintained in this repository.
The
SUMMARY.md
described below outlines the work necessary in this step.A
.gitbook.yaml
will need to be added to the root of the repository.I believe the following will be appropriate, given corresponding changes in
(1):
Add
doc/README.md
, which will contain the contents one currently seesat https://tools.galois.com/saw.
Add
doc/SUMMARY.md
, which will define the navigation (i.e. table ofcontents) seen on that same page.
The contents of the file will be something like:
Notice that this matches the current layout of https://tools.galois.com/saw,
down to the precise names used for pages (so we do not break any links in or
out when synchronizing for the first time).
These preparations are the bulk of the work to set up synchronization.
Enabling/Configuring GitHub Sync
Important! For testing purposes, create a private/hidden GitBook space to
use in step (2) below before acting on the existing SAW space.
This will help with debugging any potential deployment issues.
Similarly, for step (3), consider selecting a branch other than
master
onwhich to test, so no inadvertent accidents happen to our cutting-edge SAW work.
saw-script
is prepared as described above.to the
GaloisInc
organization.(AndrewS will need to escalate my access to GitBook to complete this step.)
IT may need to be involved too, as the GitBook GitHub app will need to be
installed to the GaloisInc organization (ideally, with access to all
repositories so we can use this setup for future spaces on https://tools.galois.com,
such as that for Cryptol).
saw-script
and themaster
branch (see important note above!)This will sync commits to
master
to the GitBook change history.Dually, if change requests are accepted/merged on GitBook, corresponding
commits will automatically be added to
master
.content in the repository is used to determine the content of the SAW space
on GitBook.
From this point forward, no additional process is required.
Changes made to the manual and tutorials (or any of the other resources added to
power the new site), upon being committed to
master
, will make their way intothe GitBook site, automatically keeping the online renderings up-to-date.
Starting From GitBook Instead
It is possible to perform an initial sync in the other direction, from GitBook
to GitHub.
We could, instead of what is outlined above:
doc/
todoc_old/
, creating a new/emptydoc/
..gitbook.yaml
containing onlyroot: ./doc/
.These changes must be committed/merged to
master
before continuing.Then, follow the steps in the previous section, except at step (4), perform the
initial sync in the GitBook -> GitHub direction.
While this seems like an overall simpler setup process (as it avoids creating
the additional pages we don't already have sources for), it has a number of
disadvantages:
master
before the initialsync is performed.
The preparation necessary for an initial GitHub -> GitBook sync, while clearly
more complex, at least makes logical sense as changes to the
saw-script
repository.
the Markdown files.
By controling the layout up front and in the repository, we are able to
maintain that layout (and any potential changes to it) in the repository,
rather than having to adapt to GitBook's decisions.
taken to use the up-to-date versions of the manual/tutorials during the change
from
doc_old/
to the newly-fetcheddoc/
.By starting from the repository's layout, we guarantee our initial sync pushes
this most up-to-date version to GitBook straight away.
By handling repository preparation ourselves, we also give ourselves the
chance to do a full pass over all of the content, allowing for glaring issues to
be addressed as we go about this change.
Advantages/Disadvantages
This approach has significant advantages over a home-grown solution, but is also
subject to disadvantages, largely in the difficulty of testing/debugging the
solution, and the tedium of preparing the repository.
On the positive side:
be reflected online immediately upon committing to
master
.In addition, this mechanism adds a 'preview' to PRs on GitHub allowing
contributors to see the effect of any changes to the manual/tutorials/other
documentation before finalizing the merge, so they know any content updates
render properly - no need to generate HTML/PDFs locally.
As for negatives:
master
) before official deployment, there is no straightforward way to testthis synchronization mechanism.
the work already done to get it on the new site (because GitBook does not
provide a way to download the Markdown sources, except through GitHub Sync.)
If we want to avoid that work, we would need to take the GitBook -> GitHub
initial sync approach.
All of these negatives are a one-time cost rather than long-term maintenance,
leading me to believe this is our best bet given the positives.
Footnotes
Indeed, this step used to be even more involved, requiring an
additional step to generate suitable HTML to deploy to https://saw.galois.com.
This site was replaced with https://tools.galois.com/saw, a GitBook space
that can (fortunately) render CommonMark Markdown by default. ↩
This would be a reasonable choice, as GitBook allows the entire space to
be exported as a PDF. The "Galois
Whitepaper" styling is no longer present, however, and can't be added to the
GitBook system. I doubt this is much of a problem. ↩
The text was updated successfully, but these errors were encountered: