|
| 1 | +--- |
| 2 | +description: How to fix PR errors |
| 3 | +--- |
| 4 | + |
| 5 | +# Fix CI/CD errors |
| 6 | + |
| 7 | +Documentation sites that use the [old system](../overview/index.md#old-documentation-system) use |
| 8 | +[CircleCI](https://circleci.com/) to verify links, Markdown syntax, writing style, and more on all documentation changes. |
| 9 | +This section describes the four CI error types and how to fix them: |
| 10 | + |
| 11 | +- [`build` errors](#build-errors) |
| 12 | +- [`linkchecker` errors](#linkchecker-errors) |
| 13 | +- [`markdownlint` errors](#markdownlint-errors) |
| 14 | +- [`vale` errors](#vale-errors) |
| 15 | + |
| 16 | +Submitting or updating a PR automatically runs all CI checks, displaying a checklist at the bottom of the PR page. |
| 17 | + |
| 18 | +Manually re-running a failed job on CircleCI requires a ConsenSys account. |
| 19 | +Anyone can run the CI checks on their local machine using the [local tests helper scripts](https://github.com/Consensys/doc.common/tree/master/build_tools/scripts). |
| 20 | + |
| 21 | +!!! important |
| 22 | + |
| 23 | + The [new documentation system](../overview/index.md#new-documentation-system) doesn't use |
| 24 | + CircleCI, but runs [Markdown](#markdownlint-errors) and [link](#linkchecker-errors) tests that you can view and fix |
| 25 | + in a similar way. |
| 26 | + |
| 27 | +## `build` errors |
| 28 | + |
| 29 | +The `build` job builds the documentation using MkDocs in `strict` mode, failing on both errors and warnings. |
| 30 | +Select the `build` **Details**, which takes you to the CircleCI site. |
| 31 | +Check the error message under **Run MkDocs** and make any required fixes. |
| 32 | + |
| 33 | +The best way to reproduce the error is by running `mkdocs build -s` locally in a [virtual environment](../preview/old-system.md). |
| 34 | + |
| 35 | +## `linkchecker` errors |
| 36 | + |
| 37 | +The `linkchecker` job verifies links. |
| 38 | +Select the `linkchecker` **Details**, which takes you to the CircleCI site. |
| 39 | +The error message under **Run markdown link checker** displays all the broken links and their HTTP error codes. |
| 40 | + |
| 41 | +HTTP error codes include: |
| 42 | + |
| 43 | +- `404` - The page doesn't exist anymore. |
| 44 | + Update the link. |
| 45 | +- `4xx` - Refer to the [full list of HTTP codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). |
| 46 | +- `5xx` - The web server is experiencing issues. |
| 47 | + You may re-run the job later. |
| 48 | + |
| 49 | +!!! example |
| 50 | + |
| 51 | + ```bash |
| 52 | + FILE: ./docs/index.md |
| 53 | + [✓] Concepts/Overview.md → Status: 200 |
| 54 | + [✖] https://consensys.net/quorum/developers → Status: 503 |
| 55 | + [✖] https://consensys.net/quorum/contact-us → Status: 503 |
| 56 | + |
| 57 | + 3 links checked. |
| 58 | + |
| 59 | + ERROR: 2 dead links found! |
| 60 | + [✖] https://consensys.net/quorum/developers → Status: 503 |
| 61 | + [✖] https://consensys.net/quorum/contact-us → Status: 503 |
| 62 | + ``` |
| 63 | + |
| 64 | + These errors mean the two links in `./docs/index.md` to the `consensys.net` site don't work because the server has issues. |
| 65 | + The `503` code means `Service Unavailable`. |
| 66 | + |
| 67 | +## `markdownlint` errors |
| 68 | + |
| 69 | +The `markdownlint` job verifies Markdown syntax. |
| 70 | +Select the `markdownlint` **Details**, which takes you to the CircleCI site. |
| 71 | + |
| 72 | +The error message under **Run Markdownlint** displays Markdown errors that you must fix. |
| 73 | +These errors are also displayed in the `markdownlint.out` artifact. |
| 74 | + |
| 75 | +The log under **Run Markdownlint info checks** displays warnings that you should be aware of but don't prevent the tests |
| 76 | +from passing. |
| 77 | +These warnings are also displayed in the `markdownlint_info.out` artifact. |
| 78 | + |
| 79 | +!!! example |
| 80 | + |
| 81 | + ```bash |
| 82 | + `docs/Reference/Responsible-Disclosure.md:18:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]` |
| 83 | + ``` |
| 84 | + |
| 85 | + This indicates that you have an error in the file `docs/Reference/Responsible-Disclosure.md` at line 18, character 1. |
| 86 | + The error code is [`MD007`](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md007---unordered-list-indentation) |
| 87 | + and the description message is `Unordered list indentation [Expected: 2; Actual: 4]` indicating that there are four |
| 88 | + spaces used to indent the line instead of the expected two. |
| 89 | + Fix by removing the two spaces. |
| 90 | + |
| 91 | +Frequent Markdown errors in the ConsenSys documentation include: |
| 92 | + |
| 93 | +- Not trimming end-of-line spaces. |
| 94 | + You can configure your editor to automatically fix this. |
| 95 | +- Not adding blank lines around lists, code blocks, or titles. |
| 96 | +- Using the wrong title level (for example, starting a page with `##` instead of `#`, or jumping from `#` to `###`). |
| 97 | +- Not defining the language on code blocks. |
| 98 | +- Manually incrementing ordered list elements. |
| 99 | + All ordered lists elements must start with `1.`; the numbers increment automatically in the rendered Markdown. |
| 100 | +- Using inconsistent unordered list markers. |
| 101 | + You can use `*` or `-` to start unordered list elements, but they must be the same everywhere on a page. |
| 102 | +- Using HTML when Markdown can do the job. |
| 103 | + Don't use HTML unless it's a matter of life and death! |
| 104 | + |
| 105 | +View the [full list of `markdownlint` errors and fixes](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md). |
| 106 | + |
| 107 | +## `vale` errors |
| 108 | + |
| 109 | +The `vale` job verifies the documentation against basic writing guidelines configured in the |
| 110 | +[common submodule `vale` directory](https://github.com/ConsenSys/doc.common/tree/master/build_tools/vale). |
| 111 | + |
| 112 | +Select the `vale` **Details**, which takes you to the CircleCI site. |
| 113 | +The error message under **Run Vale** displays writing errors that you must fix, and warnings that you should be aware of |
| 114 | +but don't prevent the tests from passing. |
| 115 | + |
| 116 | +!!! example |
| 117 | + |
| 118 | + ```bash |
| 119 | + docs/Reference/CLI/CLI-Syntax.md |
| 120 | + 1349:34 error Did you really mean Vale.Spelling |
| 121 | + 'attestions'? |
| 122 | + 1436:19 warning 'is used' may be passive write-good.Passive |
| 123 | + voice. Use active voice if you |
| 124 | + can. |
| 125 | + |
| 126 | + ✖ 1 error, 1 warnings and 0 suggestions in 1 file. |
| 127 | + |
| 128 | + Exited with code exit status 1 |
| 129 | + CircleCI received exit code 1 |
| 130 | + ``` |
| 131 | + |
| 132 | + This indicates that you have one error and one warning in the file `docs/Reference/CLI/CLI-Syntax.md`. |
| 133 | + |
| 134 | + The error is a typo on the word `attestions` that should be `attestations`. |
| 135 | + The warning reminds you to use [active voice](https://docs.microsoft.com/en-us/style-guide/grammar/verbs#active-and-passive-voice) |
| 136 | + where possible. |
| 137 | + |
| 138 | +If you're introducing a new product term not recognized by Vale: |
| 139 | + |
| 140 | +1. [Make a documentation contribution](index.md) to the [`doc.common`](https://github.com/ConsenSys/doc.common) |
| 141 | + repository, adding the term to the Vale [`accept.txt`](https://github.com/ConsenSys/doc.common/blob/master/build_tools/vale/vale_styles/Vocab/Consensys/accept.txt) |
| 142 | + file. |
| 143 | +1. In the documentation repository in which you're making the original contribution, |
| 144 | + [update the submodule to the latest version](use-common-submodule.md#update-repositories-to-the-latest-submodule-version). |
0 commit comments