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

Upgrade yard-doctest dependency #2415

Merged
merged 8 commits into from Sep 10, 2018

Conversation

blowmage
Copy link
Contributor

@blowmage blowmage commented Sep 10, 2018

The yard-doctest gem is used to test the code examples in documentation.
Upgrade the dependency to include the ability read .yardopts and exclude files.
Add the yard rake task to CI and enable yard documentation warnings.
Include a couple small documentation fixes as well.

[closes #2293, #2296, #2299, #2301, #2314, #2324, #2326, #2329]

This new version ignores files excluded from .yardopts.
This reduces the warnings for files YARD doesn't know how to document.
The latest versions of yard-doctest have changed how context is determined.
Move this helper so it will work with the latest version.
The yard-doctest plugin isn't being loaded on CI.
Ensure that plugins are loaded so doctest runs properly.
We should fail a build if generating documentation gives a warning.
Not every gem can do this yet, as there are still unresolved warnings.
@blowmage blowmage added the type: docs Improvement to the documentation for an API. label Sep 10, 2018
@blowmage blowmage self-assigned this Sep 10, 2018
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 10, 2018
@quartzmo
Copy link
Member

I pulled the branch, ran bundle update, then removed existing doc directories. In handwritten libs such as google-cloud-bigquery, I see no warnings. However, in the generated libs that I tried I see warnings:

Chriss-iMac:google-cloud-dataproc quartzmo$ bundle exec rake yard
[error]: Error loading plugin 'yard-doctest'
[warn]: The proxy Google::Cloud::Dataproc::V1::ClusterControllerClient::OperationsClient.self has not yet been recognized.
If this class/method is part of your source tree, this will affect your documentation results.
You can correct this issue by loading the source file for this object before `lib/google/cloud/dataproc/v1/cluster_controller_client.rb'

[warn]: The proxy Google::Cloud::Dataproc::V1::ClusterControllerClient::OperationsClient.self has not yet been recognized.
If this class/method is part of your source tree, this will affect your documentation results.
You can correct this issue by loading the source file for this object before `lib/google/cloud/dataproc/v1/cluster_controller_client.rb'

[warn]: In file `lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb':51: Cannot resolve link to Google::Longrunning::Operations::GetOperation from text:
	...{Google::Longrunning::Operations::GetOperation Operations::GetOperation}...
[warn]: In file `lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb':57: Cannot resolve link to Google::Longrunning::Operations::ListOperations from text:
	...{Google::Longrunning::Operations::ListOperations Operations::ListOperations}...
[warn]: In file `lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb':72: Cannot resolve link to Google::Longrunning::Operations::ListOperations from text:
	...{Google::Longrunning::Operations::ListOperations Operations::ListOperations}...
[warn]: In file `lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb':81: Cannot resolve link to Google::Longrunning::Operations::CancelOperation from text:
	...{Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}...
[warn]: In file `lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb':87: Cannot resolve link to Google::Longrunning::Operations::DeleteOperation from text:
	...{Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}...
Files:          14
Modules:        18 (   10 undocumented)
Classes:        55 (    1 undocumented)
Constants:      60 (    9 undocumented)
Attributes:    103 (    0 undocumented)
Methods:        18 (    0 undocumented)
 92.13% documented

@quartzmo
Copy link
Member

And:

Chriss-iMac:google-cloud-dataproc quartzmo$ bundle exec rake doctest
[error]: Error loading plugin 'yard-doctest'
The google-cloud-dataproc gem does not have doctest tests.

@blowmage
Copy link
Contributor Author

I didn't update the GAPIC-generated gems to fail on YARD warnings, only the veneer gems. But I don't see any warnings on dataproc, nor do i see the warning on CircleCI or Kokoro.

@blowmage
Copy link
Contributor Author

I should clarify, I don't see any warnings in the ci output.

@quartzmo
Copy link
Member

Hmm, I also do not see the warnings on rake ci. What happens to them?

Chriss-iMac:google-cloud-dataproc quartzmo$ bundle exec rake ci
[error]: Error loading plugin 'yard-doctest'

######################################
### BUILDING google-cloud-dataproc ###
######################################
...

bundle exec rake doctest
[error]: Error loading plugin 'yard-doctest'
The google-cloud-dataproc gem does not have doctest tests.

@quartzmo
Copy link
Member

nm, I get it, rake ci only runs rake doctest, not rake yard.

@quartzmo
Copy link
Member

I don't think this PR should close issues such as #2297 (and similar), since it does not resolve the YARD warnings, which can still be seen when running rake yard for these gems.

@blowmage
Copy link
Contributor Author

The following veneer gems still have documentation warnings, and are being allowed to raise documentation warnings because their warnings are still unaddressed:

  • Bigtable
  • Datastore
  • Error Reporting
  • Firestore
  • Logging
  • Spanner
  • Vision

@blowmage
Copy link
Contributor Author

This PR isn't closing #2297, or any other generated gem. It is only closing hand-written gems that no longer have warnings.

@quartzmo
Copy link
Member

@blowmage There's nothing we can do in generated gems to prevent this error, is there?

[error]: Error loading plugin 'yard-doctest'

Copy link
Member

@quartzmo quartzmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So great to be able to use the latest yard-doctest releases! Bravo @blowmage!!!

@blowmage
Copy link
Contributor Author

@quartzmo to get rid of that error locally, run this:

$ rm -rf ~/.yard/

@blowmage blowmage merged commit 0b2ba69 into googleapis:master Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQuery Documentation warnings
3 participants