docs: canonicalize legacy setting names and update generators#22503
docs: canonicalize legacy setting names and update generators#22503devin-ai-integration[bot] wants to merge 7 commits into
Conversation
- Replace stale legacy env var names in docs, source docstrings, shipped profiles, and test fixtures. - Fix CLI generator for Cyclopts and regenerate CLI docs. - Regenerate Python API reference and OpenAPI schema for affected modules. - Add smoke test for generate_cli_docs.py. Co-authored-by: alex.s <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8839871d87
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if _parameter_is_hidden(meta): | ||
| continue |
There was a problem hiding this comment.
Preserve public automation name arguments
Skipping every Cyclopts parameter with show=False also drops public positional arguments that are hidden from CLI help but still accepted, such as prefect automation inspect/resume/pause/delete NAME (src/prefect/cli/automation.py still defines the name parameter). The regenerated automation reference now shows only [OPTIONS], so name-based invocation disappears from the docs; avoid blanket-skipping these public positionals or document them another way.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Updated scripts/generate_cli_docs.py to keep public positional arguments that are hidden from --help (e.g. prefect automation inspect/resume/pause/delete NAME). Regenerated automation.mdx so those commands now show [OPTIONS] [NAME] and an Arguments section. Addressed in 63ab069.
| --- | ||
| title: " " | ||
| sidebarTitle: prefect plugins | ||
| --- |
There was a problem hiding this comment.
Register the plugins CLI reference page
This new non-hidden page is not added to the CLI Reference list in docs/docs.json (checked the navigation entries around the existing v3/api-ref/cli/worker item). Mintlify sidebar navigation only includes registered pages, so the new prefect plugins command reference will not be discoverable unless v3/api-ref/cli/plugins is added to the nav or the page is hidden/removed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Registered v3/api-ref/cli/plugins in the CLI Reference navigation group in docs/docs.json. Addressed in 63ab069.
| @pytest.fixture(scope="module") | ||
| def generate_cli_docs(script_path: Path): |
There was a problem hiding this comment.
Add required type hints to the new fixture
tests/AGENTS.md requires full type hints on tests and fixtures, including return type hints on fixtures. This new fixture is untyped and feeds an untyped callable into the test, so it violates the repository's test typing rule; annotate the fixture return value and the test parameter with the callable type.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Added return-type hint to the fixture (Callable[[str], None]) and annotated the test parameter the same way. Addressed in 63ab069.
Merging this PR will not alter performance
Comparing Footnotes
|
…v, type hints - Preserve public positional arguments hidden from --help (e.g. prefect automation NAME). - Include hidden options like --log-output that were in previous generated docs. - Register the new v3/api-ref/cli/plugins page in docs/docs.json. - Add full type hints to the new generate_cli_docs smoke-test fixtures. - Add help text to automation name arguments for generated docs. Co-authored-by: Alex S. <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
Canonicalize legacy Setting objects in _get_settings_fields so canonical and alias env var names map to one Setting, preventing duplicate keys in Profile.settings. Update config view/unset to use canonical names consistently and update test_config.py to use canonical setting names. Canonicalize PREFECT_SERVER_DATABASE_CONNECTION_URL in prefect-azure README. Co-authored-by: Alex S. <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
…LI docs Add durable Examples sections and positional argument help to api, artifact, automation, deployment, events, global-concurrency-limit, and work-pool CLI commands. Update generate_cli_docs.py to trim trailing blank lines from generated MDX files. Expand the generate_cli_docs smoke test to assert METHOD/PATH help, api examples, plugins.mdx generation, and automation NAME argument preservation. Regenerate v3/api-ref/cli/*.mdx. Co-authored-by: Alex S. <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
Apply ruff-format fixes to config, legacy, test_config, and generate_cli_docs smoke test. Co-authored-by: Alex S. <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
…examples, hide hidden options - Canonicalize `_cast_settings` and `prefect config view` env/.env loops so canonical setting names take precedence over legacy aliases and output is deterministic. - Restore pre-3.7 `PREFECT_EXPERIMENTS_PLUGINS_ENABLED=true` guidance to the Azure integration and self-hosting docs. - Add durable CLI examples back into source docstrings for block register, deployment delete, flow-run retry/list, global-concurrency-limit create, sdk generate, transfer, work-pool subcommands, and automation create/update/inspect/pause/resume. - Update `scripts/generate_cli_docs.py` to skip options with `show=False` while still documenting hidden positional arguments (e.g. automation `NAME`). - Correct the `prefect artifact inspect` docstring example to use `--output json` for JSON output. - Regenerate CLI docs and expand `tests/scripts/test_generate_cli_docs.py`. Co-authored-by: Alex S <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
- Test canonical names take precedence over legacy aliases in Profile._cast_settings regardless of TOML input order. - Test config validate persists only the canonical key/value. - Test config view prefers canonical env vars and .env keys over their legacy aliases and falls back to aliases when canonical is missing. Co-authored-by: Alex S <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
Canonicalizes stale legacy Prefect setting names in docs, source docstrings, shipped profiles, and generated reference artifacts. This update also addresses the five remaining review findings from the initial review.
What changed
src/prefect/settings/profiles.pynow resolves profile settings with canonical-first precedence: canonical keys always win over legacy aliases, andsrc/prefect/cli/config.pygroups and sorts environment/.envaliases deterministically by canonical setting name.prefect config set PREFECT_SERVER_ALLOW_EPHEMERAL_MODE=falsenow overwrites the canonical key, andprefect config viewno longer depends on hash-seed/TOML ordering.PREFECT_EXPERIMENTS_PLUGINS_ENABLED=truefallback note back todocs/integrations/prefect-azure/index.mdxanddocs/v3/advanced/self-hosted.mdx.Examples:sections and guidance tosrc/prefect/cli/artifact.py,automation.py,block.py,deployment.py,flow_run.py,global_concurrency_limit.py,sdk.py,transfer/_commands.py, andwork_pool.py, then regenerated all CLI docs.scripts/generate_cli_docs.pynow skipsshow=Falseoptions while still documenting accepted hidden positional arguments (e.g. the automationNAMEargument).prefect artifact inspectexample now uses--output jsonfor JSON output.tests/scripts/test_generate_cli_docs.pyto assert the restored examples and hidden-option filtering.Backward compatibility
Legacy aliases remain accepted at runtime and are still enumerated in:
docs/v3/api-ref/settings-ref.mdxsupported_environment_variablesarraysA final audit found no unintended
PREFECT_API_DATABASE_*orPREFECT_API_SERVICES_*occurrences indocs/orsrc/integrations/prefect-azure/README.md.Validation
tests/cli/test_config.pypasses.tests/test_settings.pypasses.tests/scripts/test_generate_cli_docs.pypasses.docs/v3/api-ref/cli/).ruff check/ruff formatpass for all changed Python files.git diff --checkis clean.PREFECT_API_DATABASE_*/PREFECT_API_SERVICES_*names.Checklist
<link to issue>"mint.json.Link to Devin session: https://app.devin.ai/sessions/516ff2ee2924416a8ee6ba376aeb5eb6
Requested by: @desertaxle