-
Notifications
You must be signed in to change notification settings - Fork 8.1k
fix broken urls in swagger files for engine api #14795
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
Conversation
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
✅ Deploy Preview for docsdocker ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Do you know what caused this? Because the original file has a full URL; is one of the replace scripts replacing too much? https://github.com/moby/moby/blob/master/docs/api/v1.41.yaml#L27 |
|
Removing the exclusion from htmlproofer leads to only one failure: I think we could just exclude |
| Dir.glob("./engine/api/*.yaml") do |file_name| | ||
| Jekyll.logger.info " #{file_name}" | ||
| text = File.read(file_name) | ||
| replace = text.gsub!("https://docs.docker.com/", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, replace should not strip the /
Are there other places where we do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was checking other pages too with hardcoded docs.docker.com which leads to unexpected behavior for review because it doesn't check the actual domain with htmlproofer. I have another branch that will fix that and remove hardcoded root url as you suggested in #14784 (comment)
Yes in #14688, when moved to a Jekyll plugin, I forgot to add the leading slash like it was before: https://github.com/docker/docker.github.io/pull/14688/files#diff-4aad9ddf294771293cfaa8016eb98c5a91c56e3f7e45c608df4be2d519a68d2eL38 |
thaJeztah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
|
Just checked the preview on my desktop (looks like mobile view doesn't include an icon), and icon looks good now 👍 |
URLs of some images are broken for the engine api because of a missing leading slash: https://docs.docker.com/engine/api/v1.41/
I took the opportunity with this change to also move the logic in a dedicated plugin that will run in
post_read(e.g., will be done afterpre_readlike the fetch remote resources plugin) and also added./docker-hub/api/*.yamlpattern which was not covered previously.We didn't catch that because htmlproofer ignores this folder: https://github.com/docker/docker.github.io/blob/8d6bd6bdb5c1b7b23d196e62760b93b89a588661/Dockerfile#L77
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com