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

Add smv_refs_filter_fn config option #80

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eddyashton
Copy link

Regexes are simple and easily transferable, but have limited expressivity. We've found that the regex options cannot express all the restrictions we may want, and even where they can be expressed as a regex they're often restrictive. For instance we want to limit the number of old release tags that we still build the docs for, and we currently do that with a regex which attempts to match a minimum semver value.

It would be more expressive if we could simply pass a function which looks at each gitref and decides if we want to build docs for it. Additionally, this function can sort the gitrefs (so we don't need to try and express the order in a template later), and rewrite the other metadata if required (I was hoping to set an is_release bool here, but it turns out that's set later).

This adds a new config option which takes a callable to transform (or, I guess, entirely reconstruct!) the retrieved gitrefs. The only non-obvious change is that I had to make load_sphinx_config execute in-process for the first call, so that the callable is correctly retained and not lost when the loading process closes. This is a partial reversion of #30, but I believe its safe - the separate process is still used to parse the config for all the other configs, ensuring that they get the correct local conf.py.

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.

1 participant