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

add a circleci integration: check unclosed tags #3786

Merged
merged 37 commits into from
Sep 3, 2020

Conversation

yikeke
Copy link
Contributor

@yikeke yikeke commented Sep 1, 2020

What is changed, added or deleted? (Required)

After we migrate to the new website implementation, unclosed HTML tags will cause a build failure. If we just rely on people to review and find all unclosed tags from possibly large changes, it is not realistic at all.

So I wrote a python script as a new circleci integration, which detects the unclosed tags from all changed files in a PR.

This script can:

  1. skip tags in frontmatter because they won't affect build
  2. scan all body texts to find all open tags

Note this script cannot yet skip scanning tags from code blocks wrapped by ~~~ ~~~, but our markdown documents use ``` ``` style of code blocks consistently so it should be okay.

Note: authors may find unexpectedly changed files in the CI check if their branches are outdated, merge master branch will help in such scenario. (from #1406)

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Have version specific changes
  • Might cause conflicts

@yikeke yikeke changed the title test python integration test python integration: check unclosed tags Sep 2, 2020
@yikeke yikeke changed the title test python integration: check unclosed tags add a circleci integration: check unclosed tags Sep 2, 2020
@yikeke yikeke changed the title add a circleci integration: check unclosed tags [WIP]add a circleci integration: check unclosed tags Sep 2, 2020
@yikeke yikeke marked this pull request as ready for review September 2, 2020 14:02
@yikeke yikeke changed the title [WIP]add a circleci integration: check unclosed tags add a circleci integration: check unclosed tags Sep 3, 2020
Copy link
Contributor

@YiniXu9506 YiniXu9506 left a comment

Choose a reason for hiding this comment

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

Good job! LGTM 👍

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 3, 2020
Copy link
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 3, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Sep 3, 2020
@yikeke yikeke merged commit ca959a2 into pingcap:master Sep 3, 2020
@lilin90 lilin90 added the type/enhancement The issue or PR belongs to an enhancement. label Sep 3, 2020
ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Sep 3, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-2.1 in PR #3806

ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Sep 3, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #3807

ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Sep 3, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.1 in PR #3808

ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Sep 3, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #3809

result_findall = re.findall(r'<([^\n`>]*)>', content)
if len(result_findall) == 0:
# print("The edited markdown file " + filename + " has no tags!\n")
status_code = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line has been modified since merged.

ti-srebot added a commit that referenced this pull request Sep 3, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2. status/PTAL This PR is ready for reviewing. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants