summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/condprof-addons.rst
blob: c302eef5bed231c7ce634680b26b3429b50a0d2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
CondProf Addons
===============

CondProf Addons is a linter for condprof customization JSON files (see :searchfox:`testing/condprofile/condprof/customization`),
it reports linting errors if:

- any of the addons required by the customization files (e.g. see :searchfox:`testing/condprofile/condprof/customization/webext.json`)
  is not found in the tar file fetched through the `firefox-addons` fetch task (see :searchfox:`taskcluster/ci/fetch/browsertime.yml`)
- or the expected `firefox-addons` fetch task has not been found

Run Locally
-----------

The mozlint integration of condprof-addons can be run using mach:

.. parsed-literal::

    $ mach lint --linter condprof-addons <file paths>

Alternatively, if the ``--linter condprof-addons`` is omitted, the ``condprof-addons`` will still be selected automatically if
any of the files paths passed explicitly is detected to be part of the condprof customization directory.

The ``condprof-addons`` will also be running automatically on ``mach lint --outgoing`` if there are customization files changes
detected in the outgoing patches.

Run on Taskcluster
------------------

The condprof-addons job shows up as ``misc(condprof-addons)`` in the linting job. It should run automatically if changes are made
to condprof customization JSON files.

Fix reported errors
-------------------

XPI file is missing from the firefox-addons.tar archive
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This linting errors is expected to be reported if the linter detected that a confprof customization file
requires an addon but the related xpi filename is not included in the firefox-addons.tar file fetched
through the `firefox-addons` fetch task (see :searchfox:`taskcluster/ci/fetch/browsertime.yml`).

If the patch or phabricator revision is not meant to be landed, but only used as a temporary patch
pushed on try or only applied locally (e.g. to run the tp6/tp6m webextensions perftests with a given
third party extension installed to gather some metrics and/or GeckoProfiler data), then it can be
safely ignored.

On the contrary, if the patch or phabricator revision is meant to be landed on mozilla-central,
the linting error have to be fixed before or along landing the change, either by:

- removing the addition to the customization file if it wasn't intended to include that addon to all runs
  of the tp6/tp6m webextensions perftests

- updating the `firefox-addons` fetch task as defined in :searchfox:`taskcluster/ci/fetch/browsertime.yml`
  by creating a pull request in the github repository where the asset is stored, and ask a review from
  a peer of the `#webextensions-reviewer` and `#perftests-reviewers` review groups.

firefox-addons taskcluster config 'add-prefix' attribute should be set to 'firefox-addons/'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If this linting error is hit, then the `firefox-addons` task defined in :searchfox:`taskcluster/ci/fetch/browsertime.yml`
is missing the `add-prefix` attribute or its value is not set to the expected 'firefox-addons/' subdir name.

This is enforced as a linting rule because when the condprof utility is going to build a conditioned profile
for which some add-ons xpi files are expected to be sideloaded (see :searchfox:`testing/condprofile/condprof/customization.webext.json`),
to avoid re-downloading the same xpi from a remote urls every time the conditioned profile is built on the build infrastructure
(which for tp6/tp6m perftests will happen once per job being executed) condprof is going to look first if the expected xpi file
names are already available in `$MOZ_FETCHES_DIR/firefox-addons`.

firefox-addons taskcluser fetch config section not found
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This linting error is hit if the linter does not find the expected `firefox-addons` task defined in :searchfox:`taskcluster/ci/fetch/browsertime.yml`
or it is missing the expected `fetch` attribute.

Configuration
-------------

ConfProf Addons does not currently provide any configuration files.

Sources
-------

* :searchfox:`Configuration (YAML) <tools/lint/condprof-addons/yml>`
* :searchfox:`Source <tools/lint/condprof-addons/__init__.py>`
* :searchfox:`Test <tools/lint/test/test_condprof_addons.py>`