Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
Early-Warning-System: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
=Early Warning System= | = Early Warning System = | ||
Once a new review is created or an old review has been updated, the Early Warning System kicks in, by watching for new patch reviews to process. | Once a new review is created or an old review has been updated, the Early Warning System kicks in, by watching for new patch reviews to process. | ||
Line 5: | Line 5: | ||
This system is basically a collection of bots that will run a wide array of tests on the patch. The crucial part about these tests is that they should all be quick to run, 5-10 minutes or perhaps even less. The idea is not to catch all errors, but to get immediate/early feedback on a patch. | This system is basically a collection of bots that will run a wide array of tests on the patch. The crucial part about these tests is that they should all be quick to run, 5-10 minutes or perhaps even less. The idea is not to catch all errors, but to get immediate/early feedback on a patch. | ||
If you get a | If you get a <s>1 from a review bot, please ensure you look at the issues noted by the bot, and upload a new version. The review bots will then automatically review the update and give you feedback. | ||
<br />h2. The Simple Sanitizer | |||
<br /># '''The line ending check.''' We are developing in a heterogeneous environment with both Unix and Windows machines. Therefore it is imperative to have all files in the repository in the canonical LF-only format. Windows users need to set the git option <code&gt;core.autocrlf&lt;/code&gt; to <code&gt;true&lt;/code&gt; to automatically get CRLF line endings which are suitable for the native tools.<br /># '''Conflict marker check.''' Unless you are adding a text file which contains the patterns on purpose, you most probably botched a merge/rebase.<br /># '''Generated file check.''' Don't commit generated files</s> they bloat the repository and create spurious changes. If a file is generated but you don't know how to automate the build process, ask an expert.<br /># '''Backup file check.''' Don't commit backup files, for hopefully obvious reasons.<br /># '''Copyright header check.''' Source files must declare copyright (unless they are very small). They should also name a licence, but the check does not cover that.<br /># '''Check for project/config files of alien build systems.''' As we are using qmake, these will in most cases fall under the "generated file&quot; rule anyway.<br /># '''Big file addition check.''' Think three times whether you ''really'' need that huge media file, test binary or screenshot. As we are using git, such mistakes are not correctable - once you added a huge file, everyone who clones the repository will have to pay for it with network traffic and disk space for all times. Source code files are exempt from the check at all; for the rest it is a bit paranoid (it will complain about anything bigger than 50 KiB or an instantaneous file growth over 150% if the file is bigger than 20 KiB).<br /># '''Huge file addition check.''' If you trigger that one, you almost certainly did something wrong.<br /># '''Work In Progress push check.''' This is meant to avoid that somebody accidentally submits something you marked for later cleanup. It checks for the strings "WIP&quot; and "''''''*" in the summary line and for an empty Reviewed-by line. This check is disabled in the local post-commit hook for obvious reasons.<br /># '''Some simple checks on the commit message:'''<br />## Compliance with "the expected structure&quot;:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html.<br />## That reverts are properly explained, which follows directly from the [[Commit Policy]] point 8.2.<br />## That the author email address does not reflect an unconfigured git setup.<br />## That the author real name looks reasonable. Use proper capitalization and periods after initials.<br />### Exceptions can be requested, but must be reasonably justified.<br />## That the summary does not refer to JIRA issues. Use Task-number footers for that. If the reader needs to know which issue a commit refers to, they most definitely should read more than just the commit summary anyway.<br />## That no Reviewed-by footers have been manually added, as they would stay behind even if the mentioned person did not actually make a review.<br />## That no Signed-off-by footers have been added, as they are redundant with the act of signing the "CLA&quot;:http://qt.io/legal.html (advisory only).<br />## That there are no empty lines between footers. The footers (including any "(cherry picked from …)" lines) should form one tidy set-off block. If you are getting an empty line before the automatically added Change-Id line, you are most probably using a bad commit-msg hook - get a fresh copy from our Gerrit, or use the one from our "qtrepotools repository&quot;:http://qt.gitorious.org/qt/qtrepotools/blobs/master/git-hooks/gerrit_commit_msg_hook. If you are using the "Qt supermodule&quot;:https://qt.gitorious.org/qt/qt5/, you can run <code&gt;init-repository <s>f —force-hooks&lt;/code&gt; to update your hooks.<br />## That "JIRA issues&quot;:https://bugreports.qt.io/ are not referenced by URL. URLs make the commit messages noisy and unnecessarily bind them to the current location of the bug tracker. Use the Task-number footer according to the "commit template&quot;:http://qt.gitorious.org/qt/qt5/blobs/stable/.commit-template to make "Gerrit&quot;:https://codereview.qt.io/ automatically link issues.<br />## That other commits are not referenced by Gerrit Change-Id or URL. Change-Ids have the disadvantage of introducing an unnecessary indirection when browsing history. URLs are also noisy, non-relocatable, and make off-line lookup impossible. Use the SHA1 of the commit that has been actually merged (the automatically added new PatchSet seen in Gerrit Changes).<br />## That [ChangeLog] is correctly formed if present:<br />### That the tag is camel-cased, and does not try to be a footer.<br />### That the paragraph is preceeded and followed by an empty line.<br />### That tags don't mention JIRA issues. Use Task-number footers for that.<br />### That tags don't mention the current repository, as that's redundant.<br />### That the last tag is followed by a space (or line break), for tidyness.<br /># '''Some simple checks for incorrect use of Apple brands/trademarks/terminology:'''<br />## That the author is aware that the define Q_OS_MAC and qmake scope mac refer to both the OS X and iOS operating systems, since it is commonly mistaken to refer only to OS X.<br />## That the OS X operating system is correctly named in all instances. OS X is the name of Apple's Darwin-based flagship Desktop operating system and is a trademark; while the 'X' is pronounced as 'ten' and did and does refer to the major version number of the operating system, this is always ignored when writing out the full product name, for example "OS X 10.9 Mavericks&quot;, never "OS 10.9 Mavericks&quot;. The operating system was formerly named "Mac OS X&quot; but was changed to "OS X&quot; in 2012 with the release of Mountain Lion. Many Apple marketing materials "backported&quot; this name change to Lion as well. Whether a bump to major version 11 would have any impact on this cannot be determined until that happens, if it ever does. Terms such as "Mac&quot;, "Macintosh&quot;, "Mac OS&quot;, "Mac OS X&quot;, "OSX&quot;, etc., with any combination of spacing and punctuation, should '''not''' be used to refer to the operating system. Note that the hardware platform on which OS X runs is correctly termed "Mac&quot; or "Macintosh&quot;. To re-emphasize, '''ONLY''' use "OS X&quot; to refer to the software, and '''ONLY''' use "Mac&quot; or "Macintosh&quot; to refer to the hardware.<br />## That the deprecated define <code&gt;Q_OS_MACX&lt;/code&gt; and qmake scope <code&gt;macx&lt;/code&gt; (or similar deprecated constructs such as <code&gt;defined(Q_OS_MAC) && !defined(Q_OS_IOS)</code&gt; and <code&gt;mac:!ios&lt;/code&gt;) are not being used. Their respective replacements, <code&gt;Q_OS_OSX&lt;/code&gt; and <code&gt;osx&lt;/code&gt; should be used instead. Note that some uses of <code&gt;macx&lt;/code&gt; in a qmake file may still be valid, for example <code&gt;macx</s></code&gt; or <code&gt;macx*</code&gt; in reference to certain mkspecs (which cannot be renamed for backwards compatibility reasons).<br /># '''A check about touching certain files.''' Some files are considered "endangered&quot; - seemingly innocuous modifications almost always turn out to be bogus when not done by one of a few experts.<br /># '''A check for common spelling mistakes.'''<br /># '''Check for mixing whitespace and non-whitespace changes.''' As implied by the "don't mix unrelated changes&quot; [[Commit_Policy|rule]], a commit may contain only whitespace changes or "proper&quot; changes (with whitespace cleanups only on already changed lines, and, as an exception, additions and removals of empty lines). This helps to ensure the usefulness of <code&gt;git blame&lt;/code&gt; (note that a clean history is better than using <code&gt;git blame -w&lt;/code&gt;, as the latter will also hide significant whitespace changes). A negative verdict may be overridden if it is a false positive resulting from imperfect heuristics, in particular if the change is fixing coding style issues beyond mere whitespace cleanup.<br /># '''Various whitespace abuse checks.''' Tabs in files they are not approved in, trailing whitespace, missing newline at end of file, etc.<br /># '''Some simple [[Coding Style]] checks.''' (currently advisory only) | |||
The bot's verdict is a recommendation, and may be overridden by every Approver. However, don't ignore it unless you have a ''really'' good reason. "I need to get this done '''now'''" is not a valid reason. Neither is "I cannot be bothered to understand what it wants from me&quot;. If there is any doubt, discuss alternatives with somebody appropriate. Each override needs to come with a comment on Gerrit. | |||
It is possible to run most of the checks locally before attempting to push. See the <code&gt;qtrepotools/git-hooks/git_post_commit_hook&lt;/code&gt; script (it contains installation instructions). | |||
The sanitizer script is available from the "qtrepotools repository&quot;:https://qt.gitorious.org/qt/qtrepotools. | |||
The sanitizer script is available from the | |||
Revision as of 12:47, 23 February 2015
Early Warning System
Once a new review is created or an old review has been updated, the Early Warning System kicks in, by watching for new patch reviews to process.
This system is basically a collection of bots that will run a wide array of tests on the patch. The crucial part about these tests is that they should all be quick to run, 5-10 minutes or perhaps even less. The idea is not to catch all errors, but to get immediate/early feedback on a patch.
If you get a 1 from a review bot, please ensure you look at the issues noted by the bot, and upload a new version. The review bots will then automatically review the update and give you feedback.
they bloat the repository and create spurious changes. If a file is generated but you don't know how to automate the build process, ask an expert.
h2. The Simple Sanitizer
# The line ending check.' We are developing in a heterogeneous environment with both Unix and Windows machines. Therefore it is imperative to have all files in the repository in the canonical LF-only format. Windows users need to set the git option <code>core.autocrlf</code> to <code>true</code> to automatically get CRLF line endings which are suitable for the native tools.
# Conflict marker check. Unless you are adding a text file which contains the patterns on purpose, you most probably botched a merge/rebase.
# Generated file check. Don't commit generated files
# Backup file check. Don't commit backup files, for hopefully obvious reasons.
# Copyright header check. Source files must declare copyright (unless they are very small). They should also name a licence, but the check does not cover that.
# Check for project/config files of alien build systems. As we are using qmake, these will in most cases fall under the "generated file" rule anyway.
# Big file addition check. Think three times whether you really need that huge media file, test binary or screenshot. As we are using git, such mistakes are not correctable - once you added a huge file, everyone who clones the repository will have to pay for it with network traffic and disk space for all times. Source code files are exempt from the check at all; for the rest it is a bit paranoid (it will complain about anything bigger than 50 KiB or an instantaneous file growth over 150% if the file is bigger than 20 KiB).
# Huge file addition check. If you trigger that one, you almost certainly did something wrong.
# Work In Progress push check. This is meant to avoid that somebody accidentally submits something you marked for later cleanup. It checks for the strings "WIP" and "'*" in the summary line and for an empty Reviewed-by line. This check is disabled in the local post-commit hook for obvious reasons.
# Some simple checks on the commit message:
## Compliance with "the expected structure":http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html.
## That reverts are properly explained, which follows directly from the Commit Policy point 8.2.
## That the author email address does not reflect an unconfigured git setup.
## That the author real name looks reasonable. Use proper capitalization and periods after initials.
### Exceptions can be requested, but must be reasonably justified.
## That the summary does not refer to JIRA issues. Use Task-number footers for that. If the reader needs to know which issue a commit refers to, they most definitely should read more than just the commit summary anyway.
## That no Reviewed-by footers have been manually added, as they would stay behind even if the mentioned person did not actually make a review.
## That no Signed-off-by footers have been added, as they are redundant with the act of signing the "CLA":http://qt.io/legal.html (advisory only).
## That there are no empty lines between footers. The footers (including any "(cherry picked from …)" lines) should form one tidy set-off block. If you are getting an empty line before the automatically added Change-Id line, you are most probably using a bad commit-msg hook - get a fresh copy from our Gerrit, or use the one from our "qtrepotools repository":http://qt.gitorious.org/qt/qtrepotools/blobs/master/git-hooks/gerrit_commit_msg_hook. If you are using the "Qt supermodule":https://qt.gitorious.org/qt/qt5/, you can run <code>init-repository f —force-hooks</code> to update your hooks.</code> or <code>macx*</code> in reference to certain mkspecs (which cannot be renamed for backwards compatibility reasons).
## That "JIRA issues":https://bugreports.qt.io/ are not referenced by URL. URLs make the commit messages noisy and unnecessarily bind them to the current location of the bug tracker. Use the Task-number footer according to the "commit template":http://qt.gitorious.org/qt/qt5/blobs/stable/.commit-template to make "Gerrit":https://codereview.qt.io/ automatically link issues.
## That other commits are not referenced by Gerrit Change-Id or URL. Change-Ids have the disadvantage of introducing an unnecessary indirection when browsing history. URLs are also noisy, non-relocatable, and make off-line lookup impossible. Use the SHA1 of the commit that has been actually merged (the automatically added new PatchSet seen in Gerrit Changes).
## That [ChangeLog] is correctly formed if present:
### That the tag is camel-cased, and does not try to be a footer.
### That the paragraph is preceeded and followed by an empty line.
### That tags don't mention JIRA issues. Use Task-number footers for that.
### That tags don't mention the current repository, as that's redundant.
### That the last tag is followed by a space (or line break), for tidyness.
# Some simple checks for incorrect use of Apple brands/trademarks/terminology:
## That the author is aware that the define Q_OS_MAC and qmake scope mac refer to both the OS X and iOS operating systems, since it is commonly mistaken to refer only to OS X.
## That the OS X operating system is correctly named in all instances. OS X is the name of Apple's Darwin-based flagship Desktop operating system and is a trademark; while the 'X' is pronounced as 'ten' and did and does refer to the major version number of the operating system, this is always ignored when writing out the full product name, for example "OS X 10.9 Mavericks", never "OS 10.9 Mavericks". The operating system was formerly named "Mac OS X" but was changed to "OS X" in 2012 with the release of Mountain Lion. Many Apple marketing materials "backported" this name change to Lion as well. Whether a bump to major version 11 would have any impact on this cannot be determined until that happens, if it ever does. Terms such as "Mac", "Macintosh", "Mac OS", "Mac OS X", "OSX", etc., with any combination of spacing and punctuation, should not be used to refer to the operating system. Note that the hardware platform on which OS X runs is correctly termed "Mac" or "Macintosh". To re-emphasize, ONLY use "OS X" to refer to the software, and ONLY use "Mac" or "Macintosh" to refer to the hardware.
## That the deprecated define <code>Q_OS_MACX</code> and qmake scope <code>macx</code> (or similar deprecated constructs such as <code>defined(Q_OS_MAC) && !defined(Q_OS_IOS)</code> and <code>mac:!ios</code>) are not being used. Their respective replacements, <code>Q_OS_OSX</code> and <code>osx</code> should be used instead. Note that some uses of <code>macx</code> in a qmake file may still be valid, for example <code>macx
# A check about touching certain files. Some files are considered "endangered" - seemingly innocuous modifications almost always turn out to be bogus when not done by one of a few experts.
# A check for common spelling mistakes.
# Check for mixing whitespace and non-whitespace changes. As implied by the "don't mix unrelated changes" rule, a commit may contain only whitespace changes or "proper" changes (with whitespace cleanups only on already changed lines, and, as an exception, additions and removals of empty lines). This helps to ensure the usefulness of <code>git blame</code> (note that a clean history is better than using <code>git blame -w</code>, as the latter will also hide significant whitespace changes). A negative verdict may be overridden if it is a false positive resulting from imperfect heuristics, in particular if the change is fixing coding style issues beyond mere whitespace cleanup.
# Various whitespace abuse checks. Tabs in files they are not approved in, trailing whitespace, missing newline at end of file, etc.
# Some simple Coding Style checks. (currently advisory only)
The bot's verdict is a recommendation, and may be overridden by every Approver. However, don't ignore it unless you have a really good reason. "I need to get this done now" is not a valid reason. Neither is "I cannot be bothered to understand what it wants from me". If there is any doubt, discuss alternatives with somebody appropriate. Each override needs to come with a comment on Gerrit.
It is possible to run most of the checks locally before attempting to push. See the <code>qtrepotools/git-hooks/git_post_commit_hook</code> script (it contains installation instructions).
The sanitizer script is available from the "qtrepotools repository":https://qt.gitorious.org/qt/qtrepotools.