aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/models.py
AgeCommit message (Collapse)Author
2018-05-04rrs: default python2/3 environments for new maintenance plan layer branchesPaul Eggleton
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>
2018-05-04Implement patch trackingPaul Eggleton
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-04models: implement layerindex method to get recursive dependenciesPaul Eggleton
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-04Implement layer web repo commit URLPaul Eggleton
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-04Save recipe source URLsPaul Eggleton
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-04rrs: handle dependency field differencesPaul Eggleton
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-01-09Explicitly handle too-long field valuesPaul Eggleton
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>
2017-12-18update_layer.py: Save and show recipe dependenciesAmanda Brindle
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-10-04models: allow LayerBranch.collection to be blankPaul Eggleton
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-09-27Indicate if layer has YP Compatible certificationAmanda Brindle
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-03-14layerindex: add "No update" status to LayerItemPaul Eggleton
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-07models.py: minor branch tweaksPaul Eggleton
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>
2016-11-16Record and display update logsPaul Eggleton
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-10-26recipedetail: don't show homepage as link if not URLPaul Eggleton
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-18layerindexer: Add layer recommends supportLiam R. Howlett
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-18layerindex: Add collection and version to layerbranchLiam R. Howlett
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-18layerindex: Add distro to web interface and modelLiam R. Howlett
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-07-01Fix not null error on database migrationPaul Eggleton
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-06-12Preemptive auto_now fix for Django 1.8Paul Eggleton
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-12Handle Python 2 and Python 3 branches in the same indexPaul Eggleton
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-12Support (and require) Python 3Paul Eggleton
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-12Increase size of Recipe provides and license fieldsPaul Eggleton
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-10update.py: allow updating all branches with one commandPaul Eggleton
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-05-30Allow blanking out field values in bulk changePaul Eggleton
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-24Display recipe blacklist informationAlex Franco
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>
2015-10-07Support for recipe inherits fieldAlex Franco
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>
2014-12-22layerindex/models.py: Branch model fix inital_data fixtureAníbal Limón
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-09-24adding updated field for certain modelsAlexandru DAMIAN
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-05-12Handle % characters in URLsPaul Eggleton
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-04-06Allow layers to have no master branchPaul Eggleton
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-03-09Fix append list name matchingPaul Eggleton
* 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>
2013-09-13Fix tree link on layer list for layers with no subdirectoryPaul Eggleton
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-05Use actual_branch in URLs if availablePaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05Navigation improvementsPaul Eggleton
* 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-05Add support for importing OE-Classic recipesPaul Eggleton
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-08-11Add recipe bulk change featurePaul Eggleton
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-06-17Add actual_branch field to layerbranchPaul Eggleton
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-17Collect bbappends and bbclasses for each layerPaul Eggleton
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-03Collect BUGTRACKER, PROVIDES and BBCLASSEXTEND for each recipePaul Eggleton
* 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-03Add preference order fieldPaul Eggleton
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-05-07Sort recipes by PN and descending PV in layer listPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-04-02models: add layer name to string representation of layer notePaul Eggleton
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-03-28Fix "AnonymousUser has no attribute 'email'" errors when not logged inPaul Eggleton
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-28Ensure user_can_edit email address check ignores case and spacesPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-03-27Improved fix for ../ in usage URLPaul Eggleton
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-27Fix web subdirectory links with gitwebPaul Eggleton
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-27Allow ../ in usage URL fieldPaul Eggleton
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-27Bump up some of the field lengthsPaul Eggleton
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-20Move fetch dir calculation to modelPaul Eggleton
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-20Move repo subdirectory to layerbranchPaul Eggleton
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>