opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

BUG FIX #538 #760

Closed Krish-2505 closed 3 months ago

Krish-2505 commented 3 months ago

Description

BUG FIX #538 , made modifications to the links.yml workflow file to address the issue with relative links in the README.md.

Here's a summary of the changes:

Added a new step before the link checking process. This step removes the symbolic link (soft link) of README.md in the docs/source directory. This prevents the link checker from incorrectly resolving relative links due to the presence of this soft copy.

In the arguments section of the lychee Link Checker, I've added an exclusion for the file reference to the docs/source/README.md. This exclusion is necessary because even though we've removed the soft link, other parts of the project or external references might still point to this location. By excluding it from the link check, we ensure that the checker doesn't attempt to validate any links that might reference this now-nonexistent soft link. This prevents potential false positives or errors that could arise from references to the removed soft link.

After the link checking is complete, I've added another step to recreate the soft link. This ensures that the repository structure remains intact and doesn't affect other workflows that might depend on the presence of this soft link.

Issues Resolved

Link checker will not fail for adding relative links in readme.md

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

dblock commented 3 months ago

I think we both misunderstood how Lychee works. The .lycheeignore file is for files and URLs found and checked, it's not to exclude files from being checked. So first it reads docs/source/README.md, then it checks URLs in that file and fails because they are incorrect. To exclude a file or a path, you have to use --exclude-path. Here's the fix: https://github.com/Krish-2505/opensearch-py/pull/4.

However this creates a new problem. We deploy these docs to https://opensearch-project.github.io/opensearch-py/ and the links would then be broken on that site. So we would need to symlink the rest of markdown files. I tried that and ran into more problems trying to generate docs with nox -rs docs.

I propose we just get rid of the symlink and remove README.md from docs/source/index.md, then add the relevant content from README.md to it. Then we don't need all the special options for the link checker. Want to do that instead?

Krish-2505 commented 3 months ago

ok, then I will remove readme from docs/source. Afterwards, if you could suggest what types of relevant content to add to docs/source, I'll implement those additions.

dblock commented 3 months ago

The deploy docs job failed above, see https://github.com/opensearch-project/opensearch-py/actions/runs/9545324707/job/26305843780?pr=760. There's a link to this README that needs to be removed.

Afterwards, if you could suggest what types of relevant content to add to docs/source, I'll implement those additions.

You should do this as part of this PR. There was a lot of stuff in the README, pick a minimal set of things that you think will be useful.