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

googleapis 11.0.0 URL pattern for libraries changed, display names for libraries changed #3396

Closed
jonasfj opened this issue Apr 25, 2023 · 4 comments
Labels
needs-info Additional information needed from the issue author P3 A lower priority bug or feature request

Comments

@jonasfj
Copy link
Member

jonasfj commented Apr 25, 2023

cat doc/api/index.html | grep pubsub

outputs the following that's from the README:

<h4 id="cloud-pubsub-api---pubsubv1">Cloud Pub/Sub API - <code>pubsub.v1</code></h4>
<li><a href="https://cloud.google.com/pubsub/docs">Documentation</a></li>
<li><a href="https://pub.dev/documentation/googleapis/11.0.0/pubsub.v1/pubsub.v1-library.html">API details</a></li>
<h4 id="pubsub-lite-api---pubsublitev1">Pub/Sub Lite API - <code>pubsublite.v1</code></h4>
<li><a href="https://cloud.google.com/pubsub/lite/docs">Documentation</a></li>
<li><a href="https://pub.dev/documentation/googleapis/11.0.0/pubsublite.v1/pubsublite.v1-library.html">API details</a></li>

I think the links the README are following the old format. Thus, they are using pubsub.v1, but the generated sidebar below is using a new URL scheme.

And the following generated sidebar:

  <span class="name"><a href="pubsub_v1/pubsub_v1-library.html">v1</a></span> 
  <span class="name"><a href="pubsublite_v1/pubsublite_v1-library.html">v1</a></span> 
      <li><a href="pubsub_v1/pubsub_v1-library.html">v1</a></li>
      <li><a href="pubsublite_v1/pubsublite_v1-library.html">v1</a></li>

Also the display names for libraries here is not unique. Now, many of the libraries are just called v1 in the sidebar 🙈

It's possible that this is intended. I think it would make some sense to simplify things. In that case we just need to file a bug against package:googleapis to change library names.

Changing library names is probably a bit breaking for googleapis, but it could keep the old libraries around and just have them re-export the new libraries and do some sort of // nodoc comment to avoid the old library showing up in dartdoc. That way one can maintain compatibility and rename libraries.


Reproduce using

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -z "$PUB_HOSTED_URL" ]; then
  PUB_HOSTED_URL='https://pub.dev'
fi

fetch_package_names() { 
  curl -Ls --compressed "$PUB_HOSTED_URL/api/package-names" | jq -r '.packages[]'
}

latest_version() {
  curl -Ls "$PUB_HOSTED_URL/api/packages/$1" | jq -r '.latest.version'
}

fetch_task_log() {
  curl --fail -Ls "$PUB_HOSTED_URL/experimental/task-log/$1/$2/"
}

P="$1"
V="$2"

if [ -z "$P" ]; then
  echo 'usage: ./reproduce-dartdoc-issue.sh <package> <version>'
  exit 1;
fi

if [ -z "$V" ]; then
  echo 'usage: ./reproduce-dartdoc-issue.sh <package> <version>'
  exit 1;
fi

cd $(mktemp -d)
echo $(mktemp -d)
curl -L "$PUB_HOSTED_URL/api/packages/$P/versions/$V/archive.tar.gz" | tar -xz
dart pub get
dart pub global activate dartdoc
dartdoc

ecbo 'Written to:'
echo $(mktemp -d)

Save file above as ./reproduce-dartdoc-issue.sh and run as ./reproduce-dartdoc-issue.sh googleapis 11.0.0

@jonasfj jonasfj added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Apr 25, 2023
@jcollins-g
Copy link
Contributor

There have been no recent changes to the URL pattern to my knowledge; is it possible that this has always been broken?

@jcollins-g
Copy link
Contributor

#1658 covers the more general issue of library names vs import URIs.

@jcollins-g jcollins-g added P3 A lower priority bug or feature request needs-info Additional information needed from the issue author and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Apr 25, 2023
@kevmoo
Copy link
Member

kevmoo commented Feb 14, 2024

This is fixed, now! Please reopen if I'm wrong here.

#3609

@kevmoo kevmoo closed this as completed Feb 14, 2024
@parlough
Copy link
Member

For more useful breadcrumbs, I think the PR that fixed this was #3552 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

4 participants