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

Broken link in tmt documentation #2868

Open
falconizmi opened this issue Apr 17, 2024 · 3 comments
Open

Broken link in tmt documentation #2868

falconizmi opened this issue Apr 17, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@falconizmi
Copy link
Collaborator

I found out that the links meant to link to FMF files do not link correctly. Instead of linking to the FMF file, they link to a folder.
E.g. here in try documentation the link /tests/try

@lukaszachy lukaszachy added the documentation Improvements or additions to documentation label Apr 19, 2024
@qiankehan
Copy link

I ran a script to get the broken link for the docs:

for j in $(for i in $(find -name '*html' );do curl localhost:8000/$i |xmllint --xpath '//a' --html -;done 2>/dev/null|grep '\"https://[^\"]*\"' -o|sed 's/\"//g'|sort|uniq);
    do curl -sI $j|head -1|grep -q 404;
    if [ $? -eq 0 ];
        then echo $j ;
    fi ;
done

Results:

https://docs.testing-farm.io/general/0.1/test-request.html
https://docs.testing-farm.io/general/0.1/test-results.html#_tmt_reproducer
https://github.com/teemtee/tmt/tree/main/plans/provision/beaker.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute/reboot.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute/restart.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute/restraint/report_result.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute/result.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute/results-custom.fmf
https://github.com/teemtee/tmt/tree/main/tests/execute/upgrade.fmf
https://github.com/teemtee/tmt/tree/main/tests/login.fmf
https://github.com/teemtee/tmt/tree/main/tests/multihost.fmf
https://github.com/teemtee/tmt/tree/main/tests/plan/import.fmf
https://github.com/teemtee/tmt/tree/main/tests/plan/lint.fmf
https://github.com/teemtee/tmt/tree/main/tests/plans/select.fmf
https://github.com/teemtee/tmt/tree/main/tests/test_convert.fmf
https://github.com/teemtee/tmt/tree/main/tests/try.fmf
https://github.com/teemtee/tmt/tree/main/tests/unit.fmf
https://github.com/teemtee/tmt/tree/main/tmt/id.py
https://github.com/teemtee/tmt/tree/main/tmt/step
https://github.com/teemtee/tmt/tree/main//tmt/steps/provision/localhost.py
https://github.com/teemtee/tmt/tree/main//tmt/steps/provision/vagrant.py
https://tmt.readthedocs.io/en/stable/classes.html#class-conversions

I'd like to fix them

@happz
Copy link
Collaborator

happz commented May 14, 2024

@qiankehan FYI, there's a PR to add linkcheck Sphinx engine, #2489. It should reveal very similar issues.

Invalid links to tests like the /tests/try.fmf are most likely caused by the template, I'd say it needs to get smarter, because sometimes it is true the verified-by points to an fmf file, and sometimes it does not... See https://github.com/teemtee/tmt/blob/main/docs/templates/story.rst.j2#L203 and https://github.com/teemtee/tmt/blob/main/docs/templates/story.rst.j2#L94.

Maybe we should move the logic mapping links to actual URLs into the Python code in https://github.com/teemtee/tmt/blob/main/docs/scripts/generate-stories.py, as a function, and inject it into the template environment. The function we could then test - I'd worry that by fixing one case we may easily break something else, and unit tests would be very helpful.

happz added a commit that referenced this issue May 17, 2024
Related to #2489. This PR does not
fix all invalid links, but the rest should be caused by incorrect
handling of links in template when rendering them; these should be
resolved by the work related to
#2868.
happz added a commit that referenced this issue May 21, 2024
Related to #2489. This PR does not
fix all invalid links, but the rest should be caused by incorrect
handling of links in template when rendering them; these should be
resolved by the work related to
#2868.
happz added a commit that referenced this issue May 28, 2024
Related to #2489. This PR does not
fix all invalid links, but the rest should be caused by incorrect
handling of links in template when rendering them; these should be
resolved by the work related to
#2868.
happz added a commit that referenced this issue May 28, 2024
Related to #2489. This PR does not
fix all invalid links, but the rest should be caused by incorrect
handling of links in template when rendering them; these should be
resolved by the work related to
#2868.
happz added a commit that referenced this issue May 28, 2024
Related to #2489. This PR does not
fix all invalid links, but the rest should be caused by incorrect
handling of links in a template when rendering them; these should be
resolved by the work related to
#2868.

Co-authored-by: Miroslav Vadkerti <[email protected]>
happz added a commit that referenced this issue Jun 2, 2024
Related to #2489. This PR does not
fix all invalid links, but the rest should be caused by incorrect
handling of links in a template when rendering them; these should be
resolved by the work related to
#2868.

Co-authored-by: Miroslav Vadkerti <[email protected]>
@happz
Copy link
Collaborator

happz commented Jun 10, 2024

I believe #3001 resolves all remaining broken links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants