-
Notifications
You must be signed in to change notification settings - Fork 141
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
Rewrite mirror configuration documentation #1669
Conversation
I'm going to try using code fence syntax for directives and see if that's enough to smooth things over. (Writing an mdformat plugin feels excessive.) Update: that worked, and mdformat seems happy now even without changing |
c5692c1
to
3f7bfe5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1669 +/- ##
=======================================
Coverage 83.57% 83.57%
=======================================
Files 31 31
Lines 4328 4328
Branches 781 781
=======================================
Hits 3617 3617
Misses 524 524
Partials 187 187 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good to me so far. Just left some minor comments.
directory = /srv/pypi-filtered | ||
simple-format = ALL | ||
release-files = false | ||
root_uri = https://files.pythonhosted.org/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR - but, If we need root_uri
when release-files is false, maybe we should open an issue to fix that. Seems unneeded right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current behavior is that if release-files
is false, root_uri
will default to https://files.pythonhosted.org/
, so not required per-se.
I'll have to check, but I suspect setting root_uri =
and release-files = false
would still generate the index files with relative URLs, so I guess it's a matter of what we think the most intuitive default behavior is for release-files
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, lets just document what happens in this PR and if we feel we can discuss changing it in a dedicated issue.
docs/mirror_configuration.md
Outdated
|
||
The mirror json setting is a boolean (true/false) setting that indicates that | ||
the json packaging metadata should be mirrored in addition to the packages. | ||
; per-coroutine time limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget what this is, but is it just an overall maximum time each worker coroutine can run? If so, maybe we should explain that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the existing docs and default.conf
I believe it's the maximum runtime for each aiohttp coroutine, but this would be a good one to track down in the source to confirm that and perhaps explain more clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if you have time, won't block the PR on it.
docs/mirror_configuration.md
Outdated
### `cleanup` | ||
|
||
Example: | ||
Enable cleanup of legacy simple directories with non-normalized names. | ||
|
||
```ini | ||
[mirror] | ||
proxy=http://myproxy.com | ||
:Type: boolean | ||
:Default: false | ||
|
||
Bandersnatch versions prior to 4.0 used directories with non-normalized package names for compatability with older versions of pip. Enabling this option checks for and removes these directories. | ||
|
||
```{seealso} | ||
[Python Packaging User Guide - Names and Normalization](https://packaging.python.org/en/latest/specifications/name-normalization/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should prob remove this one day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to go ahead and indicate that it's deprecated in the docs? (Though I suppose technically that requires a version bump even if its just the documented status that changes?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, will not hurt to do so.
I would still like to track down how |
I'm happy to merge as is and you can do smaller PRs addressing the global-timeout etc. etc. if you like - but happy to do it how ever you want :)
|
- Add options that were missing from the documentation - Document expected defaults for all options - Group examples into larger snippets that show related options being used together - Show the type and default value for each option in a consistent, non-prose format - Rewrite option short descriptions to be more concise - Make extensive (or excessive?) use of cross references - Add examples of how different options affect mirror directory structure - Embed the content of `src/bandersnatch/default.conf` for user reference
Apply suggested tweaks to option descriptions. Co-authored-by: Cooper Lees <me@cooperlees.com>
- Remove explicit reference targets and use heading anchors instead - Remove file name for links to headings in the same document
- Elaborate a little in the description for 'simple-format', & include a link to PEP-691 - Add note regarding environment variables & SOCKS support in the description of 'proxy' * the aiohttp client setup in Master checks the noted environment variables & adds aiohttp-socks to the client session if it sees a socks URL * if there wasn't a socks URL, 'trust_env' is set to True, which sets aiohttp to use urllib.request.getproxies to scan the environment for proxy configuration.
This changes the mirror config documentation to match reality, where the current config reading implementation makes more options required than originally intended / strictly necessary. All options now have a `Required` field in addition to `Type` and `Default`. Intended future defaults for required fields are moved into the option description / recommendations. Updates example configs to always include required options. I also found that the output of `[mirror].json` appears to be required for running `bandersnatch verify`.
- Checked the example mirror configuration snippets and corrected mistakes - they should all work with 'bandersnatch mirror' when combined with filter plugin config. - Corrected the default value for 'diff-file' and tweak description - Add entry to CHANGES
6117a75
to
592d36c
Compare
I tested the example configurations and did find some corrections, so I'm glad I did that. 😄 I also corrected the default value for During the config testing I stumbled into a few things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this PR and all the findings. Feel free to open Issues or just submit PRs if time permits!
This is a rewrite of the documentation page
docs/mirror_configuration.md
in preparation for fixing the default value issue in #990. I set out to make sure all the options and defaults were documented and got a bit carried away. If this is too drastic of a change, I'm happy to backpedal to an update that only adds missing options and defaults.Summary of Major Changes
[mirror]
options that were not listed on the mirror configuration page, e.g.:storage-backend
digest_name
cleanup
download-mirror-no-fallback
keep_index_versions
master
,global-timeout
,timeout
,workers
, andhash-index
when a user gives a config file that is missing any of those options.src/bandersnatch/default.conf
for user referencePage Organization
The reference for each option is organized like this:
I am hoping this makes the page more skimmable, but am unsure.