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

[CI:DOCS] Man pages: check for corrupt tables #19278

Merged

Conversation

edsantiago
Copy link
Member

Every so often we hear reports of a corrupt man page table,
where columns are misaligned in nonsensical ways. The
traditional symptom looks like:

|----------------|--------------|

option name
description
---------------- --------------

Cause: one of the tools in the man page generation chain,
maybe 'man' itself, has an undocumented length limit on
table cells, and an undocumented page width as well.
If you exceed these undocumented limits, you get corrupt
man pages. Silently.

This adds a horrible test for those. And I mean horrible:

  • unreadable
  • unmaintainable
  • unreliable (heuristic, no guarantees)
  • slows down 'make docs' (less than a second, but still)

I've tested by adding long '| sdf sdf | dsf |' rows to
a few man pages, and it triggers. That's the only good
thing I can say about it.

Other approaches I tried:

  • man -l -Tascii | grep non-ascii-art
  • man -l ... 2>&1 | grep "table wider than"
  • perusing the generated .1/.5 pages, seeing if my eye
    can detect something different about too-long cells
  • same, using 'tbl'
  • checking for too-long cells in the source document

...and more that I've forgotten. This was the only way
that produced reliable errors. If you have a better way,
please oh please submit it.

Signed-off-by: Ed Santiago [email protected]

None

Every so often we hear reports of a corrupt man page table,
where columns are misaligned in nonsensical ways. The
traditional symptom looks like:

   |----------------|--------------|
   | option name    |              |
   |----------------|--------------|
   |                | description  |
   |----------------|--------------|

Cause: one of the tools in the man page generation chain,
maybe 'man' itself, has an undocumented length limit on
table cells, _and_ an undocumented page width as well.
If you exceed these undocumented limits, you get corrupt
man pages. Silently.

This adds a horrible test for those. And I mean horrible:

  - unreadable
  - unmaintainable
  - unreliable (heuristic, no guarantees)
  - slows down 'make docs' (less than a second, but still)

I've tested by adding long '| sdf sdf | dsf |' rows to
a few man pages, and it triggers. That's the only good
thing I can say about it.

Other approaches I tried:
  - man -l -Tascii | grep non-ascii-art
  - man -l ... 2>&1 | grep "table wider than"
  - perusing the generated .1/.5 pages, seeing if my eye
    can detect something different about too-long cells
  - same, using 'tbl'
  - checking for too-long cells in the source document

...and more that I've forgotten. This was the only way
that produced reliable errors. If you have a better way,
please oh please submit it.

Signed-off-by: Ed Santiago <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2023
@edsantiago
Copy link
Member Author

...and this is what the failure looks like with a deliberate fault inserted: https://cirrus-ci.com/task/6541249260290048?logs=main#L335

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I still think most problems can be avoided if we use a markdown formatter in CI and enforce that files are formatted properly.

@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2023

Lets merge this and then add the markdown validator in separate PR.

@rhatdan
Copy link
Member

rhatdan commented Jul 20, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2023
@openshift-merge-robot openshift-merge-robot merged commit 4315611 into containers:main Jul 20, 2023
@edsantiago edsantiago deleted the manpage_table_check branch July 20, 2023 16:49
edsantiago added a commit to edsantiago/libpod that referenced this pull request Jul 24, 2023
The new man-page table check (containers#19278) fails on RHEL8 because
go-md2man is 2.00 and we require 2.02.

After much deliberation.... just ignore the problem. Add a
bold note to that part of the Makefile, and hope that when
the test fails on the next RHEL branching someone will look
at the Makefile, find the comment, and disable that test.

Got any better ideas?

Signed-off-by: Ed Santiago <[email protected]>
edsantiago added a commit to edsantiago/libpod that referenced this pull request Jul 26, 2023
go-md2man is fragile, especially around tables (containers#18678, containers#19278).
Podman man pages are finely tuned to look OK using v2.02, which
is what we vendor in test/tools, so we should really use it
instead of whatever is installed on the system.

This fixes 'make docs' on RHEL8, broken as of containers#19278.

Signed-off-by: Ed Santiago <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Oct 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants