go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/frontend/ui/src/views/help/help_page.tsx (about)

     1  // Copyright 2022 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  import {
    16    useLocation,
    17    useNavigate,
    18    Link as RouterLink,
    19  } from 'react-router-dom';
    20  
    21  import { styled } from '@mui/material/styles';
    22  import Accordion from '@mui/material/Accordion';
    23  import MuiAccordionSummary, {
    24    AccordionSummaryProps,
    25  } from '@mui/material/AccordionSummary';
    26  import AccordionDetails from '@mui/material/AccordionDetails';
    27  import Container from '@mui/material/Container';
    28  import EditIcon from '@mui/icons-material/Edit';
    29  import ChevronRightIcon from '@mui/icons-material/ChevronRight';
    30  import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
    31  import FeedbackIcon from '@mui/icons-material/Feedback';
    32  import HistoryIcon from '@mui/icons-material/History';
    33  import Link from '@mui/material/Link';
    34  import Typography, {
    35    TypographyProps,
    36  } from '@mui/material/Typography';
    37  import PageHeading from '@/components/headings/page_heading/page_heading';
    38  
    39  import recentFailuresImageUrl from './images/recent_failures.png';
    40  import ruleIdentifiersImageUrl from './images/failure_association_rule_identifiers.png';
    41  import monorailComponentImageUrl from './images/monorail_component.png';
    42  
    43  const AccordionSummary = (props: AccordionSummaryProps) => (
    44    <MuiAccordionSummary
    45      expandIcon={<ExpandMoreIcon />}
    46      {...props} />
    47  );
    48  
    49  const AccordionHeading = styled(Typography)<TypographyProps>(() => ({
    50    'font-size': 18,
    51  }));
    52  
    53  const HelpPage = () => {
    54    const location = useLocation();
    55    const navigate = useNavigate();
    56  
    57    const handleChange =
    58      (panel: string) => (_: React.SyntheticEvent, isExpanded: boolean) => {
    59        if (isExpanded) {
    60          navigate({ hash: panel }, { replace: true });
    61        } else {
    62          navigate({ hash: '' }, { replace: true });
    63        }
    64      };
    65  
    66    return (
    67      <Container maxWidth="xl">
    68        <PageHeading>
    69          Help
    70        </PageHeading>
    71        <Accordion expanded={location.hash === '#rules'} onChange={handleChange('rules')}>
    72          <AccordionSummary>
    73            <AccordionHeading>
    74              How do I create or modify a failure association rule?
    75            </AccordionHeading>
    76          </AccordionSummary>
    77          <AccordionDetails>
    78            <Typography paragraph>
    79              Failure association rules define an association between a bug and a set of failures.
    80              <ul>
    81                <li><strong>To create a rule</strong>, use the <em>new rule</em> button on the rules page.</li>
    82                <li><strong>To modify a rule</strong>, from the page of that rule, click the edit button (<EditIcon sx={{ verticalAlign: 'middle' }} />) next to the rule definition.</li>
    83              </ul>
    84            </Typography>
    85            <Typography paragraph>
    86              Failure association rules support a subset of&nbsp;
    87              <Link href="https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax">Google Standard SQL syntax</Link> for
    88              boolean expressions, with the following limitations:
    89              <ul>
    90                <li>The only valid operators are <em>AND</em>, <em>OR</em>, <em>NOT</em>, =, &lt;&gt;, LIKE and parantheses.</li>
    91                <li>The only valid function is <Link href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#regexp_contains">REGEXP_CONTAINS</Link>.</li>
    92                <li>The only valid identifiers are <em>test</em> and <em>reason</em>.</li>
    93                <li>Strings must use double quotes.</li>
    94              </ul>
    95              Example: <em>reason LIKE &quot;Check failed: Expected foo, got %&quot; AND test LIKE &quot;MySuite%&quot;</em>.
    96            </Typography>
    97            <Typography paragraph>
    98              The information queriable via the <em>test</em> and <em>reason</em> identifiers is shown below. (The
    99              diagram shows a ci.chromium.org build page).
   100              <img src={ruleIdentifiersImageUrl} alt="Test is the fully-qualified test ID. It appears under tFhe MILO Test Results tab
   101                      under the heading ID. The reason is the failure reason, which appears in the MILO Test Results tab under the heading Failure Reason."></img>
   102            </Typography>
   103            <Typography paragraph>
   104              If you do not see the failure reason section shown in the diagram, it means the test harness did not upload a&nbsp;
   105              <Link href="https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/resultdb/proto/v1/test_result.proto?q=FailureReason">failure reason</Link>.
   106              If you are interested in making a test harness upload failure reasons, please reach out using the send feedback (<FeedbackIcon sx={{ verticalAlign: 'middle' }} />) button
   107              and we can provide instructions.
   108            </Typography>
   109            <Typography paragraph>
   110              We recommend associating failures with bugs using <em>failure reasons</em> instead of <em>tests</em>, if possible. This is for two reasons:
   111              <ul>
   112                <li>
   113                  Associating failures to bugs using <em>tests</em> usually leads to bugs that are more difficult to manage,
   114                  as the tests can fail for multiple different reasons, and tracking the investigation of multiple
   115                  reasons in one bug is hard.
   116                </li>
   117                <li>
   118                  Multiple tests may be failing with the same failure reason, and maintaining one canoncial bug
   119                  for that reason can avoid duplicating investigation work.
   120                </li>
   121              </ul>
   122            </Typography>
   123          </AccordionDetails>
   124        </Accordion>
   125        <Accordion expanded={location.hash === '#find-rule'} onChange={handleChange('find-rule')}>
   126          <AccordionSummary>
   127            <AccordionHeading>
   128              How do I find the failure association rule for a bug?
   129            </AccordionHeading>
   130          </AccordionSummary>
   131          <AccordionDetails>
   132            <Typography paragraph>
   133              For LUCI Analysis auto-filed bugs, the easiest way to get to the rule is by following the link to it in the issue description or first comment.
   134            </Typography>
   135            <Typography paragraph>
   136              For other bugs, a link to the rule (if it exists) should appear in a comment further down the bug.
   137            </Typography>
   138            <Typography paragraph>
   139              The following URL schemes can also be used:
   140              <ul>
   141                <li><strong>Buganizer bugs:</strong> https://luci-analysis.appspot.com/b/<code>BUGANIZER_ID</code>, where BUGANIZER_ID is substituted for the buganizer bug ID, e.g. <code>1234</code>.</li>
   142                <li><strong>Monorail:</strong> https://luci-analysis.appspot.com/b/<code>MONORAIL_PROJECT</code>/<code>MONORAIL_ID</code>, where MONORAIL_PROJECT is the monorail project (e.g. <code>chromium</code>) and MONORAIL_ID is the monorail bug ID, e.g. <code>5678</code>.</li>
   143              </ul>
   144            </Typography>
   145          </AccordionDetails>
   146        </Accordion>
   147        <Accordion expanded={location.hash === '#archive-rule'} onChange={handleChange('archive-rule')}>
   148          <AccordionSummary>
   149            <AccordionHeading>
   150              I no longer need a failure association rule, can I get rid of it?
   151            </AccordionHeading>
   152          </AccordionSummary>
   153          <AccordionDetails>
   154            <Typography paragraph>
   155              Yes! If you no longer need a rule, click the <em>Archive</em> button on the <Link component={RouterLink} to='#find-rule'>rule page</Link>.
   156            </Typography>
   157          </AccordionDetails>
   158        </Accordion>
   159  
   160        <Accordion expanded={location.hash === '#new-bug-filed'} onChange={handleChange('new-bug-filed')}>
   161          <AccordionSummary>
   162            <AccordionHeading>
   163              LUCI Analysis filed a bug. What should I do?
   164            </AccordionHeading>
   165          </AccordionSummary>
   166          <AccordionDetails>
   167            <Typography paragraph>
   168              LUCI Analysis files bugs for <strong>problems</strong> identified by <Link href="http://goto.google.com/luci-analysis-setup#project-configuration">policies configured by your project</Link>
   169              &nbsp;(<Link href="https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/analysis/proto/config/project_config.proto?q=%22BugManagementPolicy%20policies%22">
   170                schema
   171              </Link>).
   172              When you receive a LUCI Analysis bug, the objective should be to fix these problems.
   173              Problem(s) can always be resolved by fixing the problematic test(s), but there may be other ways too.
   174              Click the <em>more info</em> button next to the problem on the <Link component={RouterLink} to='#find-rule'>rule page</Link> to
   175              view its suggested resolution steps and resolution criteria.
   176            </Typography>
   177            <Typography paragraph>
   178              <strong>Key point:</strong> the bug is for <strong>problems</strong>, not <strong>failures</strong>. To fix the problems,
   179              you may not need to fix all failures. For example, depending on the problem, failures occuring on experimental
   180              builders or tests having no impact would be irrelevant.
   181            </Typography>
   182            <Typography paragraph>
   183              Once all problems have been resolved and verified as such by LUCI Analysis, the bug will
   184              be <Link component={RouterLink} to='#bug-verified'>automatically be marked as verified by LUCI Analysis</Link>.
   185            </Typography>
   186            <Typography paragraph>
   187              To investigate a bug:
   188              <ul>
   189                <li>Navigate to the <Link component={RouterLink} to='#find-rule'>rule page</Link> for the bug.</li>
   190                <li>Review the <em>Impact</em> panel to verify the impact is still occuring.</li>
   191                <li>
   192                  Use the <em>Recent failures</em> tab to identify the tests which have impactful failures. Note that only some test variants
   193                  (ways of running the test) may be broken. For example, the failure may only be happening on one device or operating system.
   194                  You can sort the table and use the <em>group by</em> feature to help you.
   195                </li>
   196                <li>
   197                  Review the history of the problematic test variants using the history (<HistoryIcon sx={{ verticalAlign: 'middle' }}/>) button.
   198                  Alternatively, look at examples by expanding the node for the test with the expand (<ChevronRightIcon sx={{ verticalAlign: 'middle' }} />) button
   199                  and clicking on the build link in each row.<br/>
   200                  <img src={recentFailuresImageUrl} alt="The recent failures panel has links to test history and failure examples."></img>
   201                </li>
   202              </ul>
   203            </Typography>
   204            <Typography paragraph>
   205              When investigating a set of test failures, you may identify that the bug is too broad (encompasses multiple different issues)
   206              or too narrow (only captures one part of a larger issue). If this applies, see <Link component={RouterLink} to='#combining-issues'>combining issues</Link>&nbsp;
   207              or <Link component={RouterLink} to='#splitting-issues'>splitting issues</Link>.
   208            </Typography>
   209          </AccordionDetails>
   210        </Accordion>
   211        <Accordion expanded={location.hash === '#priority-update'} onChange={handleChange('priority-update')}>
   212          <AccordionSummary>
   213            <AccordionHeading>
   214              LUCI Analysis updated the priority of a bug. Why?
   215            </AccordionHeading>
   216          </AccordionSummary>
   217          <AccordionDetails>
   218            <Typography paragraph>
   219              LUCI Analysis automatically adjusts the bug priority to match the priority of the problems identified by your project.
   220              Problems can be viewed on the <Link component={RouterLink} to='#find-rule'>rule page</Link>, under the heading <em>Problems</em>.
   221            </Typography>
   222            <Typography paragraph>
   223              Problems and their associated priority are controlled by <Link href="http://goto.google.com/luci-analysis-setup#project-configuration">policies configured by your project</Link>
   224              &nbsp;(<Link href="https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/analysis/proto/config/project_config.proto?q=%22BugManagementPolicy%20policies%22">
   225              schema
   226              </Link>).
   227            </Typography>
   228            <Typography paragraph>
   229              <strong>If the priority update is erroneous,</strong> manually set the bug priority to the correct value.
   230              LUCI Analysis will respect the priority you have set and will not change it.
   231            </Typography>
   232          </AccordionDetails>
   233        </Accordion>
   234        <Accordion expanded={location.hash === '#bug-verified'} onChange={handleChange('bug-verified')}>
   235          <AccordionSummary>
   236            <AccordionHeading>
   237              LUCI Analysis automatically verified a bug. Why?
   238            </AccordionHeading>
   239          </AccordionSummary>
   240          <AccordionDetails>
   241            <Typography paragraph>
   242              LUCI Analysis automatically verifies bugs once all problems identified by your project have been resolved.
   243              Problems can be viewed on the <Link component={RouterLink} to='#find-rule'>rule page</Link>, under the heading <em>Problems</em>.
   244            </Typography>
   245            <Typography paragraph>
   246              Problems are identified according to <Link href="http://goto.google.com/luci-analysis-setup#project-configuration">policies configured by your project</Link>
   247              &nbsp;(<Link href="https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/analysis/proto/config/project_config.proto?q=%22BugManagementPolicy%20policies%22">
   248              schema
   249              </Link>).
   250            </Typography>
   251            <Typography paragraph>
   252              <strong>If the bug closure is erroneous,</strong> go to the <Link component={RouterLink} to='#find-rule'>rule page</Link>, and turn the <em>Update bug</em> switch in the <em>Associated bug</em> panel to off.
   253              Then manually set the bug state you desire.
   254            </Typography>
   255          </AccordionDetails>
   256        </Accordion>
   257  
   258        <Accordion expanded={location.hash === '#bug-reopened'} onChange={handleChange('bug-reopened')}>
   259          <AccordionSummary>
   260            <AccordionHeading>
   261              LUCI Analysis automatically re-opened a bug. Why?
   262            </AccordionHeading>
   263          </AccordionSummary>
   264          <AccordionDetails>
   265            <Typography paragraph>
   266              LUCI Analysis automatically re-opens bugs if their impact exceeds the threshold for filing new bugs.
   267            </Typography>
   268            <Typography paragraph>
   269              <strong>If the bug re-opening is erroneous:</strong>
   270              <ul>
   271                <li>If the re-opening is erroneous because you have just fixed a bug, this may be because there is
   272                  a delay between when a fix lands in the tree and when the impact in LUCI Analysis falls to zero.
   273                  During this time, manually closing the issue as <em>Fixed (Verified)</em> may lead LUCI Analysis
   274                  to re-open your issue. To avoid this, we recommend you only mark your bugs <em>Fixed</em> and
   275                  let LUCI Analysis verify the fix (this could take up to 7 days).</li>
   276                <li>
   277                  Alternatively, you can stop LUCI Analysis overriding the bug by turning off the <em>Update bug</em>
   278                  &nbsp;switch on the <Link component={RouterLink} to='#find-rule'>rule page</Link>.
   279                </li>
   280              </ul>
   281            </Typography>
   282          </AccordionDetails>
   283        </Accordion>
   284  
   285        <Accordion expanded={location.hash === '#combining-issues'} onChange={handleChange('combining-issues')}>
   286          <AccordionSummary>
   287            <AccordionHeading>
   288              I have multiple bugs dealing with the same issue. Can I combine them?
   289            </AccordionHeading>
   290          </AccordionSummary>
   291          <AccordionDetails>
   292            <Typography paragraph>
   293              Yes! Just merge the bugs in the issue tracker, as you would normally. LUCI Analysis will automatically
   294              combine the failure association rules when the next bug filing pass runs (every 15 minutes or so).
   295            </Typography>
   296            <Typography paragraph>
   297              Alternatively, you can <Link component={RouterLink} to='#rules'>modify the failure association rule</Link> to
   298              reflect your intent.
   299            </Typography>
   300            <Typography paragraph>
   301              <strong>Take care:</strong> Just because some of the failures of one bug are the same as another,
   302              it does not mean all failures are. We generally recommend defining bugs
   303              based on <em>failure reason</em> of the failure (i.e. <em>reason LIKE &quot;%Check failed: Expected foo, got %&quot;</em>),
   304              if possible. See <Link component={RouterLink} to='#rules'>modify a failure association rule</Link>.
   305            </Typography>
   306          </AccordionDetails>
   307        </Accordion>
   308  
   309        <Accordion expanded={location.hash === '#splitting-issues'} onChange={handleChange('splitting-issues')}>
   310          <AccordionSummary>
   311            <AccordionHeading>
   312              My bug is actually dealing with multiple different issues. Can I split it?
   313            </AccordionHeading>
   314          </AccordionSummary>
   315          <AccordionDetails>
   316            <Typography paragraph>
   317              If the failures can be distinguished using the <em>failure reason</em> of the test or the
   318              identity of the test itself, you can. Refer to <Link component={RouterLink} to='#rules'>
   319              modify a failure association rule</Link>.
   320            </Typography>
   321            <Typography paragraph>
   322              If the failures <strong>cannot</strong> be distinguished based on the <em>failure reason</em>&nbsp;
   323              or <em>test</em>, it is not possible to represent this split in LUCI Analysis. In this case, we recommend
   324              using the bug linked from LUCI Analysis as the parent bug to track all failures of the test,
   325              and using seperate (child) bugs to track the investigation of individual issues.
   326            </Typography>
   327          </AccordionDetails>
   328        </Accordion>
   329        <Accordion expanded={location.hash === '#component-selection'} onChange={handleChange('component-selection')}>
   330          <AccordionSummary>
   331            <AccordionHeading>
   332              How does LUCI Analysis determine which component(s) to assign to an auto-filed bug?
   333            </AccordionHeading>
   334          </AccordionSummary>
   335          <AccordionDetails>
   336            <Typography paragraph>
   337            When LUCI Analysis auto-files a bug for a cluster, it assigns it to all components which contribute at least 30% of the cluster&apos;s test failures.
   338            </Typography>
   339            <Typography paragraph>
   340            In chromium projects, the component associated with a test failure is controlled by&nbsp;
   341              <Link href="https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/dirmd/README.md" target="_blank">
   342              DIR_METADATA
   343              </Link>&nbsp;files in the directory hierarchy of the test.
   344            The component associated with a specific test failure can be validated by viewing the failure in MILO (ci.chromium.org), and looking for the monorail_component tag.
   345            </Typography>
   346            <img src={monorailComponentImageUrl} alt="Monorail component is the component that test matches, it appears in Milo in the test variant tags."/>
   347            <Typography paragraph>
   348             If a failure does not have this tag, it means the test result uploader is not providing component information for the test.
   349            </Typography>
   350            <Typography paragraph>
   351             In most cases, bugs being assigned to the wrong component can be fixed by updating the DIR_METADATA for the test.
   352            </Typography>
   353          </AccordionDetails>
   354        </Accordion>
   355        <Accordion expanded={location.hash === '#setup'} onChange={handleChange('setup')}>
   356          <AccordionSummary>
   357            <AccordionHeading>
   358              How do I setup LUCI Analysis for my project?
   359            </AccordionHeading>
   360          </AccordionSummary>
   361          <AccordionDetails>
   362            <Typography paragraph>
   363              Googlers can follow the instructions at <Link href="http://goto.google.com/luci-analysis">go/luci-analysis</Link>.
   364            </Typography>
   365          </AccordionDetails>
   366        </Accordion>
   367  
   368        <Accordion expanded={location.hash === '#feedback'} onChange={handleChange('feedback')}>
   369          <AccordionSummary>
   370            <AccordionHeading>
   371              I have a problem or feedback. How do I report it?
   372            </AccordionHeading>
   373          </AccordionSummary>
   374          <AccordionDetails>
   375            <Typography paragraph>
   376              First, check if your issue is addressed here. If not, please use the send feedback (<FeedbackIcon sx={{ verticalAlign: 'middle' }} />) button at the top-right of this page to send a report.
   377            </Typography>
   378          </AccordionDetails>
   379        </Accordion>
   380      </Container>
   381    );
   382  };
   383  
   384  export default HelpPage;