summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
Commit message (Collapse)AuthorAgeFilesLines
...
* bitbake: toaster: use items and range instead of old APIsEd Bartosh2016-06-021-1/+1
| | | | | | | | | | | | Used items() and range() APIs instead of iteritems() and xrange() as latter don't exist in python 3 [YOCTO #9584] (Bitbake rev: 372dd3abcb201bd9ac2c3189c5505d3578ce0dd0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: get rid of using reduceEd Bartosh2016-06-021-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced compicated calls of reduce with more clear code. As reduce was removed from python 3 this change is mandatory for the code to work on both pythons. Here is an example change for illustration purposes: original code: querydict = dict(zip(or_keys, or_values)) query = reduce(operator.or_, map(lambda x: __get_q_for_val(x, querydict[x]), [k for k in querydict]))) replaced with: query = None for key, val in zip(or_keys, or_values): x = __get_q_for_val(k, val) query = query | x if query else x [YOCTO #9584] (Bitbake rev: 249d0bc6094ec9f369a02b78d8ed634a239e5ee4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use new syntax of except statementEd Bartosh2016-05-141-3/+3
| | | | | | | | | | | | | | | Used except 'except (<exception1>, <exception2>):' syntax as it's supported by python 2 and pythone 3. Old syntax 'except <exception1>, <exception2>:' is not supported by python 3. [YOCTO #9584] (Bitbake rev: d19e305ffa44a848b02ede63dc5de8d2640089e6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use 'in' instead of has_keyEd Bartosh2016-05-141-14/+14
| | | | | | | | | | | | | | | Dictionary method has_key is deprecated in python 2 and absent in python 3. Used '<key> in <dict>' statement to make the code working on both python 2 and python 3. [YOCTO #9584] (Bitbake rev: 3d7ad7ba0d1a6f688ae885817c049f2a8ced11b5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bin, toaster: Fix print and exception syntaxRichard Purdie2016-05-111-1/+1
| | | | | | | | | This updates the print "" syntax to print() and fixes some exception handling syntax such that its compatible with python v2 and v3. (Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add modal to select custom image for editingElliot Smith2016-04-191-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add functionality to the placeholder button on the build dashboard to open a modal dialog displaying editable custom images, in cases where multiple custom images were built by the build. Where there is only one editable custom image, go direct to its edit page. The images shown in the modal are custom recipes for the project which were built during the build shown in the dashboard. This also affects the new custom image dialog, as that also has to show custom image recipes as well as image recipes built during the build. Modify the API on the Build object to support both. Also modify and rename the queryset_to_list template filter so that it can deal with lists as well as querysets, as the new custom image modal has to show a list of image recipes which is an amalgam of two querysets. [YOCTO #9123] (Bitbake rev: 8c2aea3fa8e1071de60390e86e2536904fa9b7c0) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add build dashboard buttons to edit/create custom imagesElliot Smith2016-04-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a build is viewed in the dashboard, enable users to edit a custom image which was built during that build, and/or create a new custom image based on one of the image recipes built during the build. Add methods to the Build model to enable querying for the set of image recipes built during a build. Add buttons to the dashboard, with the "Edit custom image" button opening a basic modal for now. The "New custom image" button opens the existing new custom image modal, but is modified to show a list of images available as a base for a new custom image. Add a new function to the new custom image modal's script which enables multiple potential custom images to be shown as radio buttons in the dialog (if there is more than 1). Modify existing code to use this new function. Add a template filter which allows the queryset of recipes for a build to be available to client-side scripts, and from there be used to populate the new custom image modal. [YOCTO #9123] (Bitbake rev: 4c49ffd28e41c4597bdac34d5e54c125571a4b95) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: only prevent duplicate custom image names within a projectElliot Smith2016-04-191-15/+18
| | | | | | | | | | | | | | | | | | | | We currently prevent the same name being used for multiple custom images, but make the check across all projects. This means that custom image names have to be unique across all projects in the Toaster installation. Modify how we validate the name of a custom image so that we only prevent duplication of custom image names within a project, while ensuring that the name of a custom image doesn't duplicate the name of a recipe which is not a custom image recipe. [YOCTO #9209] (Bitbake rev: 9abbb46e799c06757e03addd54e3f5d3c0fe2886) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix sorting after hiding a column in build tablesElliot Smith2016-04-191-25/+25
| | | | | | | | | | | | | | | | | | | When hiding a column in the build tasks or build packages included table, if the column is set as the current order by for the table, the order by is not reset to the default. The result is that the table stays sorted by the hidden column. Set the default_orderby for these two tables correctly to ensure the corresponding table is re-sorted when a column is hidden, if that column was being used as the order by. [YOCTO #9011] (Bitbake rev: b99e1012f0ad1dc82a769df15a232280c8e57b9e) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: views jsunittest Add MACHINE and an extra layer to test ↵Michael Wood2016-04-061-4/+14
| | | | | | | | | | | | | | project Add set a MACHINE if needed and add a layer. When we're running in the context of the django unit tests we don't have these defaults setup for the project so add them. (Bitbake rev: a0c1432f32930a17e10d50c08c2aa84a0659514b) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: update view to support DL_DIR and SSTATE_DIRSujith H2016-04-061-2/+38
| | | | | | | | | | | | | | | | Update toaster's views.py to support DL_DIR and SSTATE_DIR for page projectconf.html. Removed DL_DIR and SSTATE_DIR from blacklist. Initial value of DL_DIR and SSTATE_DIR comes from BuildEnvironment. [YOCTO #8422] (Bitbake rev: 9f672d7ba503d17175eef37ec03a5779e4c9f792) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: get all dependents for pkg for removalDave Lerner2016-03-261-12/+79
| | | | | | | | | | | | | | | | | | | | | | | | For customised image package removal change behavior. From: Only display the immediate dependents of the requested package to remove, not the full dependent list, that is dependents of dependents ... Do not remove the displayed dependents, just notify the user of the list. To: Display the complete dependent tree, traversing all reverse dependencies starting from the package to be removed and then it's dependents. Change the modal dialog to note that all of these dependents will be removed automatically. [YOCTO #9121] (Bitbake rev: 1185a5bfe1b05a1b63a927c9583dfc031fdac8a9) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer nameMichael Wood2016-03-231-1/+1
| | | | | | | | | | | Use a constant to define the name for the toaster custom images layer; this constant is then used to identify this layer in various places. (Bitbake rev: 2540969ec71612af7f9041cadcc401513e9b357b) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: rework task buildstats storage and displayElliot Smith2016-03-091-20/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The data available from buildstats is now more fine grained than previously, so take advantage of that to enrich the data we save against tasks: * Store the CPU usage for user and system separately, and display them separately. * Disk IO is now measured in bytes, not ms. Also store the read/write bytes separately. * Store started and ended times, as well as elapsed_time. This will enable future features such as showing which tasks were running at a particular point in the build. There was also a problem with how we were looking up the Task object, which meant that the buildstats were being added to new tasks which weren't correctly associated with the build. Fix how we look up the Task (only looking for tasks which match the build, and the task and recipe names in the build stats data) so the build stats are associated with the correct task. [YOCTO #8842] (Bitbake rev: efa6f915566b979bdbad233ae195b413cef1b8da) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: views api Package info return both kinds of RDEPENDSMichael Wood2016-03-071-5/+4
| | | | | | | | | | | | | | As we do with the popover snippet which shows dependencies inline in the table also show dependencies which have both TYPE_TRDEPENDS and TYPE_RDEPENDS. Also remove obsolete comment (Bitbake rev: d3b5f3b7ba4550e7cd03a37ca19ccd2fc0042b2d) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fixup dependency excludes for customimageDave Lerner2016-03-071-0/+7
| | | | | | | | | | | | | | | [YOCTO #9156] For a customized image when adding a dependent package X that depends on dependency package Y, in addition to adding X to appends_set and Y to includes_set, make sure that Y is no longer in the excludes_set. Y may have been added to the excludes_set by a prior package removal. (Bitbake rev: 6b29d3297de2ae48a3ac5529ba0d22f895276b56) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: show suffix for image files and basename for artifact filesElliot Smith2016-02-261-1/+6
| | | | | | | | | | | | | | The build dashboard doesn't show image and artifact files correctly, as it shows the full filename for images and the filename plus path relative to DEPLOY_DIR for artifacts. Instead, show just the suffix for image files, and the basename for artifact files. (Bitbake rev: 8084dcdc283b4dc170f066c202f89d56ce1abbef) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: toastergui Fix invalid char test and implementationMichael Wood2016-02-191-2/+5
| | | | | | | | | | | | | This test was passing but because the assertion was the wrong way round and should have expected the first one to pass and second one to fail, in reality both were failing as the method for checking the invalid char was incorrect. (Bitbake rev: 932a92b8130d4815656dc885f0c6e4afa4502022) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Enable Image Customisation featureMichael Wood2016-02-101-1/+0
| | | | | | | | | | Remove environment variable to toggle Image customisation feature (Bitbake rev: 2e9c86229b8f924a5b62987f4b166f63392f12e8) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: xhr_customrecipe_packages Add dependencies to included ↵Michael Wood2016-02-101-0/+12
| | | | | | | | | | | | | | packages Add the dependencies of packages which are added to the CustomImageRecipe. Currently just handle the first tier of dependencies as this is what we show in the UI. (Bitbake rev: 5c44609a9bf9fb23241b7dd7c58b08901d75008d) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: API CustomImageRecipe check the recipe name supplied is validMichael Wood2016-02-101-0/+21
| | | | | | | | | | | | | Check that the name for a new CustomImageRecipe doesn't already exist in the project or in the database of existing recipes (e.g. from the layer index). Also restrict the characters entered for the recipe naming convention. (Bitbake rev: f290d428460a07e73050ff613bc222cc8c04f5ec) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: views CustomRecipe API add size information to the package ↵Michael Wood2016-02-101-2/+12
| | | | | | | | | | | | lists Add the file size of the packages and the total to the JSON response. (Bitbake rev: bbbd304c49b0940a695d15273934edff95d70836) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: move recent builds query to modelElliot Smith2016-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | The progress updater for the recent builds section makes a JSON call to the project view URL to get progress for each build. However, conversion of the builds pages to ToasterTable broke this, as the JSON response no longer contained the data necessary to populate the progress bars. Move the recent builds query to the Build model, so that it is accessible to the ToasterTables using it ("project builds" and "all builds"), as well as to the "project" view. Modify the code in the recent builds template to use the slightly different objects returned by the recent builds query on Build. (Bitbake rev: 5189252635ddc7b90c9a43aaed9f196c31e1dcad) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: xhr_customrecipe_packages add GET info for package responseMichael Wood2016-02-101-42/+98
| | | | | | | | | | | | | | Add response for GET to the xhr_customrecipe_packages ReST API /xhr_customrecipe/<recipe_id>/packages/<package_id> Thie response includes the id, name, version and dependency information for the package. (Bitbake rev: c45791fc85d26c43b0a3b0a459111d2ff5583540) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: xhr_customrecipe_id change to use CustomImagePackageMichael Wood2016-02-101-19/+23
| | | | | | | | | | | | | | Instead of doing a shallow copy of the package into the CustomImageRecipe when we add packages we can now use the CustomImagePackage as a M2M field on the Package to CustomImageRecipe. Also switch to using Target_Installed_Package as the method to retrieve the package list from the build. (Bitbake rev: 4ebc81823b3aec6ecf38835acad5263a81eb41c5) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: API allow CustomImageRecipe to be updated after creationMichael Wood2016-02-101-21/+35
| | | | | | | | | | | | | | | | | | | | When we create a CustomImageRecipe we create a Layer_Version and Recipe for that Recipe to be in, we only need one Layer_Version for our Recipes so if that Layer_Version is updated by building it we need a slightly more custom version of get_or_create to take into account the fields which we expect can change but still mean that the object we want is valid and doesn't need to be created. In the Recipe case this is when we're updating an existing CustomImageRecipe as we allow people to create a recipe even when the based on recipe hasn't been built so we need to update it once a build has happened. (Bitbake rev: 0fe2c72ab82c6de2825a390fbb460b892a7a9cfc) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: views xhr_customrecipe_packages clean up APIMichael Wood2016-02-101-14/+13
| | | | | | | | | | | | | | | - Fix generic variable names such as "object" and "values" when not needed. - Use try catch instead of a queryset filter to return the custom recipe object - Be explicit about the fields returned for the custom recipe info field - Remove redundant new_package field (Bitbake rev: a1a69903a94264377666730b1eb4599e6f3b4398) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: tables Add table for Packages and update SelectPackagesTableMichael Wood2016-02-101-9/+0
| | | | | | | | | | | | | Create a Packages table for use as the image details page. Change the SelectPackagesTable table to inherit from the Packages table. Remove the need for a separate view by adding the additional template context items to the Table's page context. (Bitbake rev: 336b1d8369d9e86ece78b63cb0e140e653216011) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: views Add view to download custom recipeMichael Wood2016-02-101-1/+14
| | | | | | | | | | | | View to provide the custom recipe download feature. The recipe is generated on-demand to make sure that it is the most current version of the Custom recipe. (Bitbake rev: 2101c854bb2d7ff1e3a4f00ad4d33d77859439ed) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: move CustomImageRecipe generation to API entry pointMichael Wood2016-02-101-14/+76
| | | | | | | | | | | | | | Use the CustomImageRecipe generate_recipe_file_contents to generate the recipe that we build from. Move creation of the dummy layer and recipe object to the point of recipe creation as we need these objects before the build time. Also update the methods to add and remove packages to account for the CustomImageRecipe inheriting from Recipe. (Bitbake rev: f3322567378d6038a00da0fab6c5641a1a8e5409) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: make artifact download more robustElliot Smith2016-01-181-56/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When an artifact download is requested, Toaster goes through a convoluted series of conditions to decide which file to push to the response. In the case of build artifact downloads for command line builds, this caused an ugly exception, as command line builds don't have a build request. To simplify and catch more corner cases, remove the code which fetches files via the build environment (we only support the local build environment anyway). Then push all requests along a single path, catching any missing file errors, missing object errors or poorly-formed URLs in a single except clause which always returns a valid response. Also modify the text on the "unavailable artifact" page so it says that the artifact doesn't exist, rather than it "no longer" exists (exceptions may occur because an invalid artifact was requested, rather than an artifact which was removed). [YOCTO #7603] (Bitbake rev: 24e20db55c2933de5e58ca754b8fd5b624f47820) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: code formatting and clean-upElliot Smith2016-01-151-3/+2
| | | | | | | | | | | Minor fixes to code formatting and small improvements from code review. (Bitbake rev: 2c97f3a5c6ae37de910deb90390c5b856a600c5f) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: remove unused views and template codeElliot Smith2016-01-151-430/+0
| | | | | | | | | | | | | | | | The code in views.py for setting up the template context for old non-ToasterTable views is no longer necessary, as this is now implemented in tables.py. The template files for these views have also been removed. [YOCTO #8738] (Bitbake rev: 2b5a13afb068c85466436914d8d4ac3b31bc5c02) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: serialise decimals correctlyElliot Smith2016-01-151-0/+3
| | | | | | | | | | | | | | | | The conversion of some ToasterTable Build object querysets to JSON caused a serialisation error. This is because one of the fields in the queryset was of type decimal.Decimal, and our serialiser didn't know what to do with it. Add a clause to check for decimal fields and serialise them so that correct JSON can be generated. (Bitbake rev: fa6229d4edf5904ccaa9dc323d0ab2318d1ef314) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: convert project builds page to ToasterTableElliot Smith2016-01-151-7/+9
| | | | | | | | | | | | | Use the all builds ToasterTable as the basis for the project builds ToasterTable. [YOCTO #8738] (Bitbake rev: 87bcfb740dd2d9944e35a2a1f71cbf8ff3b266e9) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: convert all builds page to ToasterTableElliot Smith2016-01-151-32/+0
| | | | | | | | | | | | | | | | For better long-term maintainability, use ToasterTable instead of Django template and view code to display the all builds page. NB the builds.html template has been left in, as this will otherwise cause conflicts when merging the new theme. [YOCTO #8738] (Bitbake rev: e0590fc8103afeb4c5e613a826057555c8193d59) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui: switch projects/ view to ToasterTableElliot Smith2016-01-151-4/+20
| | | | | | | | | | | | | | | | | | | | | Remove the old projects page and replace with the new ToasterTable-based version. NB although the projects.html template is no longer required, it's been left in as there will be changes applied to it for the new theme. These changes will have to then be transferred from the projects.html template to projects-toastertable.html. Similarly, the code for the projects page in views.py has been retained. [YOCTO #8738] (Bitbake rev: ebe7831ef65e78a9d100f29a63311518577fc838) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: check inferred file suffixes against list of known typesElliot Smith2016-01-151-34/+4
| | | | | | | | | | | | | | | | | | | | | | | | The algorithm for finding the suffix for image files produced by the build doesn't reference a list of known file suffixes, so could be prone to error. Modify how file suffixes are parsed from the file path so that they are compared against a list of known types; if this fails, use the part of the basename of the file path after the first '.' character. Also rationalise the places in the views code where we extract the file name extensions for builds, so they both use the same algorithm (before, the same code was duplicated in two places). [YOCTO #8417] (Bitbake rev: dd1c509696b8ab5e593cc64637060a58e95fcd1f) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: move image file suffix list to modelElliot Smith2016-01-151-6/+1
| | | | | | | | | | | | | | | | | | | | | Image file suffixes are used in the project configuration page to show a list of available image file types. This list is stored as a function in the views code. However, this list is also needed when parsing image file paths, so that the suffixes can be shown in the "all builds" and "project builds" tables. Move the list of valid image file suffixes to the Target_Image_File class to make is accessible in other places where it may be needed. [YOCTO #8738] (Bitbake rev: c2f20232077917552623fd0726d0820e50b04cae) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Remove compatible_layerversions() methodElliot Smith2015-12-141-8/+14
| | | | | | | | | | | | | | | | | Remove compatible_layerversions() and replace calls to it with calls to get_all_compatible_layer_versions(). The sorting done in compatible_layerversions() is not relevant, and the code can be simplified by using get_all_compatible_layer_versions(). [YOCTO #8364] (Bitbake rev: 7bca51277314f7c0b6ee0e0d470327dfd60d37fe) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Create default project with get_or_create* methodElliot Smith2015-12-141-1/+1
| | | | | | | | | | | | | | | | Rather than maintain data as part of the migrations (as was done for the default project previously), create the default (cli builds) project on demand as a by-product of getting it from the database. [YOCTO #8364] (Bitbake rev: 5fd8e90ab9b81d1bd0d301bc1c91228ecbbea74b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: remove SDKMACHINE from project variablesEd Bartosh2015-12-071-9/+0
| | | | | | | | | | | | | | | | | | | Removed SDKMACHINE from predefined set of variables for the project as it causes bitbake build error: SDKMACHINE is set, but SDK_ARCH has not been changed as a result This variable does not need to be predefined as it's not used by toaster. It's still possible to specify it in project configuration if needed. SDK_ARCH variable should be set too to avoid above mentioned build failure. (Bitbake rev: a6ab2a38ab666376b4a5e796d3a88929e8cbfb22) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: remove usage of BUILD_MODE variableEd Bartosh2015-12-071-20/+0
| | | | | | | | | | | | | As both modes can be used at the same time we can't have any difference in UI between modes. Removed all conditional statements that used BUILD_MODE. (Bitbake rev: 4ce1559c2558bd0fd278ff02a1a93bec03c4156b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: templates Add meaningful title tagsBelen Barros Pena2015-10-291-1/+1
| | | | | | | | | | | Our title tags are all over the place, and have no relation to the page content. This commit adds a meaningful title tag to each Toaster page. (Bitbake rev: 1ab8827d684a19a70f3b788aed2327bf30edffe2) Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Remove all navigation when not in build modeElliot Smith2015-10-271-2/+12
| | | | | | | | | | | | | | | | | | | | | | The user is redirected to the all builds page or all projects page from the landing page, regardless of mode. In build mode, this makes sense; but in analysis mode, we are restricting the view to just the cli builds project. This means that "all projects" and "all builds" only contains items relating to this one project. Modify the landing page so it redirects to the project builds page for the cli builds project when not in build mode. Also remove navigation elements which are irrelevant when not in build mode. [YOCTO #8514] (Bitbake rev: ae754655fa1bc5168f43e8821773e7b7b9440a5d) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Hide builds for non-cli projects in analysis modeElliot Smith2015-10-271-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | The "latest builds" sections of the "all builds" page show builds for all projects. This is not appropriate for analysis mode, where we can only affect the command-line builds project. Modify the "latest builds" section to only show builds for the command line builds project if in analysis mode. Also rationalise where we get the queryset of latest builds from: we have a _get_latest_builds() function which was being used to get the latest builds in most places, but not all. Also modify _get_latest_builds() to sort by started_on, rather than primary key, as assuming that a higher primary key value equates with later start time is incorrect. [YOCTO #8514] (Bitbake rev: 52de2c8cd11fa743f8fd7cb0cf776eea622ac474) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Add BUILD_MODE flag to contextElliot Smith2015-10-271-0/+4
| | | | | | | | | | | | | | | | | | | | We set a TOASTER_MANAGED env variable in the startup script, which has a value of "1" if Toaster should run in build mode. Add a BUILD_MODE variable to settings.py which is True if TOASTER_MANAGED is set to "1", False otherwise. Add this to the context for every template, so we can use this information to conditionally alter the content of pages according to the mode we're in. [YOCTO #8514] (Bitbake rev: f9cf4739fc85c9760ce748323dc7c8de3fa7eaec) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Modify "New build" button behaviour for cli builds projectElliot Smith2015-10-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The "New build" button should only be displayed if there are user-generated projects, not if there is only the command-line builds project. (Toaster can't run builds on behalf of the command-line builds project.) The "New build" form should also display as if no project has been set (i.e. show the project and recipe text entries). Add a variable which tracks the number of non-command-line projects, then use this to hide the button when appropriate. Also track whether the current project is the default one, and use this to add extra conditions to when the "New build" text entries are shown. [YOCTO #8231] (Bitbake rev: 07e7bc29a7d976941eeae997f78a25ed6edddfc8) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Fix missing tooltips from layers on project configuration pageMichael Wood2015-10-131-6/+10
| | | | | | | | | | | | | | | | | | Re-enable the layer tooltips on the project configuration page. This adds the required fields to the API used for the layer dependencies to be able to show the metadata needed. Also fixes link hrefs which were missing in the add layers confirmation dialog (bug 8251). [YOCTO #8295] [YOCTO #8251] (Bitbake rev: c7cb8255d0ab1fd7715e878c1c83ef0cd920387e) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use get_alldeps in layerdetails rendererEd Bartosh2015-10-121-2/+2
| | | | | | | | | | | | | Used Layer_Version.get_alldeps api in layerdetails template renderer to get list of layer dependencies. [YOCTO 8004] (Bitbake rev: 077d0f41a3bd9cf2802a1488f1d6156ccac7df1d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>