Commit Graph

52 Commits

Author SHA1 Message Date
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
Paul Eggleton
4be747582f Add a short description for branches to show in drop-down
Allows you to add e.g. "old stable" next to the denzil branch for
clarification.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-06 18:31:02 +00:00
Paul Eggleton
3f967cf751 Allow usage URL to point to a file within the repository
This means the usage URL can point to a file whose contents may be
different per branch (e.g. a README file).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-05 20:37:49 +00:00
Paul Eggleton
354e368aa2 Add support for handling multiple branches
Change the data structure to support multiple branches. At the top level
there is a set list of Branch objects, and then a LayerBranch object
between each layer and the maintainers, dependencies, recipes and
machines, so that the set of each can be different per branch. The
branch is a session option, and can be selected via a drop-down that is
shown for all pages.

Additionally, with this change we avoid the need to run the update
script within a build environment set up with oe-init-build-env - since
we need a specific version of BitBake per branch we now use our own copy
of BitBake which is fetched by the script itself. The update script will
need to be called multiple times however - once per branch.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-05 20:37:48 +00:00
Paul Eggleton
26ab9dbb28 Add ability to add, edit and delete layer notes
This allows adding an important notice to a layer e.g. "this layer is
deprecated, please use layer xyz instead". Only one layer note can be
added through the interface although the data structures allow multiple,
so notes may be added programmatically without disturbing user-added
ones.

With this change we also add a get_absolute_url() function to the
LayerItem model and change the calls to reverse() for layers to use it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-28 14:36:41 +00:00
Paul Eggleton
3f60b3fba3 Improve detail page for unpublished layers
* Add a label making it clear the layer is unpublished
* Hide recipes list header since there should never be any recipes (as
  the update script doesn't process unpublished layers)
* Add test links for base URLs

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 12:10:49 +00:00
Paul Eggleton
c40bfedd4a Implement editing of layers
Allow users with publish permission to edit any layer, and users with
the same email address as one of the maintainers of a layer to edit that
layer.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-27 10:34:02 +00:00
Paul Eggleton
431f2fba17 Add javascript code to split name/email pairs in maintainer fields
In the submit layer form, if a user pastes/types in a name/email pair
(e.g. My Name <my.email@example.com>) then this will automatically be
split into the name and email input fields, saving the user from doing
this by hand (since this is a common notation within repositories and
documentation.)

Additionally, if there is any text after the email address then move it
into the responsibility field unless the responsibility has been entered
by the user.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 15:35:41 +00:00
Paul Eggleton
4756fed86f Drop created_date field from LayerItem
We have django-reversion to handle auditing/history now so we don't need
an explicit field to hold the creation date.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 14:59:26 +00:00
Paul Eggleton
e0f8a05423 Handle updating of inc files/classes within same layer
If we aren't doing a full refresh, when changes to an included/required
file or an inherited class occur we need to update all of the files that
depend on them. BitBake records these dependencies, so read them and
record them against each recipe.

At the moment this only handles dependencies within the same layer; that
is probably sufficient to handle most changes for the purposes of
extracting the data this application cares about. A future improved
solution will probably involve making use of BitBake's cache rather than
and parsing all layers and their dependencies rather than individual
recipes.

This change also adds -x/--nofetch and -n/--dry-run options for
debugging as well as some further debug messages.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-26 11:05:43 +00:00
Paul Eggleton
d8c6824f30 Add help text to model fields
Add some explanatory help text which can be used in the submission form.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-25 10:13:05 +00:00
Paul Eggleton
e4eb8213cf Collect machine information from layers
Look for conf/machine/*.conf and add a record for each file found. These
are displayed in the layer detail page if any are present.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-24 23:14:53 +00:00
Paul Eggleton
355c92cfe7 Add mailing list field to layer
Enable recording the mailing list associated with each layer, if any.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 23:48:06 +00:00
Paul Eggleton
8b742732d8 Clarify BSP layer type description
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 22:48:49 +00:00
Paul Eggleton
6cd47bdd82 Handle web interfaces with different URL schemes
Some git web interfaces use different paths for files (blobs) and
directories when it comes to browsing; this means we need to have a
separate field for the base URL for files.

Additionally, Gitweb typically puts the path within the URL instead of
at the end (although the parameters can be reordered) and cannot handle
the file parameter (f=) being specified with no value. So, to add some
flexibility, add the ability to use a positional macro %path% to
optionally specify where to put the path. If needed, square brackets
can be used in conjunction with %path% to exclude parts of the string
when there is no path, i.e. we want to browse the root. For example, the
following base URL:

  http://git.example.com/?p=somerepo.git;a=tree;[;f=%path%];hb=HEAD

would be translated to this with a path of "path/to/dir":

  http://git.example.com/?p=somerepo.git;a=tree;f=path/to/dir;hb=HEAD

and this if no path were specified:

  http://git.example.com/?p=somerepo.git;a=tree;hb=HEAD

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 20:33:24 +00:00
Paul Eggleton
4fef5c0c8e Don't default layer type in submit layer form
We want to force selection of a specific layer type, otherwise many
submitters will just leave it at the default value.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-23 16:44:59 +00:00
Paul Eggleton
05ceb17487 Admin interface improvements
* Set custom title for admin pages
* Use reasonable field widths on editing pages
* Allow filtering and searching by useful fields
* Disable editing of recipe records
* Disable editing of layer fields set by the update script
* Show "Layers" instead of "Layer items" for layers
* Show "Layer dependencies" instead of "Layer dependencys"
* Show layer name in maintainers listing

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-19 12:02:04 +00:00
Paul Eggleton
dc4494aa8a Return blank URL for recipe file if layer's web tree base URL is not set
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-02-18 16:00:43 +00:00