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

Providers should have a lint workflow/step on the docs folder content #1100

Open
ringods opened this issue Oct 11, 2024 · 2 comments
Open

Providers should have a lint workflow/step on the docs folder content #1100

ringods opened this issue Oct 11, 2024 · 2 comments
Assignees
Labels
kind/engineering Work that is not visible to an external user p1 A bug severe enough to be the next item assigned to an engineer

Comments

@ringods
Copy link
Member

ringods commented Oct 11, 2024

When a resource provider package contains a docs folder, the content should be linted. This workflow/step should pass before a release can happen.

When the content is not correct, these files are copied over to the registry for publishing and it fails the publishing there without any feedback loop back to the source.

Example: MongoDB Atlas is currently at v3.20.1. All versions from v3.18.1 failed publishing so far:

@ringods ringods added the needs-triage Needs attention from the triage team label Oct 11, 2024
@ringods
Copy link
Member Author

ringods commented Oct 11, 2024

@iwahbe iwahbe added the p1 A bug severe enough to be the next item assigned to an engineer label Oct 11, 2024
@guineveresaenger
Copy link
Contributor

guineveresaenger commented Oct 11, 2024

Thank you for alerting us here, @ringods.

I've gone over open registry PRs and this is currently affecting only the three providers you listed.

The configured markdownlint options can be found in the registry here.

Summary of linting rules failing:

  1. Multiple top-level headings in the same document MD025
  1. Ordered list item prefix MD029
  1. Spaces inside code span elements MD038 - it looks like this: this span has a leading space. It presents on the level of a typo but as the rule documentation says, backtick renders get complicated quickly.

It seems to me at first glance that these particular linting rules are currently too strict for the _index.md file, for two reasons:

There's a few options:

  1. Fix up linting errors in affected providers. Ideally, as this issue suggests, this would be discovered at pull request time via provider-specific linting step. The drawback is that the main way to fix something like this is via docEditRules which are manual, and a large hammer. Maintenance becomes difficult as well, as these rules depend on detecting incoming text. When that text changes, the rule must be adjusted, or it will quietly cease to do anything. It is possible to add a hard error to assist in detecting upstream changes; this adds potential future maintenance burden.
  2. Exclude _index.md files from linting rules in the registry entirely. The drawback here is that we might not catch new and exciting render failures before they go live.
    It is also unclear to me at this point whether we enforce linting on third-party providers. Since maintainers of those providers probably will have an easier time noticing a registry publish failure, we may want to keep the linting rules, or perhaps downgrade them to a warning.
  3. Loosen the above three linting rules in the registry. This would apply to a large amount of internal makdown files however.
  4. Loosen the above linting rules for only _index.md files. We'd keep strict linting on all other files, and can decide that we're OK with the above issues.

I'm leaning towards a mix of 4 and 1:

  • Adjust the above three rules to be unenforced on _index.md files in the registry -> result: publish succeeds even if there's minor lint errors
  • Add these adjusted rules to a provider level lint step. When they fail, we either need to fix the file, or decide if we need to adjust the rules further.
Screenshot of local render

Image

@guineveresaenger guineveresaenger self-assigned this Oct 14, 2024
@guineveresaenger guineveresaenger removed the needs-triage Needs attention from the triage team label Oct 14, 2024
@mikhailshilkov mikhailshilkov added the kind/engineering Work that is not visible to an external user label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/engineering Work that is not visible to an external user p1 A bug severe enough to be the next item assigned to an engineer
Projects
None yet
Development

No branches or pull requests

4 participants