googleapis / google-cloud-node

Google Cloud Client Library for Node.js
https://cloud.google.com/nodejs
Apache License 2.0
2.9k stars 591 forks source link

multiple repetitions in Google Cloud Vision API: Node.js Samples, broken markdown too #5684

Closed davie-robertson closed 5 days ago

davie-robertson commented 5 days ago

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

N/A

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/googleapis/google-cloud-node/blob/e67caa6c09990a161a58f7bef7fa6481ddda1f97/packages/google-cloud-vision/samples/README.md

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. look for sample code for using ImageAnnotator.safeSearchDetection in the Google Cloud Vision API: Node.js Samples
  2. See a list of examples Samples Image_annotator.async_batch_annotate_files Image_annotator.async_batch_annotate_images Image_annotator.batch_annotate_files Image_annotator.batch_annotate_images Product_search.add_product_to_product_set Product_search.create_product Product_search.create_product_set Product_search.create_reference_image Product_search.delete_product Product_search.delete_product_set Product_search.delete_reference_image Product_search.get_product Product_search.get_product_set Product_search.get_reference_image Product_search.import_product_sets Product_search.list_product_sets Product_search.list_products Product_search.list_products_in_product_set Product_search.list_reference_images Product_search.purge_products Product_search.remove_product_from_product_set Product_search.update_product Product_search.update_product_set Image_annotator.batch_annotate_images Image_annotator.async_batch_annotate_files Image_annotator.batch_annotate_images Image_annotator.async_batch_annotate_files Image_annotator.batch_annotate_images Product_search.add_product_to_product_set Product_search.create_product Product_search.create_product_set Product_search.create_reference_image Product_search.delete_product Product_search.delete_product_set Product_search.delete_reference_image Product_search.get_product Product_search.get_product_set Product_search.get_reference_image Product_search.import_product_sets Product_search.list_product_sets Product_search.list_products Product_search.list_products_in_product_set Product_search.list_reference_images Product_search.remove_product_from_product_set Product_search.update_product Product_search.update_product_set Image_annotator.async_batch_annotate_files Image_annotator.async_batch_annotate_images Image_annotator.batch_annotate_files Image_annotator.batch_annotate_images Product_search.add_product_to_product_set Product_search.create_product Product_search.create_product_set Product_search.create_reference_image Product_search.delete_product Product_search.delete_product_set Product_search.delete_reference_image Product_search.get_product Product_search.get_product_set Product_search.get_reference_image Product_search.import_product_sets Product_search.list_product_sets Product_search.list_products Product_search.list_products_in_product_set Product_search.list_reference_images Product_search.purge_products Product_search.remove_product_from_product_set Product_search.update_product Product_search.update_product_set Quickstart
  3. Click an examples thinking it will show the code, it doesn't
  4. Scroll down the page once you realise the hyperlinks don't work
  5. See repetition (3x?) of all the sample code
  6. Notice that all the Image_annotator sample contain batch_annotate but many are not batch annotations

A clear and concise description of what the bug is, and what you expected to happen.

The generator for the README.md seem to be broken.

The Google Cloud Vision API: Node.js Samples page should contain a list of sample code snippets that the user can click on and view.

It seems that all the code samples for all the branches versions are being placed into the same readme file, without clearly indicating to the user what version the sample code is for.

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

The README.md for code samples should be generated separately for each branch of code.

The ToC should link to code samples

I would have done a PR to fix this, but the code states:

github-actions[bot] commented 5 days ago

Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)

davie-robertson commented 5 days ago

the link is to the code in github with the errors: https://github.com/googleapis/google-cloud-node/blob/e67caa6c09990a161a58f7bef7fa6481ddda1f97/packages/google-cloud-vision/samples/README.md

or here: https://github.com/googleapis/google-cloud-node/tree/e67caa6c09990a161a58f7bef7fa6481ddda1f97/packages/google-cloud-vision/samples