Commit Graph

69 Commits

Author SHA1 Message Date
Paul Eggleton
2da4f5d99b 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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
009adcb8df 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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
a6aaa5c8ef 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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
ebceecb7fd 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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
ea6270f386 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>
2018-05-04 23:57:53 +12:00
Paul Eggleton
bc26b95d0b Explicitly handle too-long field values
If you use a traditional database engine (such as MySQL/MariaDB) then
maximum character field lengths are enforced, however depending on the
configuration this may result in an exception rather than a warning and
truncation and will also break the per-layer transaction. To avoid that
ugliness, add a signal handler to do it internally, which as a bonus
lets us know if field lenghts are too short for data when using database
engines that don't enforce lengths (e.g. SQLite).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-01-09 17:13:11 +13:00
Amanda Brindle
51e83c8d31 update_layer.py: Save and show recipe dependencies
Added a model for the PACKAGECONFIG variable, which has a one to
many relationship with the Recipe model.

Added models for static build dependencies and dynamic build
dependencies, both of which have a many to many relationship with
the Recipe model.

These objects are created in update_layer.py and are displayed on the
Recipe detail page.

Added a depends search option for recipes, allowing users to search for
recipes that depend on any particular recipe. Use "depends:recipename"
in the recipe search to activate this.

Fixes [YOCTO #12129]
Fixes [YOCTO #11415]

Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-12-18 09:01:29 +13:00
Paul Eggleton
f7950b885c models: allow LayerBranch.collection to be blank
It's really irritating to be forced to specify a value for this field
especially as it'll get auto-populated by the update script. Set
blank=True to allow that. While we're at it, touch up the description a
bit to make more sense.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-10-04 13:28:24 +13:00
Amanda Brindle
fdcde00710 Indicate if layer has YP Compatible certification
Allow admin to create Yocto Project versions with the version name,
description, an icon link that represents that version, and a link that
contains more information about the version.

Admins who have the "set_yp_compatibility" permission can then
decide if a layer has Yocto Project compatible certification,
and if it does, admin can choose which version of Yocto Project
the layer is compatible with. If a layer is deemed compatible,
the version's icon will appear next to the layer's name, and
the icon be a clickable link to a page with more information.

Fixes [YOCTO #11452]

Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-09-27 15:26:24 +13:00
Paul Eggleton
51614fe5a0 layerindex: add "No update" status to LayerItem
Add a status for a layer indicating it should not be updated. I don't
expect this to be widely used (and is only settable from the admin
interface) but would be useful if you have a legacy sub-layer that you
want to prevent from being visible on certain branches - it will prevent
the update script from doing anything with the layer and thus avoid
branch records from being auto-created on branches where you've deleted
it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-03-14 15:19:53 +13:00
Paul Eggleton
b91b09a0ae models.py: minor branch tweaks
Make minor (non-structural) improvements to the model, mostly for the
benefit of the admin interface:

* Set default ordering so that branches appear in the same order they do
  in the user-facing drop-down
* Include the description in the default string representation (so you
  know which branch name matches with which Yocto Project version, in
  the OE index).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-03-07 09:22:14 +13:00
Paul Eggleton
43203c578c Record and display update logs
At the moment it's a bit difficult to get update logs out of the
environment in which the update script is being run. In order to make
the logs more accessible, create a LayerUpdate model to record the
output of update_layer.py separately for each layerbranch and tie the
created LayerUpdates together with a single Update model per session.

We provide two ways to look at this - a Tools->Updates page for
logged-in users, and there's also an "Updates" tab on each layer that is
accessible to anyone; which one is useful depends on whether you are
looking at the index as a whole or an individual layer.

Update records older than 30 days are deleted automatically by default.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-11-16 15:31:46 +13:00
Paul Eggleton
7ddf8f58d6 recipedetail: don't show homepage as link if not URL
Sometimes people put values that aren't URLs into the HOMEPAGE variable.
If that's the case, then we should not turn that value into a link which
will be invalid.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-10-26 15:41:32 +13:00
Liam R. Howlett
61845b7465 layerindexer: Add layer recommends support
Parse layer.conf and add dependencies that are not required from
LAYERRECOMMENDS_<name>.  Update the layerindex/template to support
recommends.  Uses bitbake parsing code & checks versions.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>

Added associated migration.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-10-18 16:42:16 +13:00
Liam R. Howlett
65f0b71ade layerindex: Add collection and version to layerbranch
Collection and version will be pulled from the layer.conf if it exists
and dependencies will be resolved by first checking for layers with the
dependency name and then checking for collections.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>

Added associated migration.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-10-18 16:42:16 +13:00
Liam R. Howlett
31c85196d0 layerindex: Add distro to web interface and model
Add the distros to the index.  This looks a lot like the machines
and allows users to search for a particular distro.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>

Added associated migration.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-10-18 16:42:15 +13:00
Paul Eggleton
76a1ab669a Fix not null error on database migration
The updated field on the branch table was not null and this breaks the
fixture. It's too painful to specify a value for a datetime field in a
fixture json file and it wouldn't even make sense to specify a value in
this case anyway, so just allow the field to be null.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-07-01 16:45:24 +12:00
Paul Eggleton
8c50585728 Preemptive auto_now fix for Django 1.8
Django 1.8 does not allow DateFields that have both auto_now and default
set - since they are mutually exclusive; if you have auto_now you don't
need a default.

Part of the implementation for [YOCTO #9620].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-12 11:33:08 +12:00
Paul Eggleton
fa3ff04095 Handle Python 2 and Python 3 branches in the same index
Add a model to support setting a python command and virtualenv per
branch, which allows you to parse master with python3 and krogoth with
python2 for example.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-12 11:33:08 +12:00
Paul Eggleton
29c6458dca Support (and require) Python 3
We need to be able to support Python 3 so that we can parse master of
OE-Core with bitbake (which now requires it). This now means the
interface itself and the update script require Python 3.4+.

Part of the implementation for [YOCTO #9704].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-12 11:33:08 +12:00
Paul Eggleton
18d8267da3 Increase size of Recipe provides and license fields
Fix "data truncated" warnings/errors when loading data for OE-Core:
* PROVIDES for recipe packagegroup-base is ~1452 characters
* LICENSE for recipe linux-firmware is ~1053 characters

(These aren't shown with SQLite, only with something like MariaDB where
column sizes are enforced.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-12 11:33:08 +12:00
Paul Eggleton
bf94b2f7e9 update.py: allow updating all branches with one command
Allow updating multiple branches, and if no branches are specified,
update all branches that have a new "updates_enabled" flag field set to
True. This avoids the need to have a separate shell script which runs
update.py for each branch (and thus has hardcoded knowledge of each
active branch in the index, i.e. it needs to be kept up-to-date in
addition to the database.)

The migration will default updates_enabled to True for all branches so
if you wish to take advantage of this functionality, the flag will need
to be set to False for any branches that shouldn't be updated.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-10 06:55:26 +12:00
Paul Eggleton
48c0839482 Allow blanking out field values in bulk change
If you're moving a short description value from DESCRIPTION to SUMMARY
then part of that is setting DESCRIPTION to blank, however that wasn't
possible - the code was assuming that a null value meant "keep the
original value". Change the logic so that the value in the bulk change
object is always set and is compared to the original value to see if it
is different. This provides less safety against bulk change data going
stale in the face of the metadata being updated, but without using an
additional "magic" field value that's the price we have to pay, and it's
unlikely to bother too many people I would imagine.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-05-30 16:01:42 +12:00
Alex Franco
50eef9b55a Display recipe blacklist information
Display blacklist information for recipes in the recipe details,
as well as the recipe search page, and layer page tables. This
information is pulled from the PNBLACKLIST variable. Includes a
hover text containing the reason for blacklist labels.

Changes to Django and Layerindex files:
- models.py, update.py
- migration file
- templates and static content (stylesheet)

[YOCTO #7855]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-05-24 14:22:58 +01:00
Alex Franco
fd63761d2a Support for recipe inherits field
To identify image recipes and provide inheritance data for recipes, an
inherits field was added to the recipe model, and then populated using
refactored data from __inherit_cache. Finally the field was also added
to page templates, along with style changes proposed in attachment, and
an additional style change to display the inherits field as a list in
detailed view. The field skips globally inherited data as proposed.

[YOCTO #7575]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2015-10-07 11:34:28 +01:00
Aníbal Limón
6ac4e8fbb5 layerindex/models.py: Branch model fix inital_data fixture
Add default = datetime.now attr to updated field of Branch
model because it fails when try to insert inital data with NULL.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2014-12-22 00:29:23 +00:00
Alexandru DAMIAN
40d05f928c adding updated field for certain models
We add an automatically-updateing "updated" datetime
field to Branch, LayerItem, LayerBranch, Recipe and
Machine models to allow date-based incremental updates
through the API.

The added field does not interfere with the existing
form-based pages (auto_now sets editable to false).

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-09-24 11:32:34 +01:00
Paul Eggleton
bbbf5e9939 Handle % characters in URLs
If there is a % character in the path to a file / directory, we need to
properly encode it when creating the repo web URL or the link won't
work. Thanks to Khem Raj for reporting this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-05-12 14:15:31 +01:00
Paul Eggleton
f7fa15dd36 Allow layers to have no master branch
With BSPs being "retired" e.g. in meta-intel, it is possible for layers
to not exist on the master branch; since this is legitimate we need the
layer index to handle it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-04-06 15:01:24 +01:00
Paul Eggleton
cd26148eed Fix append list name matching
* Recipes without versions in the file name (such as alsa-state.bb)
  weren't having their bbappends listed. Use a regex match to fix this.
* Use the prefix from the filename instead of PN, since that's how
  BitBake does it
* List version matching bbappends first, then non-matching in muted
  colour

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-09 20:58:24 +00:00
Paul Eggleton
dcd312b9fb Fix tree link on layer list for layers with no subdirectory
We always need to replace %path% in the URL, not just when there is a
non-blank path to replace it with.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-13 11:39:13 +01:00
Paul Eggleton
157e377d00 Use actual_branch in URLs if available
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
1643aef67d Navigation improvements
* Drop the front page - this just gets in the way. Redirect to the
  layers list instead. This has meant adding a touch more text to the
  about page and adding the FAQ link to the footer.
* Use a separate navbar to hold the branch selector and the main
  top-level  pages (Layers, Recipes, Machines) instead of tabs
* All pages depending on a branch selection are now under
  branch/<branchname>/ so we don't need to have the branch selection on
  every page.
* Use breadcrumbs on recipe detail and layer detail pages instead of
  tabs
* Add title to recipe detail page

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
c3a8eb4d82 Add support for importing OE-Classic recipes
Add a script for doing a one-time import of OE-Classic recipe
information, so comparisons against OE-Core can be performed; this
is stored using a new ClassicRecipe model supporting additional fields
for tracking migration status. The migration status fields can be
updated as well as viewed and summarised in graph format.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:22 +01:00
Paul Eggleton
84709dbca6 Add recipe bulk change feature
This provides a way to set "meta" fields (SUMMARY, DESCRIPTION,
HOMEPAGE, BUGTRACKER, SECTION, and LICENSE) for a number of recipes at
once, and then download those changes in the form of one or more patch
files which can be submitted for merging into the layer.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-08-11 11:28:14 +01:00
Paul Eggleton
8be1adddb6 Add actual_branch field to layerbranch
Some layers don't use the conventional branch name (i.e. the same name
as the core branch). Add a field so we can record the actual branch name
and use this within the update script.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-06-17 21:11:58 +01:00
Paul Eggleton
9af1144928 Collect bbappends and bbclasses for each layer
Collect bbappend/bbclass info during the update process and display it
on the layer detail page.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-06-17 21:11:53 +01:00
Paul Eggleton
38e8791c21 Collect BUGTRACKER, PROVIDES and BBCLASSEXTEND for each recipe
* Show BUGTRACKER in the recipe detail page if set
* Track the other two variables for possible future use

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-06-03 10:59:10 +01:00
Paul Eggleton
e72a33e16a Add preference order field
Add an index_preference field to enable control over which layer's
duplicate recipes get de-emphasised in the recipe search results.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-06-03 10:59:10 +01:00
Paul Eggleton
9df79fe0ef Sort recipes by PN and descending PV in layer list
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-05-07 12:13:14 +01:00
Paul Eggleton
b3a8b19eb4 models: add layer name to string representation of layer note
This includes the layer name in layer note additions/changes in the
history page, among other places.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-04-02 12:25:26 +01:00
Paul Eggleton
979fb7980d Fix "AnonymousUser has no attribute 'email'" errors when not logged in
We shouldn't be looking for this attribute unless the user has logged in
- this was a regression in the recent email case fix.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-28 21:39:00 +00:00
Paul Eggleton
665e40e2c5 Ensure user_can_edit email address check ignores case and spaces
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-28 12:10:28 +00:00
Paul Eggleton
333ee2a94e Improved fix for ../ in usage URL
This actually works for complex URLs since we normalise just the path
portion that we are adding instead of trying it on the URL after
composing it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-27 16:17:49 +00:00
Paul Eggleton
2804211f8f Fix web subdirectory links with gitweb
gitweb, ever vigilant for the slightest transgression in URL syntax,
fails to find the specified path if it is a directory and has a trailing
slash, so we need to avoid adding this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-27 16:02:28 +00:00
Paul Eggleton
cd7e00bf57 Allow ../ in usage URL field
Allow using e.g. ../README to point to README file in the parent of the
repository subdirectory.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-27 16:01:24 +00:00
Paul Eggleton
a7323361ff Bump up some of the field lengths
Avoid truncation for slightly longer fields (as happened with PN and
SUMMARY when importing some existing layers).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-27 09:34:56 +00:00
Paul Eggleton
f17c5cf04f Move fetch dir calculation to model
This makes it easier to get this directory name outside of the update
script.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-20 15:41:58 +00:00
Paul Eggleton
0a1215e59e Move repo subdirectory to layerbranch
So it turns out that one or two layers have changed in structure between
branches, so we need to be able to specify this on a per-branch basis.
Good times...

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-20 15:41:58 +00:00
Paul Eggleton
af499c0d99 Add sort priority field to branch model
This enables sorting the branch drop-down in a configurable manner (e.g.
so that you can have them in order from newest to oldest).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 22:56:31 +00:00