Conversation
Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>
* feat: add subPackage types * fix: update type in summary and use markdown to highlight names * fix: use short and disambiguated names * nit: update to f string for single-line string
* feat: add subclasses to children and reference * chore: lint * nit: update comment to clarify confusion
Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com>
* accept change from upstream * feat: add full support for xrefs * test: update test case * fix: expand xref format for proper processing * test: update unit test * fix: handle xrefs for other products in the future
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: allow bracketed xref to work * test: update unit test * test: update to include xref checking in unit test
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: parse xrefs differently with new xref format * fix: update Docstring parser * test: update unit test * fix: move error catching to another block * test: update unittest to include error scenarios * fix: clean up messy formatting
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@facee4c Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* fix: recover lost arguments to functions * fix: add default argument types * fix: work for None type arguments * fix: omit variables without types * chore: update comment about default arguments * chore: fix to make comment more readable
* feat: group left-nav entries by versions * fix: remove uid from package groups, fix index * fix: disambiguate only on index and not on toc * chore: add unit test
* fix: retrieve file name as much as possible * fix: use default return when there are duplicates
* feat: add markdown page support * feat: add sphinx-markdown-builder in the plugin * chore: add docuploader to setup.py * test: skip running markdown builder for unittest * chore: fix Kokoro * test: run Kokoro test against head of the branch only * chore: update comments * fix: address comments from PR * fix: lint updates * test: add unit test coverage for new function added * revert(test): revert testing only against HEAD * chore: update comment with issues referenced inline * test: add test case with space after the hashtag
* fix: use the uid when applicalbe for toc entries * test: use latest build for Kokoro * test: revert kokoro setting * test: update test case * fix: remove check_name_with_uid function * chore: lint update
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* fix: do not omit arguments retrieved from docstring * chore: update comments
* fix: check for markdown header more carefully * test: update unit test * fix: update parser and unit test * fix: removing redundant code and adding comment * test: update lint and open file formats * fix: update to parse_markdown_header
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Adding support for handling docstring items in `top_summary`. Notably, `.. code-block::` and `.. attributes::` will be supported, and any other items as they appear.
Similar to how return/exception/params were extracted, iterating through the summary to look for keywords like `code-block`, `attribute` and more in patterns that show up in `.. keyword::` format. If the docstring is malformed from the source, we do not handle it in the plugin. Hand-written docstrings may not work well against the autogenerated reStructuredText, however we should fix those from the client library side than to make special adjustments in the plugin like the bad formatted keywords.
For each keyword:
- For `code-block`, convert the code snippet in code block using multi-line commenting blocks.
- code should be indented, extract lines until there is no indentation/leading whitespace found and/or found other keywords.
- Adjust spacing and line breaks as necessary to better display them on cloud site.
- For `attributes`, there are 3 main parts: name, description and type.
- Extract the name first, followed by the description, then type. Once all 3 are extracted, add it to the list of attributes.
- Attributes will be added to the YAML file directly, to be processed in doc-templates.
- If attributes are not well formatted, do not add them to the list to be outputted to YAML.
Afterwards, incorporate them back into `top_summary` and to be added into the YAMLs.
Fixes internally filed issue.
- [x] Tests pass
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* test: update kokoro job to continue on failure * fix: update comments
* chore: move Renovate config to .github, turn off dashboard * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* fix: make the plugin be more verbose * fix: include file path when necessary * fix: consolidate error message * fix: update to use string join
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request consolidates the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request migrates the gcp-sphinx-docfx-yaml package to a new monorepo structure, involving extensive updates across GitHub configurations, Kokoro build scripts, and project metadata files. Key changes include updating CODEOWNERS, issue templates, CI/CD workflows, and dependency management. The review highlights several critical issues: f-string syntax errors in docfx_yaml/extension.py, outdated repository paths in Kokoro configurations, and incorrect URLs in .repo-metadata.json, CHANGELOG.md, and bug_report.md. Additionally, there's a typo in an error message and suggestions to improve logging practices by directing error/warning messages to sys.stderr and using consistent command substitution syntax in shell scripts.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/gcp-sphinx-docfx-yaml/docfx_yaml/extension.py (600-601)
The f-string for this ValueError is split across two lines, which will result in a SyntaxError. It should be combined into a single line.
raise ValueError(f"Content in the block should be indented.Please check the docstring: \n{summary}")packages/gcp-sphinx-docfx-yaml/docfx_yaml/extension.py (625-626)
The f-string for this ValueError is split across two lines, which will result in a SyntaxError. It should be combined into a single line.
raise ValueError("Content in the block should be indented."f"Please check the docstring: \n{summary}")packages/gcp-sphinx-docfx-yaml/.kokoro/continuous/common.cfg (17-26)
The paths for build_file and TRAMPOLINE_BUILD_FILE seem to refer to the old repository structure (sphinx-docfx-yaml). Since the code is being migrated to packages/gcp-sphinx-docfx-yaml, these paths might need to be updated to reflect the new location within the monorepo (e.g., packages/gcp-sphinx-docfx-yaml/.kokoro/trampoline.sh). This same issue appears to be present in docs/common.cfg and presubmit/common.cfg as well. Please verify that these paths are correct for the new repository structure.
packages/gcp-sphinx-docfx-yaml/.repo-metadata.json (4-9)
The URLs for product_documentation, client_documentation, issue_tracker, and the repo field appear to point to the old repository (googleapis/sphinx-docfx-yaml). Since this PR is migrating the code, these values should be updated to reflect the new location.
packages/gcp-sphinx-docfx-yaml/.github/ISSUE_TEMPLATE/bug_report.md (13)
This link points to the old repository's issues. It should be updated to point to the new issue tracker for this package. This value is likely derived from .repo-metadata.json, which also seems to contain outdated information.
packages/gcp-sphinx-docfx-yaml/.kokoro/generate-docs.sh (91)
For consistency and to avoid potential issues with nesting, it's better to use $(...) for command substitution instead of backticks.
GITHUB_TAGS=$(git describe --tags $(git rev-list --tags --max-count=1))
packages/gcp-sphinx-docfx-yaml/CHANGELOG.md (7)
The links in the changelog, such as the one on this line, point to the old repository googleapis/sphinx-docfx-yaml. These should be updated to reflect the new repository structure.
packages/gcp-sphinx-docfx-yaml/docfx_yaml/extension.py (80-81)
It's a best practice to write error messages to sys.stderr rather than sys.stdout. This allows for better separation of standard output and error streams. You'll need to import the sys module.
print(Bcolors.FAIL + 'can not import conf.py! ' 'you should have a conf.py in working project folder' + Bcolors.ENDC, file=sys.stderr)packages/gcp-sphinx-docfx-yaml/docfx_yaml/extension.py (432)
There is a typo in the error message. "enoucntered" should be "encountered".
raise ValueError(f"Wrong formatting encountered for \n{line}")
packages/gcp-sphinx-docfx-yaml/docfx_yaml/extension.py (1475)
This error message should be printed to sys.stderr instead of sys.stdout for better error handling and stream separation. You'll need to import the sys module.
print(f"Could not format the given code: \n{e})", file=sys.stderr)
packages/gcp-sphinx-docfx-yaml/docfx_yaml/writer.py (1157)
System message warnings should be printed to sys.stderr to separate them from standard output. You'll need to import the sys module.
print(bcolors.WARNING + "System message warnings: %s" % node.astext() + bcolors.ENDC, file=sys.stderr)
6f94786 to
7824260
Compare
See #15998.
This PR should be merged with a merge-commit, not a squash-commit, in order to preserve the git history.