open-policy-agent / opa

Open Policy Agent (OPA) is an open source, general-purpose policy engine.
https://www.openpolicyagent.org
Apache License 2.0
9.68k stars 1.34k forks source link

docs: Review documentation site generation for versioned OPA docs #7037

Open charlieegan3 opened 1 month ago

charlieegan3 commented 1 month ago

Currently we use Hugo to build a website for OPA's homepage and documentation content. There are some sharp edges in this setup:

These issues make it hard to maintain the docs, and, I feel, place the bar to drive by docs contributions too high.

I think we should consider a system where:

Most of the time, you don't need versioning as it will just increase your build time, and introduce complexity to your codebase. Versioning is best suited for websites with high-traffic and rapid changes to documentation between versions. If your documentation rarely changes, don't add versioning to your documentation.

What if we only versioned a limited set of pages, for example:

srenatus commented 1 month ago

Sorry you ran into this problem: the website build only doing the latest version was intentionally done for dev and preview (https://github.com/open-policy-agent/opa/issues/4379) because it took so long to always build everything. As a workaround, when doing "global changes" that need the previous versions, I've tended to revert this Makefile change, which would make netlify build everything for a preview.

Taking a step back as suggested, I think the versioning isn't needed, or it's even harmful. Besides complicating the build process (since Hugo wasn't made for this), it also makes people find old content, use old images, etc.

Where it is important is when it comes to builtins and when they've been introduced -- but we already have introduced those version tags:

image

What if we only versioned a limited set of pages, for example:

What if we didn't? 😅 The policy reference hasn't changed much since "every". There's going to be a v1 release eventually and we will stop pretending that "in", "every", "contains" are optional future stuff -- it's just Rego.

The REST API hasn't changed at all, I think, in the last years.

The CLI changes are usually minimal, but it would help if you had a chance to figure out when a flag was introduced -- but really, I think the scenario is like this:

  1. you find a flag in some docs
  2. you try it locally, it's not found
  3. you try to figure out if it's in the latest version

Right now, there's no easy way to figure out when a flag was introduced. You'll have to flip through all the versioned docs...

tl;dr: I think our current approach to versioning docs is rather blunt and worth revisiting. I've never referred to anything but the "latest" docs (and maybe "edge"), and wouldn't shed a single tear if they went away.

charlieegan3 commented 1 month ago

What if we didn't?

I mean, the thought had crossed my mind! 😅

I suppose the other way of thinking about it is that OPA is a more simple component to deploy and update than say, Kubernetes. Kubernetes have a year support period for releases: https://kubernetes.io/releases/patch-releases/#support-period, and various managed offerings have a range of active versions exposed to users via channels.

In OPA we don't really operate releases in the same way and so even though the usage of dated OPA versions is high, it's less important that the docs are timecapsuled for every version for the reasons that Stephan outlines above.

stale[bot] commented 1 week ago

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.