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

feat(script): Verify the existence of checker config doc_url pages and find appropriate older releases for gone (removed, dealpha, etc.) checkers #4207

Commits on Apr 30, 2024

  1. feat(script): Verify and rollback doc_url for gone checkers (e.g., …

    …dealpha)
    
    The checker label configuration at `/config/labels/analyzers` most often
    contains a `doc_url` entry which points to the documentation URL of the
    checker, as shown in the UI.
    When the user clicks this, the browser redirects them to this page,
    however, these external links are very susceptible to link rot,
    especially when analysers entirely decomission checkers (e.g.,
    `clang-tidy/cert-dcl21-cpp`) or checkers change name during a
    dealphafication (e.g., `alpha.cplusplus.EnumCastOutOfRange` ->
    `optin.core.EnumCastOutOfRange`).
    In these cases, older analysis results stored with the older (or still
    extant) check will have a `doc_url` that points to nowhere in the
    upstream.
    In addition, there were several identified cases where the links were
    recognised as broken (both by this tool and by an actual browser) but
    the checker was still extant, simply because of a typo:
    `cplusplus.PlacementNew`, `#wdeprecated-deprecated-coroutine` (instead
    of `#wdeprecated-coroutine`), `#wclang-diagnostic-unsafe-buffer-usage`
    (instead of `#wunsafe-buffer-usage`).
    
    This patch adds an opt-in, developer-only tool under `/scripts/labels`,
    which automatically checks (by the way of HTTP requests and HTML DOM
    scraping) whether the existing URLs still point to alive links, and
    reports this status.
    If there is analyser-specific additional knowledge (e.g., ClangSA and
    Clang-Tidy is implemented as such as of now), it uses additional
    heuristics (most of which is available through reusable library
    components for future development!) to figure out a fixed version of the
    `doc_url` by normalising `#anchors` to fix typos, and looking up earlier
    releases in which the checked under verification was still extant.
    whisperity committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    992eeef View commit details
    Browse the repository at this point in the history