Commit Graph

22 Commits

Author SHA1 Message Date
Meh Mbeh Ida Delphine
2314fb2811 Add SPDX license headers to layerindex-web source files
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>
2021-04-21 08:22:51 +12:00
Paul Eggleton
c0b8439182 RRS: collect history independent of current recipes
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>
2019-11-21 02:27:39 +13:00
Paul Eggleton
303d7ca235 Use shell=False where possible with utils.runcmd()
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>
2019-07-17 11:31:01 +12:00
Paul Eggleton
c74e4bd4d9 rrs_maintainer_history: check out layer branch before looking for maintainers.inc
The revision that happens to be checked out at the moment could be
anything and might not actually have a maintainers.inc, so check out the
proper branch before looking for it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-02-14 10:05:53 +13:00
Paul Eggleton
9c65bf254e Use try...finally or with to ensure files get closed
Best practices state that you should use a mechanism that ensures files
get closed in case of any error, so let's do that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-02-14 10:05:53 +13:00
Paul Eggleton
e071ebab29 rrs: add flag to MaintenancePlan to specify layer-wide maintainers
Most layers do not track maintenance on a per-recipe basis, and for
those layers we will hide some of the per-recipe maintainer features
and on the recipe detail show the layer maintainer(s) as the
maintainer(s) of the recipe.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
7606664eeb rrs: link maintenance/upstream history to layerbranch
RecipeUpstreamHistory was not linked to the layer it was produced from,
which meant that it wasn't easy to query for a different maintenance
plan (i.e. a different layer) and thus the maintenance plan selection
on the recipe list didn't really work. Add a link field, populate it in
a migration and then make it required.

We had added a link earlier from RecipeMaintainerHistory to LayerBranch
but it was optional; for the same reasons we now populate it and make it
required.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
201c74ca0f rrs/tools: add -p/--plan option
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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
6a332c5d8f rrs: handle linking maintainership
Provide a mechanism set the maintainer for things like gcc-cross-<arch>
to the same as gcc. (We do have entries in the .inc file for these,
however they aren't useful as they don't match the recipe name when we
parse it, and due to the fact that RecipeMaintainer objects link
directly to Recipe objects, we can't handle entries that don't map to a
real recipe).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
519236490d rrs_maintainer_history: avoid unnecessary checkouts
We don't actually need to check out the repository until we actually
analyse a commit, so avoid doing so. Additionally, there's not much
point in checking out master at the end, let the next script invocation
do that if needed (if it needs to, it should since otherwise there's no
guarantee what state the repository is in).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
58c56883fd rrs_maintainer_history: add --fullreload option
Add an option that deletes all maintainer history records for the
current layer branch so that they can then be reloaded from scratch.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
291f6bfde7 rrs/tools: use layer index lock
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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
50aab7c03a rrs/tools: run all tools scripts with python3
These scripts should all now be run under python 3, so update the
shebangs accordingly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
687c2b0051 rrs_maintainer_history.py: support maintenance plans and remove poky hardcoding
Instead of hardcoded references to the poky repository, look for any
maintainers.inc file in layers associated with the layerbranches for all
enabled maintenance plans. At present few layers have this file, but at
least it will now work generically in any layer index instance.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:52 +12:00
Paul Eggleton
8370c10306 rrs/tools: avoid unnecessary checkouts
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>
2018-05-04 23:57:52 +12:00
Paul Eggleton
fd786875c3 rrs/tools: add dry-run option to each script
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>
2018-05-04 23:57:52 +12:00
Aníbal Limón
8ed223e13c rrs/tools: Upgrade to use transaction.atomic() in Django 1.6
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>
2018-05-04 23:57:52 +12:00
Aníbal Limón
af8275db0f rrs/tools/rrs_maintainer_history.py: Update to point new meta-poky repository.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
22eb60487f rrs/tools/rrs_maintainer_history.py: Set new recipes to No maintainer if don't have
When add new recipes sometimes don't have maintainer defined causing
errors on frontend when search for one.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
45bd164233 rrs/tools: Change to use get_logger from common.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
bdde6f5c1b rrs/tools/rrs_: Reorder imports.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
607e5f141b rrs/tools: Add recipe maintainer history script.
This script creates the manianter history of recipes based on
maintainer.inc file.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00