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

Docs build in google-ai-generativelanguage fails #1776

Open
parthea opened this issue Sep 20, 2023 · 4 comments
Open

Docs build in google-ai-generativelanguage fails #1776

parthea opened this issue Sep 20, 2023 · 4 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.

Comments

@parthea
Copy link
Contributor

parthea commented Sep 20, 2023

I had to manually fix a google-cloud-python PR that had a comment looking like this:

        Returns:
            google.ai.generativelanguage_v1beta3.types.Permission:
                Permission resource grants user,
                group or the rest of the world access to
                the PaLM API resource (e.g. a tuned
                model, file).
                A role is a collection of permitted
                operations that allows users to perform
                specific actions on PaLM API resources.
                To make them available to users, groups,
                or service accounts, you assign roles.
                When you assign a role, you grant
                permissions that the role contains.
                There are three concentric roles. Each
                role is a superset of the previous
                role's permitted operations:
                 - reader can use the resource (e.g.
                  tuned model) for inference
                 - writer has reader's permissions and
                  additionally can edit and share
                 - owner has writer's permissions and
                  additionally can delete

The issue is that sphinx does not expect a blank space before a list item. Sphinx expects to see

        Returns:
            google.ai.generativelanguage_v1beta3.types.Permission:
                Permission resource grants user,
                group or the rest of the world access to
                the PaLM API resource (e.g. a tuned
                model, file).
                A role is a collection of permitted
                operations that allows users to perform
                specific actions on PaLM API resources.
                To make them available to users, groups,
                or service accounts, you assign roles.
                When you assign a role, you grant
                permissions that the role contains.
                There are three concentric roles. Each
                role is a superset of the previous
                role's permitted operations:
                - reader can use the resource (e.g.
                  tuned model) for inference
                - writer has reader's permissions and
                  additionally can edit and share
                - owner has writer's permissions and
                  additionally can delete

We should add this as a test here and also consider proposing an update to AIPs to check if the API protos could follow this convention as well.

See build log here which includes the full stack trace from googleapis/google-cloud-python#11670

@vchudnov-g
Copy link
Contributor

You mention blank lines, but the code snippets in your description and your fix don't deal with blank lines, just with out-denting the list items. At the same time, the build log you reference talks about the error being triggered by a lack of a blank line after the indented list items.

Is the issue that when the list items are indented, they need to be followed by a blank line, so it's easier to not indent them if possible?

parthea added a commit to googleapis/google-cloud-python that referenced this issue Sep 21, 2023
…11677)

Here are the steps that I followed to generate this PR

- Update the `default_version` in `.repo-metadata.json` here

https://github.com/googleapis/google-cloud-python/blob/eca60c3027820c97fc12590d0709b8fe3eb54034/packages/google-ai-generativelanguage/.repo-metadata.json#L14
- Work around the docs issue mentioned in
googleapis/gapic-generator-python#1776 by
applying this change locally
- Build the `v1beta2` and `v1beta3` clients locally in a clone of
[googleapis/googleapis](https://github.com/googleapis/googleapis) using
`bazel build
//google/ai/generativelanguage/v1beta3:ai-generativelanguage-v1beta2-py`
and `bazel build
//google/ai/generativelanguage/v1beta3:ai-generativelanguage-v1beta3-py`
- Run the docker containers for the owlbot copy-code and owlbot post
processor
```
 docker run --rm --user $(id -u):$(id -g)   -v $(pwd):/repo   -v /usr/local/google/home/partheniou/git/googleapis/bazel-bin:/bazel-bin   gcr.io/cloud-devrel-public-resources/owlbot-cli:latest copy-bazel-bin   --config-file=packages/google-apps-script-type/.OwlBot.yaml   --source-dir /bazel-bin --dest /repo
 ```
 
```
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo
gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
```

I also had to fix a bug in synthtool for the owlbot post processing: googleapis/synthtool#1861. Without this fix, the [docs/index.rst](https://github.com/googleapis/google-cloud-python/blob/main/packages/google-ai-generativelanguage/docs/index.rst) file would list `v1beta2` as the default import instead of `v1beta3`.

Fixes #11676 🦕
parthea added a commit to googleapis/google-cloud-python that referenced this issue Sep 30, 2023
@ohmayr
Copy link
Contributor

ohmayr commented Oct 16, 2023

I agree with @vchudnov-g that we're not dealing with blank lines in the fix and it only includes outdenting the bullet points even though the build logs have the following error:

Bullet list ends without a blank line; unexpected unindent.

@parthea we'll need some more clarification here.

@ohmayr ohmayr closed this as completed Oct 16, 2023
@ohmayr ohmayr added type: process A process-related concern. May include testing, release, or the like. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Oct 16, 2023
@ohmayr ohmayr reopened this Oct 16, 2023
@parthea
Copy link
Contributor Author

parthea commented Oct 16, 2023

The error mentions Bullet list ends without a blank line; unexpected unindent. but my comment doesn't mention blank line.

The issue is that sphinx does not expect a blank space before a list item.

Perhaps the error from sphinx is misleading. Please see my comment The issue is that sphinx does not expect a blank space before a list item.

parthea added a commit to googleapis/google-cloud-python that referenced this issue Dec 7, 2023
@parthea parthea changed the title Docs build in google-ai-generativelanguage fails with Bullet list ends without a blank line; unexpected unindent Docs build in google-ai-generativelanguage fails Dec 9, 2023
@parthea
Copy link
Contributor Author

parthea commented Dec 9, 2023

Capturing another docs issue with google-ai-generativelanguage

See https://github.com/googleapis/googleapis/blob/b54255c0ad0a432c29ae3e15fd79a53c5ebc03b1/google/ai/generativelanguage/v1beta/retriever.proto#L74-L75 where there is an asterisk character which is not surrounded by backticks or escaped.

This caused the docs build to fail with

sphinx.errors.SphinxWarning: /usr/local/google/home/partheniou/git/google-cloud-python/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/retriever.py:docstring of google.ai.generativelanguage_v1beta.types.retriever.Document:6:Inline emphasis start-string without end-string.

Warning, treated as error:
/usr/local/google/home/partheniou/git/google-cloud-python/packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/types/retriever.py:docstring of google.ai.generativelanguage_v1beta.types.retriever.Document:6:Inline emphasis start-string without end-string.

Instead of

  // Immutable. Identifier. The `Document` resource name. The ID (name excluding
  // the "corpora/*/documents/" prefix) can contain up to 40 characters that are

It should be

  // Immutable. Identifier. The `Document` resource name. The ID (name excluding
  // the `corpora/*/documents/` prefix) can contain up to 40 characters that are

See https://github.com/googleapis/google-cloud-python/actions/runs/7147914046/job/19468207013?pr=12106

We should add a linter rule to check for unsupported formatting in proto comments via https://github.com/googleapis/api-linter .

parthea added a commit to googleapis/google-cloud-python that referenced this issue Dec 9, 2023
parthea added a commit to googleapis/google-cloud-python that referenced this issue Dec 9, 2023
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jan 20, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jan 20, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jan 24, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jan 24, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Feb 1, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Feb 1, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Feb 4, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Feb 4, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Feb 21, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Feb 21, 2024
ohmayr pushed a commit to googleapis/google-cloud-python that referenced this issue Apr 3, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Apr 3, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Apr 12, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Apr 12, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Apr 12, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Apr 12, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Apr 24, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue May 7, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue May 7, 2024
Towards #12326 🦕

See googleapis/gapic-generator-python#1776

Co-authored-by: ohmayr <omairnaveed@ymail.com>
ohmayr pushed a commit to googleapis/google-cloud-python that referenced this issue May 7, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue May 10, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue May 11, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue May 11, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue May 16, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue May 16, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Jun 5, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jun 11, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Jun 20, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Jun 24, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Jun 24, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jul 8, 2024
parthea added a commit to googleapis/google-cloud-python that referenced this issue Jul 30, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
Towards #12326 🦕

See googleapis/gapic-generator-python#1776

Co-authored-by: ohmayr <omairnaveed@ymail.com>
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
Towards #12326 🦕

See googleapis/gapic-generator-python#1776

Co-authored-by: ohmayr <omairnaveed@ymail.com>
ohmayr added a commit to googleapis/google-cloud-python that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

3 participants