Added SPDX identifiers to all .py files except those in migrations directory.
Fixes: [YOCTO #13527]
Signed-off-by: Meh Mbeh Ida Delphine <idadelm@gmail.com>
Signed-off-by: Paul Eggleton <bluelightning@bluelightning.org>
In bitbake commit 5796ed550d127853808f38257f8dcc8c1cf59342, line
numbering functionality was improved with the starting line number for
python functions being stored in a "lineno" varflag; however, mapped
functions (using EXPORT_FUNCTIONS) did not have a line number set, which
caused parse failures. This bug was not fixed until
547128731e62b36d2271c4390b3fee2b16c535dc so we should be avoiding any
bitbake commit inside that range.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add an option to stop at a particular commit (so we can then repeat a
specific commit afterwards easily for debugging purposes).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Make it possible to re-collect all the history for a given path.
(Typically this would only be used for debugging, as it saves time if
you are trying to correct an issue with upgrade data collection for a
single recipe.)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Recipes come and go over time, so when a recipe gets deleted the history
for it goes away, which means that if you look back in time you do not
see an accurate picture - you only see the subset of recipes that are
currently present. Introduce an indirection between recipes and history
that allows for old recipes to persist (mostly in name only).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
It's best practice for security reasons to use shell=False and pass
command line arguments as a list; it also avoids some pain with
escaping, so let's use it everywhere we can (in fact we're only left
with one place in layerindex/tasks.py where we now pass shell=True).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
If there is no release or milestone covering the current date, show an
error message at the top of the recipes list page to alert the user that
they can't view current data (since this is a common cause of not being
able to see that which may not be immediately apparent).
Additionally, show a warning within rrs_upgrade_history when this
happens.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
If we're in a repository containing multiple layers, we don't care about
commits that don't affect the layer we are processing, so skip those
commits rather than passing them to upgrade_history_internal.py which
will ignore them (which is significantly slower).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add an option to specify which maintenance plan to operate on (largely
for debugging purposes).
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
We don't really need to clean up the repository, we'll take care of it
on subsequent runs.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Sometimes it's useful to be able to re-try processing a particular
commit (generally in conjunction with --dry-run), so add an option to
enable that.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
We check out different revisions while we do this processing, and so
does the layer index update script, so we shouldn't be allowing both to
run at once or nasty stuff will happen.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Since we're now executing a separate script per commit, we should try
not to do that unless the commit actually touches recipe files in order
to avoid wasting time.
(Whilst it's possible that a change to a bbclass might alter what's in
the recipe, we can ignore that since we are only concerned with actual
upgrades which would always require some sort of change to the recipe or
an include file, so we can safely skip commits that don't do that.)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Instead of arbitrarily importing the last 8 days of upgrades, record the
date and commit when we do an import, and then use that information the
next time the script is run.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
If you want to go back and get history for the earlier releases (krogoth
and previous) then we need to be able to support both python 2 and 3,
which practically means we need the same split for this script as we
have for the main layer index update script.
The catch here is that since we are going back and following the history
of changes forward, we basically need to use the same version of bitbake
that was current at that time. This works except for around the
transition between python 2 to 3 where the metadata lagged behind a bit,
so we need to take that into account. In order to keep things generic we
have a date field on the maintenance plan layer branch that specifies
the date in the metadata where we should switch over to python 3, and
then link to PythonEnvironment records that should be used for python 2
and 3 respectively.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Instead of processing all layerbranches, only process those associated
with an enabled maintenance plan. This is one step towards being able to
use the RRS together with a more general layer index database.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
We don't need to create branches here, and we don't need to actually
check anything out unless we're going to parse, so we can save a bit of
time by not doing so.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Add the ability to run the scripts without writing changes back to the
database, for debugging purposes.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
The new tinfoil API acts as a client/server so isn't need to work
around creating process to avoid errors in cooker with different
data revisions.
Also add a try/except when create an upgrade display the error.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
The new client/server API of tinfoil requires explicit call of
shutdown method to send the event for finalize cooker process.
[YOCTO #10863]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Django 1.6 provides a context manager for atomic transactions so
update the way for make db transactions.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
without versioning.
Don't detect upgrade in git recipes that don't have versioning only
PV=git.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
bb.cache.Cache.loadDatafull() expects an filepath in asciii, if not
is provided it fails with character mapping error.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Tinfoil shutdown was not accepted as patch into bitbake because
this is a simple solution to a big problem.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
When runs recipe parse with different revisions in same process it
generates errors due to cooker parser uses global data cache's.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Copied get_recipe_pv_without_srcpv from oe-core/recipeutils library
to avoid import errors caused by have imported twice oe-core from poky
and from tinfoil.
rrs/tools/rrs_upgrade_history.py: Update to use get_recipe_pv_without_srcpv
from common.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>