]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
7 years agoupdate.py: check whether branch existed when nocheckout rbt/li_recs
Robert Yang [Mon, 9 Jul 2018 03:28:38 +0000 (11:28 +0800)] 
update.py: check whether branch existed when nocheckout

Fixed:
Assume there is no master branch in hello layer:
$ update.py -l hello -b master
INFO: Skipping update of layer hello - branch master doesn't exist

This is correct since hello layer doesn't have master branch, but when --nocheckout:
$ update.py -l hello -b master  --nocheckout
[snip]
INFO: Sorting layers for branch mater:
WARNING: Cannot find required collections on branch master:
WARNING: hello: LAYERDEPENDS: <snip>

This is incorrect, this patch fixed the problem, now it skips it since the
branch doesn't exists when --nocheckout.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
7 years agoupdate.py: add layers when RECOMMENDS isn't satisfied
Robert Yang [Fri, 6 Jul 2018 07:20:47 +0000 (15:20 +0800)] 
update.py: add layers when RECOMMENDS isn't satisfied

When layer_a RECOMMENDS layer_b, try to add layer_b before layer_a, but if
layer_b is not found, still add layer_a.

And print summary error mesage:

$ update.py -b master

ERROR: Issues found on branch master:
    openembedded-core: Added without LAYERRECOMMENDS
    meta-secure-env: Failed to add since LAYERDEPENDS is not satisfied

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
7 years agoutils.py: fix checkout_repo when no HEAD
Robert Yang [Fri, 6 Jul 2018 04:31:06 +0000 (12:31 +0800)] 
utils.py: fix checkout_repo when no HEAD

Fixed:
$ git clone <url>
warning: remote HEAD refers to nonexistent ref, unable to checkout.
$ git rev-parse HEAD
HEAD
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Catch the error and avoid that.

And use "git reset --hard" to replace of "git reset --hard HEAD", HEAD is
default for git reset, so they are the same, but the later one reports error
when remote HEAD doesn't exist:
$ git reset --hard HEAD
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
[snip]

$ git reset --hard
No errors.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
7 years agoupdate_layer.py: avoid calling setup_core_layer_sys_path() when --initial
Robert Yang [Fri, 6 Jul 2018 03:09:37 +0000 (11:09 +0800)] 
update_layer.py: avoid calling setup_core_layer_sys_path() when --initial

Fixed:
$ update.py -b <new_branch>
[snip]
NOTE: Starting bitbake server...
Traceback (most recent call last):
  File "update_layer.py", line 471, in main
    utils.setup_core_layer_sys_path(settings, branch.name)
  File "/buildarea1/lyang1/layerindex-web/layerindex/utils.py", line 376, in setup_core_layer_sys_path
    core_layerdir = os.path.join(core_repodir, core_layerbranch.vcs_subdir)
AttributeError: 'NoneType' object has no attribute 'vcs_subdir'
[snip]

This is because core_layerbranch is not in database yet for completely new
branch, so it is None and we will get the error. Avoid calling
setup_core_layer_sys_path() when "update_layer.py --initial" will fix the
problem.

And also only add core layer's sys path when it is present, since core layer
may not be added yet for completely new branch.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
7 years agorrs_upstream_history.py: fix set_regexes function
Yi Zhao [Fri, 1 Jun 2018 07:00:11 +0000 (15:00 +0800)] 
rrs_upstream_history.py: fix set_regexes function

REGEX, REGEX_URI and GITTAGREGEX are replaced by UPSTREAM_CHECK_REGEX,
UPSTREAM_CHECK_URI and UPSTREAM_CHECK_GITTAGREGEX

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upstream_email.py: enable set log level
Yi Zhao [Fri, 1 Jun 2018 07:00:10 +0000 (15:00 +0800)] 
rrs_upstream_email.py: enable set log level

Add logger.setLevel to enable set log level.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoAdd CSV export for layer recipes
Paul Eggleton [Mon, 7 May 2018 00:04:38 +0000 (12:04 +1200)] 
Add CSV export for layer recipes

Add the ability to export the recipe listing for a layer to a CSV file
for importing into external tools. At the moment we include name,
version and license, but there is a parameter that lets you specify the
fields to include in the URL if desired.

Implements [YOCTO #12722].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoDrop old raw recipe export code
Paul Eggleton [Sun, 6 May 2018 23:53:11 +0000 (11:53 +1200)] 
Drop old raw recipe export code

We're about to replace this with a proper CSV export function, so we
don't need this dead code hanging around anymore.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoTODO: add RRS items
Paul Eggleton [Wed, 18 Apr 2018 12:55:27 +0000 (00:55 +1200)] 
TODO: add RRS items

Add some stuff still left to be done after the merging.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: fix unique constraint on RecipeMaintainerHistory sha1 field
Paul Eggleton [Wed, 18 Apr 2018 04:43:05 +0000 (16:43 +1200)] 
rrs: fix unique constraint on RecipeMaintainerHistory sha1 field

Although it's unlikely to be an issue, technically we shouldn't be
insisting the sha1 field be unique globally, just within each
layerbranch, so adjust the constraints.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: admin: validate that email address fields are set
Paul Eggleton [Wed, 18 Apr 2018 04:30:00 +0000 (16:30 +1200)] 
rrs: admin: validate that email address fields are set

If automated emails are enabled, we need to ensure that the other email
fields are populated, so validate that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add flag to MaintenancePlan to specify layer-wide maintainers
Paul Eggleton [Wed, 18 Apr 2018 04:11:51 +0000 (16:11 +1200)] 
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>
7 years agorrs_upstream_history: make more robust
Paul Eggleton [Wed, 18 Apr 2018 01:38:28 +0000 (13:38 +1200)] 
rrs_upstream_history: make more robust

Avoid exceptions / blank versions during recipe upstream crashing the
entire script.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: skip commits that don't touch the layer
Paul Eggleton [Tue, 17 Apr 2018 23:33:10 +0000 (11:33 +1200)] 
rrs_upgrade_history: skip commits that don't touch the layer

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>
7 years agorrs: validate that a layerbranch is only part of one plan
Paul Eggleton [Tue, 17 Apr 2018 21:43:41 +0000 (09:43 +1200)] 
rrs: validate that a layerbranch is only part of one plan

The processing code can't currently handle if a layerbranch is part of
more than one plan, so disallow that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agotemplates/rrs: replace use of = with ==
Paul Eggleton [Fri, 13 Apr 2018 04:03:42 +0000 (16:03 +1200)] 
templates/rrs: replace use of = with ==

I can't quite tell which Django version broke this, but in any case
based on what's in pagination.html it seems we ought to have been
using == already.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/urls: Use new urlpatterns list syntax
Paul Eggleton [Fri, 13 Apr 2018 03:51:23 +0000 (15:51 +1200)] 
rrs/urls: Use new urlpatterns list syntax

The patterns() function is deprecated in Django 1.8 and gone in 1.10, so
we should switch over to the new list format.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: link maintenance/upstream history to layerbranch
Paul Eggleton [Tue, 10 Apr 2018 23:01:33 +0000 (11:01 +1200)] 
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>
7 years agorrs: drop a couple of unused functions from Raw class
Paul Eggleton [Tue, 10 Apr 2018 22:35:56 +0000 (10:35 +1200)] 
rrs: drop a couple of unused functions from Raw class

These two functions aren't being used anywhere. In the interest of
having as little code directly reading the database using SQL as
possible, drop them.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: add -p/--plan option
Paul Eggleton [Mon, 9 Apr 2018 21:28:14 +0000 (09:28 +1200)] 
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>
7 years agorrs: improve admin for Release/Milestone objects
Paul Eggleton [Mon, 9 Apr 2018 05:37:34 +0000 (17:37 +1200)] 
rrs: improve admin for Release/Milestone objects

* Ensure the Release and Milestone names are separated by a space when
  listing Milesones
* Include the maintenance plan name in the name shown for each
  Release/Milestone
* Allow filtering Releases/Milestones by maintenance plan

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: duplicate releases from first plan when adding a new plan
Paul Eggleton [Mon, 9 Apr 2018 05:37:56 +0000 (17:37 +1200)] 
rrs: duplicate releases from first plan when adding a new plan

It's a pain to have to add all the releases when adding a new
maintenance plan. Since these are likely to be the same (or similar) for
every plan, then duplicate them across from the first plan when you save
a new one.

Also add "default" milestones on the assumption that other layers
probably won't want to use the 4-milestone split per release, but there
do have to be some milestone records, so just create one milestone for
each release.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: default python2/3 environments for new maintenance plan layer branches
Paul Eggleton [Mon, 9 Apr 2018 05:33:49 +0000 (17:33 +1200)] 
rrs: default python2/3 environments for new maintenance plan layer branches

It's a bit of a pain to have to set the two python environment fields on
every record in order to have things set correctly, and it can easily
get forgotten, so try to set them automatically by default (assuming
reasonable naming).

Note that this does introduce an annoying behaviour whereby if you click
"Add another Maintenance plan layer branch" and then decide you don't
want it, the admin form will insist you fill in the fields unless you
clear out the python2/3 environment fields. I'm not sure how to fix
that, so I'm leaving it as-is for now.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: releases should be unique by plan and name, not just name
Paul Eggleton [Mon, 9 Apr 2018 04:36:13 +0000 (16:36 +1200)] 
rrs: releases should be unique by plan and name, not just name

I missed changing this constraint when adding the plan field. We want to
be able to have the same named release on another plan.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add charts page
Paul Eggleton [Mon, 9 Apr 2018 02:45:49 +0000 (14:45 +1200)] 
rrs: add charts page

Add some basic charts to show recipe upstream / patch status.

Implements [YOCTO #7909].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add patch listing to recipe list and detail
Paul Eggleton [Sun, 8 Apr 2018 22:23:13 +0000 (10:23 +1200)] 
rrs: add patch listing to recipe list and detail

Expose the newly added patch information in the RRS:

* Add a table to the recipe detail listing the patches for the recipe
* Add pending / total counts to the recipe list page

Implements [YOCTO #7909].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoImplement patch tracking
Paul Eggleton [Mon, 18 Dec 2017 09:44:24 +0000 (22:44 +1300)] 
Implement patch tracking

Collect information about patches applied by a recipe, and record each
patch along with the upstream status, presenting them in the recipe
detail.

Implements [YOCTO #7909].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: restore full-width pages
Paul Eggleton [Sun, 8 Apr 2018 22:53:45 +0000 (10:53 +1200)] 
rrs: restore full-width pages

Upon consideration, for the width of the information we want to present
we do actually want full-width pages for the RRS. When this was changed
earlier in the rrs branch it was changed in the base template, but we
want to keep the same style elsewhere, so put a block in that will let
use the "container-fluid" style (full width) in the RRS pages and
"container" by default everywhere else.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoTurn URLs into links in layer notes
Paul Eggleton [Sun, 8 Apr 2018 23:07:45 +0000 (11:07 +1200)] 
Turn URLs into links in layer notes

It's often useful to add a link to another page for more information
when adding a layer note, so turn any included URLs into actual links.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: improve checkout logic
Paul Eggleton [Fri, 6 Apr 2018 05:19:22 +0000 (17:19 +1200)] 
rrs_upgrade_history: improve checkout logic

* Consolidate the code for checking out a repository, using the newly
  added utils.checkout_repo() function
* Check out a layer's dependencies, not just the layer itself
* Only check out if the desired revision isn't already checked out
  (mostly useful for bitbake which we would otherwise be checking out
  much more frequently than necessary since it may not have changed
  even if we've moved to a new commit in the layer).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoutils: add common function to check out a specific git revision
Paul Eggleton [Fri, 6 Apr 2018 11:27:00 +0000 (23:27 +1200)] 
utils: add common function to check out a specific git revision

Checking out a revision in the bitbake/layer repositories is something
we are doing in a few places, so add a checkout_repo() function that
does this, ensuring that we don't get tripped up by any junk files,
and avoids checking out if the repository is already at the desired
revision (thus avoiding the clean operation and e.g. preserving any
.pyc files that aren't stale and would speed things up a little). Note
that we do the clean before checking out in case there are untracked
files that are tracked in the commit we are checking out.

In addition to adding this function, change the existing code that we
use in the update script to check out a layer use the new function.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agomodels: implement layerindex method to get recursive dependencies
Paul Eggleton [Fri, 6 Apr 2018 05:15:52 +0000 (17:15 +1200)] 
models: implement layerindex method to get recursive dependencies

It would be useful in some scenarios to get the complete list of
recursive dependencies for a layer, so add a function to do that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoImplement layer web repo commit URL
Paul Eggleton [Tue, 3 Apr 2018 11:19:46 +0000 (23:19 +1200)] 
Implement layer web repo commit URL

The Recipe Reporting System needs to be able to provide links to commits
in the web interface for the repository, but we can only do this if we
have a custom template URL just like we do for file/tree links, since
it's different for different git web interfaces. Add support in all the
various places for such a URL and make use of it in the RRS.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: support new source structure in recipe detail
Paul Eggleton [Tue, 3 Apr 2018 05:22:31 +0000 (17:22 +1200)] 
rrs: support new source structure in recipe detail

In the rrs branch we used to just store SRC_URI in a field, however we
now have a proper model to store sources, so use that in the RRS recipe
detail page.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoSave recipe source URLs
Paul Eggleton [Mon, 8 Jan 2018 20:46:40 +0000 (09:46 +1300)] 
Save recipe source URLs

Save each remote SRC_URI so we can use these for the recipe reporting
system. This replaces an earlier implementation in the rrs branch where
we simply stored SRC_URI verbatim.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoadmin: use more dynamic method of setting recipe read-only fields
Paul Eggleton [Tue, 17 Apr 2018 20:57:12 +0000 (08:57 +1200)] 
admin: use more dynamic method of setting recipe read-only fields

Every time we add something that links to Recipe we had to add it to the
exclusions list in the readonly_fields line for RecipeAdmin (and
ClassicRecipeAdmin), which is tedious and easily forgotten. We can avoid
this by looking at each field and excluding it by its attributes rather
than having a hardcoded list of names.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoAdd a link from the Tools drop-down to the RRS if enabled
Paul Eggleton [Tue, 3 Apr 2018 04:36:17 +0000 (16:36 +1200)] 
Add a link from the Tools drop-down to the RRS if enabled

If the RRS is enabled, then add a link to it in the tools menu. I don't
expect this to be used a lot, but otherwise the only way you'd get there
would be either externally or via the link from the layer detail.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: Add link to layer detail to breadcrumb on recipe detail
Paul Eggleton [Tue, 3 Apr 2018 04:26:45 +0000 (16:26 +1200)] 
rrs: Add link to layer detail to breadcrumb on recipe detail

Add a convenience link to the layer detail to the breadcrumb (also as an
indicator, since it's possible to have more than one layer in the
maintenance plan).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: handle linking maintainership
Paul Eggleton [Tue, 3 Apr 2018 03:30:00 +0000 (15:30 +1200)] 
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>
7 years agorrs/views: replace mimetype with content_type
Paul Eggleton [Mon, 2 Apr 2018 23:44:05 +0000 (11:44 +1200)] 
rrs/views: replace mimetype with content_type

Adapt to this change that happened sometime in Django 1.7.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_maintainer_history: avoid unnecessary checkouts
Paul Eggleton [Thu, 29 Mar 2018 03:13:59 +0000 (16:13 +1300)] 
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>
7 years agorrs_maintainer_history: add --fullreload option
Paul Eggleton [Thu, 29 Mar 2018 03:09:35 +0000 (16:09 +1300)] 
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>
7 years agorrs_upgrade_history: drop final clean
Paul Eggleton [Wed, 28 Mar 2018 11:50:32 +0000 (00:50 +1300)] 
rrs_upgrade_history: drop final clean

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>
7 years agorrs_upgrade_history: handle only .inc file changing
Paul Eggleton [Wed, 28 Mar 2018 11:45:23 +0000 (00:45 +1300)] 
rrs_upgrade_history: handle only .inc file changing

If a recipe upgrade only consists of a .inc file changing, we were not
picking it up, since we were only looking specifically for recipes
(.bb). If a .inc file changes, assume all .bb files in the same
directory (if any) should be parsed to look for an upgrade.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: ensure recipe parsing code deletes temporary dir
Paul Eggleton [Wed, 28 Mar 2018 11:43:22 +0000 (00:43 +1300)] 
rrs/tools: ensure recipe parsing code deletes temporary dir

load_recipes() was leaving files around in /tmp; on my Fedora system
this eventually resulted in /tmp running out of space which we do not
want.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoREADME.rrs: update
Paul Eggleton [Tue, 20 Mar 2018 02:17:14 +0000 (15:17 +1300)] 
README.rrs: update

Drop outdated information, fix typos/spelling/grammar, improve
formatting and add some new steps.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: Add debug option to process specific commit
Paul Eggleton [Tue, 27 Mar 2018 11:28:21 +0000 (00:28 +1300)] 
rrs_upgrade_history: Add debug option to process specific commit

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>
7 years agorrs_upgrade_history: ignore files outside of the layer
Paul Eggleton [Tue, 27 Mar 2018 03:16:29 +0000 (16:16 +1300)] 
rrs_upgrade_history: ignore files outside of the layer

We were parsing recipes that were in the repository but not inside the
actual layer we're dealing with (e.g. we have meta-selftest within the
OE-Core repository, containing a number of recipes that are only
intended for testing purposes and should not be looked at by this
script).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: show text of any exception that blocks parsing
Paul Eggleton [Tue, 27 Mar 2018 03:06:09 +0000 (16:06 +1300)] 
rrs_upgrade_history: show text of any exception that blocks parsing

If an exception occurs during parsing, let's actually see what kind of
exception it was in the output.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: handle broken version numbers
Paul Eggleton [Tue, 27 Mar 2018 02:59:22 +0000 (15:59 +1300)] 
rrs_upgrade_history: handle broken version numbers

In OE-Core revision e0531174119bff21e9014b95ed1bbd0e1c01af26 we
accidentally committed a new e2fsprogs recipe with ..bb at the end of
its name instead of .bb. This was fixed immediately afterwards, but when
the RRS hits this commit, it doesn't fail immediately, but the bogus
version "1.43." gets into the database and all subsequent commits
touching the e2fsprogs recipe cause bb.utils.vercmp_part() to blow up
because one of the version parts in the "previous" version in the database
is apparently empty. To work around this and any similar issues, just
reject any change that results in such a broken version string (on the
assumption that it'll be corrected in a subsequent commit and thus we
will get to re-parse the recipe then and therefore not miss the
upgrade.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: use layer index lock
Paul Eggleton [Mon, 26 Mar 2018 04:40:33 +0000 (17:40 +1300)] 
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>
7 years agorrs_upgrade_history: only look at commits that actually change recipes
Paul Eggleton [Mon, 26 Mar 2018 01:53:29 +0000 (14:53 +1300)] 
rrs_upgrade_history: only look at commits that actually change recipes

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>
7 years agorrs_upstream_history: use try...finally to ensure tinfoil is shut down
Paul Eggleton [Sun, 25 Mar 2018 22:14:48 +0000 (11:14 +1300)] 
rrs_upstream_history: use try...finally to ensure tinfoil is shut down

We want tinfoil.shutdown() to be called even if an exception occurs.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: use date/commit of last recipe upgrade import
Paul Eggleton [Sun, 25 Mar 2018 21:40:01 +0000 (10:40 +1300)] 
rrs_upgrade_history: use date/commit of last recipe upgrade import

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>
7 years agorrs_upgrade_history: handle multiple recipes with same pn per layer
Paul Eggleton [Fri, 23 Mar 2018 12:10:39 +0000 (01:10 +1300)] 
rrs_upgrade_history: handle multiple recipes with same pn per layer

We should expect multiple matches for layerbranch + pn, so use filter()
instead of get() and take the first id that matches.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: add a --fullreload option
Paul Eggleton [Fri, 23 Mar 2018 12:08:14 +0000 (01:08 +1300)] 
rrs_upgrade_history: add a --fullreload option

Add a --fullreload option which deletes all upgrade records for the
layerbranch first.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools/common.py: ensure we pass a string to loadDataFull()
Paul Eggleton [Fri, 23 Mar 2018 12:06:36 +0000 (01:06 +1300)] 
rrs/tools/common.py: ensure we pass a string to loadDataFull()

We're calling translate() on the string deep in the bowels of the
parsing code and that doesn't work well if the string is unicode, so
convert it to a plain string first. That won't work well if the filename
is unicode but the chances of that with a recipe is pretty small I would
think.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history.py: ensure we shut down tinfoil safely
Paul Eggleton [Mon, 26 Mar 2018 03:59:32 +0000 (16:59 +1300)] 
rrs_upgrade_history.py: ensure we shut down tinfoil safely

Use try...finally to ensure we shut down tinfoil, but since we are
potentially dealing with older bitbake releases when importing older
upgrades, only call shutdown() if it's actually there (and although it's
unlikely, guard against the broken shutdown() in fido as we do in the
main layer index update script).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history.py: enable to work across python2/3 versions
Paul Eggleton [Thu, 22 Mar 2018 12:30:56 +0000 (01:30 +1300)] 
rrs_upgrade_history.py: enable to work across python2/3 versions

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>
7 years agoMove run_command_interruptible() to utils
Paul Eggleton [Thu, 22 Mar 2018 12:27:16 +0000 (01:27 +1300)] 
Move run_command_interruptible() to utils

Make this function more easily reusable from the RRS code.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: run all tools scripts with python3
Paul Eggleton [Thu, 22 Mar 2018 02:39:22 +0000 (15:39 +1300)] 
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>
7 years agorrs: add breadcrumb to recipe detail page
Paul Eggleton [Wed, 21 Mar 2018 04:15:07 +0000 (17:15 +1300)] 
rrs: add breadcrumb to recipe detail page

Make it possible to get back to the maintenance plan from the recipe
detail page.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add titles to maintainers/recipes page
Paul Eggleton [Wed, 21 Mar 2018 03:54:31 +0000 (16:54 +1300)] 
rrs: add titles to maintainers/recipes page

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: handle dependency field differences
Paul Eggleton [Wed, 21 Mar 2018 03:52:49 +0000 (16:52 +1300)] 
rrs: handle dependency field differences

The old RRS branch had its own addition of dependency support, but in the
mean time we added that to the layer index in the master branch using a
different structure. Adapt the RRS recipe detail page to that structure.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoAdd link to maintenance plan in layer detail
Paul Eggleton [Wed, 21 Mar 2018 03:16:02 +0000 (16:16 +1300)] 
Add link to maintenance plan in layer detail

If the RRS is enabled, then add a way to get from the layer detail page
to any maintenance plans in which the layer is included.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: use default milestone instead of "All" for release drop-down
Paul Eggleton [Wed, 21 Mar 2018 01:48:08 +0000 (14:48 +1300)] 
rrs: use default milestone instead of "All" for release drop-down

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add maintenance plan selection
Paul Eggleton [Wed, 21 Mar 2018 01:36:33 +0000 (14:36 +1300)] 
rrs: add maintenance plan selection

Add a drop-down for selecting the maintenance plan from the recipes
page.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: replace fixtures with initial data migration
Paul Eggleton [Tue, 20 Mar 2018 20:51:11 +0000 (09:51 +1300)] 
rrs: replace fixtures with initial data migration

Fixtures aren't supported in current Django versions. Add some code to
the initial migration to add the data instead.

Also add releases/milestones up to and including 2.5.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/views: fix SQL parameter in get_reup_by_last_updated()
Paul Eggleton [Tue, 20 Mar 2018 03:37:19 +0000 (16:37 +1300)] 
rrs/views: fix SQL parameter in get_reup_by_last_updated()

We were passing in a parameter value but not using that in the query.
Add a WHERE clause to fix that.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/views: fix case in table names
Paul Eggleton [Tue, 20 Mar 2018 03:35:43 +0000 (16:35 +1300)] 
rrs/views: fix case in table names

Table names should be lowercase. I'm unsure if the collation settings
have an effect on this, but with the mariadb database I set up here I
needed to make this change or else I got errors about missing tables.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/models: handle All missing in milestones
Paul Eggleton [Tue, 20 Mar 2018 03:34:25 +0000 (16:34 +1300)] 
rrs/models: handle All missing in milestones

If we call objects.get() with no matching record then the result will be
an exception, not a null return, so handle that properly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: handle maintenance plans in views
Paul Eggleton [Fri, 2 Mar 2018 11:05:13 +0000 (00:05 +1300)] 
rrs: handle maintenance plans in views

Insert maintenance plan into views, their corresponding URLs and
templates.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upstream_email: Adapt to template rendering API change
Paul Eggleton [Tue, 17 Apr 2018 22:16:33 +0000 (10:16 +1200)] 
rrs_upstream_email: Adapt to template rendering API change

With Django 1.10+, if you use get_template() to retrieve a template,
then you can't pass a context when calling .render() on it, you need to
pass a dict instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upstream_email: rework
Paul Eggleton [Thu, 1 Mar 2018 20:09:35 +0000 (09:09 +1300)] 
rrs_upstream_email: rework

* Use maintenance plans to get layerbranches
* Use from/to/subject and admin contact from maintenance plan
* Use an actual template to render the email (and drop tabulate
  dependency)
* Improve grammar in the email text
* Use a single line to represent the most recent commit

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/models: add fields for more flexible email handling
Paul Eggleton [Thu, 1 Mar 2018 19:31:01 +0000 (08:31 +1300)] 
rrs/models: add fields for more flexible email handling

* Add a flag to say whether emails should be sent
* Add fields for from/to/subject (to replace what's currently in
  settings)
* Add user link for administrator to replace the hardcoded values in the
  email template

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: drop update_repo()
Paul Eggleton [Thu, 1 Mar 2018 04:30:42 +0000 (17:30 +1300)] 
rrs/tools: drop update_repo()

This function is no longer needed - we now rely upon the layer index's
code to do this (update through the update script, and checkout through
setup_layer()).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_distros: support maintenance plans and remove poky hardcoding
Paul Eggleton [Thu, 1 Mar 2018 04:22:39 +0000 (17:22 +1300)] 
rrs_distros: support maintenance plans and remove poky hardcoding

Remove hardcoded references to the poky repository, and process
layerbranches for all enabled maintenance plans.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: print debug message when parsing recipes
Paul Eggleton [Thu, 1 Mar 2018 04:15:00 +0000 (17:15 +1300)] 
rrs/tools: print debug message when parsing recipes

Without this it's not clear what's happening if debug mode is enabled
and you are waiting for the parsing step.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upstream_history: properly handle missing Recipe
Paul Eggleton [Wed, 28 Feb 2018 21:37:49 +0000 (10:37 +1300)] 
rrs_upstream_history: properly handle missing Recipe

If the Recipe object doesn't exist here then an exception will be raised
rather than None being returned, and this will also trigger if multiple
recipes match. This may have never triggered in the past because this
would have been run right after updating all the recipes in the layer and
clearing out duplicates (which we were doing earlier), and thus what is
in the database would match the recipe files in the repository, assuming
no errors occurred during parsing). We can't remove duplicates though so
we need to switch over to using filter() and taking the first recipe.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history: drop unused import
Paul Eggleton [Wed, 28 Feb 2018 21:37:32 +0000 (10:37 +1300)] 
rrs_upgrade_history: drop unused import

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upstream_history.py: support maintenance plans and remove poky hardcoding
Paul Eggleton [Wed, 28 Feb 2018 21:36:46 +0000 (10:36 +1300)] 
rrs_upstream_history.py: support maintenance plans and remove poky hardcoding

Remove hardcoded references to the poky repository, and process
layerbranches for all enabled maintenance plans.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upstream_history.py: drop threading
Paul Eggleton [Thu, 1 Mar 2018 03:33:58 +0000 (16:33 +1300)] 
rrs_upstream_history.py: drop threading

This is never going to work, the only way we can practically do parallel
execution is to run these things in a task which would basically amount
to distrodata's do_checkpkg; we may move to that in future but for now
just drop the threading code.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_maintainer_history.py: support maintenance plans and remove poky hardcoding
Paul Eggleton [Wed, 28 Feb 2018 20:10:20 +0000 (09:10 +1300)] 
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>
7 years agorrs/tools/common.py: import sys/os at top
Paul Eggleton [Thu, 1 Mar 2018 04:03:39 +0000 (17:03 +1300)] 
rrs/tools/common.py: import sys/os at top

These are common enough that they should be imported up front.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoutils: decode command output in runcmd() as UTF-8
Paul Eggleton [Wed, 28 Feb 2018 19:26:57 +0000 (08:26 +1300)] 
utils: decode command output in runcmd() as UTF-8

Sometimes we get back UTF-8 characters (particularly when picking up
names from git commits), and the ascii codec will error out if that
happens, so switch over to utf-8.

We can as a result remove the decode() calls from the bulk change view.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: fix model string representations for Python 3
Paul Eggleton [Tue, 27 Feb 2018 22:40:06 +0000 (11:40 +1300)] 
rrs: fix model string representations for Python 3

__unicode__ doesn't work anymore, we need to use __str__ for models
instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs_upgrade_history.py: add maintenance plan handling
Paul Eggleton [Tue, 27 Feb 2018 04:17:16 +0000 (17:17 +1300)] 
rrs_upgrade_history.py: add maintenance plan handling

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>
7 years agorrs/tools: avoid unnecessary checkouts
Paul Eggleton [Tue, 27 Feb 2018 04:16:12 +0000 (17:16 +1300)] 
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>
7 years agorrs: show full name in admin
Paul Eggleton [Tue, 27 Feb 2018 22:32:56 +0000 (11:32 +1300)] 
rrs: show full name in admin

It's neater to show "Recipe Reporting System" instead of "Rrs".

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add Release link to MaintenancePlan
Paul Eggleton [Tue, 27 Feb 2018 21:03:27 +0000 (10:03 +1300)] 
rrs: add Release link to MaintenancePlan

If any Releases exist then we create a default MaintenancePlan and then
link all Releases to it - this needs to be done in multiple upgrade
steps since the field needs to be non-null.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add maintenance plans
Paul Eggleton [Tue, 27 Feb 2018 04:15:32 +0000 (17:15 +1300)] 
rrs: add maintenance plans

The MaintenancePlan will provide some context for the RRS records so we
can effectively enable RRS functionality only on certain layers where we
want it. You can also consider the maintenance of multiple layers
together under a single plan if desired.

Here we add just the MaintenancePlan and the corresponding migration;
a non-null link from the Release requires a separate migration and thus
that will be done in a separate commit.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: add initial migration
Paul Eggleton [Tue, 27 Feb 2018 20:49:46 +0000 (09:49 +1300)] 
rrs: add initial migration

This is of course a new Django migration rather than the previous South
one. This will have to be applied using --fake-initial on a database
that already has the RRS tables.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs: drop old migrations
Paul Eggleton [Tue, 27 Feb 2018 04:21:34 +0000 (17:21 +1300)] 
rrs: drop old migrations

These south migrations aren't useful.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools: add dry-run option to each script
Paul Eggleton [Tue, 27 Feb 2018 03:14:43 +0000 (16:14 +1300)] 
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>
7 years agoUse this layer index's URL for layer branch
Paul Eggleton [Mon, 26 Feb 2018 20:57:58 +0000 (09:57 +1300)] 
Use this layer index's URL for layer branch

If we're integrating the layer index and the RRS, no need to jump off to
the OE index if for example this is an internal index.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoRename RRS URLs to have rrs_ prefix
Paul Eggleton [Mon, 26 Feb 2018 20:52:29 +0000 (09:52 +1300)] 
Rename RRS URLs to have rrs_ prefix

Make these distinct from the layerindex ones.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agoDrop "load url from future"
Paul Eggleton [Mon, 26 Feb 2018 20:46:08 +0000 (09:46 +1300)] 
Drop "load url from future"

This is no longer needed with current Django versions.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools/rrs_unique_recipes: drop
Paul Eggleton [Mon, 26 Feb 2018 20:40:19 +0000 (09:40 +1300)] 
rrs/tools/rrs_unique_recipes: drop

We can't just delete arbitrary recipes that do exist in the layer if
we're in a general layer index database. We'll need to handle this in a
different way, or just live with the fact that there will be duplicate
entries.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/models: move Raw class to views.py
Paul Eggleton [Mon, 26 Feb 2018 03:21:15 +0000 (16:21 +1300)] 
rrs/models: move Raw class to views.py

This is something that really belongs in with the views, so move it
there.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7 years agorrs/tools/rrs_{distros,upstream_history}: Add path for poky meta lib
Aníbal Limón [Tue, 22 Aug 2017 21:56:30 +0000 (21:56 +0000)] 
rrs/tools/rrs_{distros,upstream_history}: Add path for poky meta lib

Due to bitbake client/server changes now the meta path isn't included
to sys.path when load tinfoil.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>