summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: toaster: replace map with list comprehensionsEd Bartosh2016-05-161-1/+1
| | | | | | | | | | | | | map returns map object in python 3. Replaced calls of map to equivalent list comprehensions in the code which requires lists. [YOCTO #9584] (Bitbake rev: 49d9cf1040e1659350eeaf6db4c40dc4c9bf7e50) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use items and range instead of old APIsEd Bartosh2016-05-161-1/+1
| | | | | | | | | | | | Used items() and range() APIs instead of iteritems() and xrange() as latter don't exist in python 3 [YOCTO #9584] (Bitbake rev: f44986d41055ce7fa3128e1acb6968f9ccc355ba) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use decode('utf-8') for binary dataEd Bartosh2016-05-161-1/+1
| | | | | | | | | | | | | Decoded binary data to utf-8 to fix the following error when runnign on python 3: TypeError: Type str doesn't support the buffer API [YOCTO #9584] (Bitbake rev: 49c203bfe4083122d2954a97b4f8bb7959711a19) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix imports to work for python 3Ed Bartosh2016-05-161-4/+12
| | | | | | | | | | | | | | | | | | Some APIs have been moved to other modules in python 3: getstatusoutput: moved from commands to subproces urlopen: moved from urllib2 to urllib.request urlparse: moved from urlparse to urllib.parse Made the imports work for both python versions by catching ImportError and importing APIs from different modules. [YOCTO #9584] (Bitbake rev: 5c39479fd7cb1b7c0bfc50c8cdfb9e5453bfa8e8) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix progress bar in MySQL environmentElliot Smith2016-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | When using MySQL, the project builds info delivered by MySQL differs from that delivered by SQLite: the former returns text values from the enumeration for Build outcomes, while the latter returns the integer value. This causes the progress bar JS to break, as it is expecting outcome strings. Modify the recent_build() method to include an outcomeText property for each Build object, then use this in the conditionals in the progress bar JS. [YOCTO #9498] (Bitbake rev: 7ac374adf1cc70173ff6cc492bc078bba1cf500b) 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: models Add missing import sysMichael Wood2016-05-111-0/+1
| | | | | | | (Bitbake rev: b2fba7a0820d77e1076c05b8ffcd960d4fc883a5) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: orm Add get_base_recipe_file to CustomImageRecipeMichael Wood2016-05-061-23/+37
| | | | | | | | | | | | | | | This function returns the base recipe file path only if it currently exists. This allows us to know whether we can proceed at this point with generating a custom image recipe. It also enables us to call this function from the templates to enable visual indication of this state. Some whitespace fixes also added in generate_recipe_file_contents (Bitbake rev: bc30d1b235b9ecacef5b2eaa851b9247d857f317) 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: add modal to select custom image for editingElliot Smith2016-04-191-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: prevent exception when Project.release is nullElliot Smith2016-04-191-5/+11
| | | | | | | | | | | | | | | Project.release can be null. This causes an exception when calling get_all_compatible_layer_versions(), as the query to fetch the layer versions references release.branch_name. Add a guard to the function so that an empty queryset is returned if the release isn't set for a project. (Bitbake rev: 6919a2b2e412a9e7b652a6bc191e7c1bed035222) 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 rev dep column to image detail pagesDave Lerner2016-04-061-0/+7
| | | | | | | | | | | | | | | | | | | | | Add a column to the custom image pages that shows the reverse dependencies in a format matching the dependencies column: - either blank or a button showing the count of reverse dependencies, - when the button is clicked, a popover appears showing the list of reverse dependencies, with each package's size, and the total size of all of the reverse dependencies. The implementation adds a packages table method to retreive the reverse dependency total size, and adds a separate 'popover' html template. Both of these changes follow the pattern for the dependencies column. [YOCTO #9163] (Bitbake rev: 2f978dccaa1ec82c7ad350bdc1cd9500000984eb) 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: models Exclude the CANCELLED builds from get_number_of_buildsMichael Wood2016-04-061-1/+4
| | | | | | | | | Don't count CANCELLED builds when returning the number of builds. (Bitbake rev: c3c29fd4eb5116b771e8e16281d4e3cdf4fae165) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: models Add cancelled state to build outcomeSujith H2016-04-061-1/+6
| | | | | | | | | | | | | A new state CANCELLED is introduced to, distinguish the state of build. [YOCTO #6787] (Bitbake rev: 404f406fecae879703bcfe96f3b65086b115fa8a) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: orm better detect requires during CustomImageRecipe generationJoshua Lock2016-04-031-3/+2
| | | | | | | | | | | | | | | | | | | We were doing a string search for the literal string "require" and assuming that a match meant the recipe uses the require keyword to include the contents of another recipe. This test isn't very smart (it should at least have matched on "require ") and triggers on the word require anywhere in the recipe, i.e. the word "required" in the DESCRIPTION of core-image-lsb.bb, and then breaks as the much smarter regex fails to match anything. Instead always run the regex search and only try to update the require entry when the regex matches. (Bitbake rev: a6add0e95d3d1e9a6a9fcabd73543bc5c278915f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: orm generate CustomImageRecipe contents try secondary pathMichael Wood2016-03-231-4/+7
| | | | | | | | | | | | | | | Try a secondary file path if the first does not exist. When we get the recipe paths and layer information from the layer index it is not a complete path but we are usually able to reconstruct it. If the complete real path has been discovered by building then use this instead. [YOCTO #9206] (Bitbake rev: 238db2e03405d259d48dfc477a276191e6a47698) 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: orm Add a constant for the CustomImageRecipe's layer nameMichael Wood2016-03-231-0/+4
| | | | | | | | | | | 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: models List only have the specified project's imported layersMichael Wood2016-03-091-2/+4
| | | | | | | | | | | | | | | When returning the compatible layers make sure that we are only listing: All the layers which are for this release && configuration layers (i.e. aren't part of the build history) and which aren't an imported layer OR are this project's imported layer(s). [YOCTO #8944] (Bitbake rev: de8baedaccb451c12bc3f642449db3f64aed6bf7) 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-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: use force_bytes to display non-ascii project namesSujith H2016-03-091-1/+4
| | | | | | | | | | | | | | | | | When user enters a non-ascii character in the project name of toaster, the build doesn't get triggered. Use force_bytes to fix this. Also deal with non-ascii project names when logging the build request in runbuilds. [YOCTO #9071] (Bitbake rev: b6141c4d170885d3bdf63074afcb1e41fde0a8f0) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Elliot Smith <elliot.smith@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-0/+8
| | | | | | | | | | | | | | 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: models Remove manual transaction control from lsupdatesMichael Wood2016-02-101-22/+1
| | | | | | | | | | | | | | | | | | Revert "toaster: models.py do not use transactions". This reverts commit e248a503ba84658dea086e65e9cde8b845b9c0ed (Bitbake rev: 48d0d510816346073f135bb86fb7904fdb50bb27) Manually managing the database transactions caused more problems than it temporarily solved so we return control back to Django's orm. [YOCTO #8796] (Bitbake rev: 25c531915b6f8f79a0822996ceb97f90483e359f) 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: orm generate_recipe_content only exclude locale packagesMichael Wood2016-02-101-8/+3
| | | | | | | | | | | | Allow package groups in our custom image recipe. Excluding them creates more undefined behaviour than including them at this stage. Also update to use convenience method for returning all packages. (Bitbake rev: 8c2e8a13badacb816c4b1178b6661600008b38af) 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: models Add update_package_list for CustomImageRecipeMichael Wood2016-02-101-2/+48
| | | | | | | | | | | | | | | Add a method to update the packages included list from the last build, this effectively "synchronises" the package list from what we think will happen at the Customise image stage with what actually was produced with a build. It's not ideal to have this function here but we also need to make sure that no race condition of the user accessing this list and it being updated occurs. (Bitbake rev: 8cf6e67a955574b33856a082bdadf3194f2b6ba4) 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: orm Add last_updated field to CustomImageRecipeMichael Wood2016-02-101-0/+1
| | | | | | | | | | | Field to keep track of when the package list for the CustomImageRecipe was last updated from a build. (Bitbake rev: 4bd4e49f13a7625997a43f3b2e67ed42c3c8e08b) 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: models add get_last_successful_built_target methodMichael Wood2016-02-101-0/+7
| | | | | | | | | | | Add a convenience method to get the last successful build target for a CustomImageRecipe. (Bitbake rev: 4dde3d830cd38bbe306d83629dcb80da5fc9b027) 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: models add all_depends method for Package_DependencyManagerMichael Wood2016-02-101-0/+5
| | | | | | | | | | This convenience method returns just the Package_Dependency for the package which are regular dependencies i.e. not RECOMMENDS or any other types. (Bitbake rev: bd76c22fe2aa06690b4ee25de69219ac0bf6b4d6) Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: models Invalidate ToasterTables cache when a m2m field changesMichael Wood2016-02-101-0/+1
| | | | | | | | | | | | | Whem a m2m field changes we need to clear the ToasterTables cache as this can affect the state of items in ToasterTables. For example the CustomImagePackages being added or removed from a custom image recipe. (Bitbake rev: c9d7b68ee0186a71e8e75a5d87122a0328001515) 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: CustomImageRecipe generate overwrite IMAGE_FEATURESMichael Wood2016-02-101-1/+1
| | | | | | | | | | | If we're breaking up an image recipe's packages we will also need to override IMAGE_FEATURES to make sure the customisation is not altered (Bitbake rev: 9fd7b05dc0cf9240f7c8e3dc77b009064fd2b0cb) 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: make locale packages uneditable in custom image pageElliot Smith2016-02-101-0/+14
| | | | | | | | | | | | | | | | | | | | When the packages associated with a custom image recipe are shown in the customrecipe editing page, locale packages are shown in the same way as all other packages. This gives the false impression that these packages can be removed, when in fact they are automatically added due to the IMAGE_LINGUAS build variable. Modify the customrecipe page so that locale packages cannot be removed, and provide some help text explaining why. [YOCTO #8927] (Bitbake rev: b2208e53c00a67a7d0345e7378e6806b8ae40fb4) 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: move recent builds query to modelElliot Smith2016-02-101-1/+28
| | | | | | | | | | | | | | | | | | | | | 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: orm generate_recipe_file_contents Handler for require recipeMichael Wood2016-02-101-1/+23
| | | | | | | | | | | | | | | | | | Add a special case for when the recipe we have based a custom image recipe on requires another recipe. In this case we need to adjust the file location to be able to require the recipe when we're in the toaster-custom-images layer. For example: "require core-image-minimal.bb" is changed to: "require recipes-core/images/core-image-minimal.bb" (Bitbake rev: 26025e1ea49b3ebfcfd508d1608fa8c9e722ad03) 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: orm Add convenience method to get all pkgs in a ↵Michael Wood2016-02-101-0/+6
| | | | | | | | | | | | | CustomImageRecipe Returns a queryset of the all the packages that we expect to have in a CustomImageRecipe. (Bitbake rev: 8b03bbae12ec077151c97579e329d89667040a78) 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: orm get_project_layer_versions to return layer_version objectsMichael Wood2016-02-101-3/+4
| | | | | | | | | | | | Instead of returning layercommits return the actual Layer_Version objects for the layercommit as these are the useful objects which contain the metadata. (Bitbake rev: 480f0d307a3183df16fd383c7a3f96f00d09fbd4) 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: orm add CustomImageRecipe generate contents functionMichael Wood2016-02-101-0/+49
| | | | | | | | | | | | | Add function generate_recipe_file_contents to dump the custom image recipe instance to a string for use either to push to the user as a downloaded version of their custom image recipe or to use to generate the recipe that we build. (Bitbake rev: 6863343c3434ce19aa4b609c83f48a06e6943366) 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: orm Add CustomImagePackage tableMichael Wood2016-02-101-0/+12
| | | | | | | | | | | This table is used to track all the available packages in the current toaster. Many of these packages belong to many CustomImageRecipes. (Bitbake rev: c1bd4f760cd35535e44f488250e0a56b99cad680) 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: orm make CustomImageRecipe inherit from RecipeMichael Wood2016-02-101-7/+2
| | | | | | | | | | | | This allows us to re-use the properties of a recipe for the custom image recipes as well as re-using the existing templates and logic that deals with recipe objects. (Bitbake rev: bb8120b56be7eee6ed2e4434d8477282a01e0c00) 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: orm Add sum of dependencies size function to ↵Michael Wood2016-02-101-1/+7
| | | | | | | | | | | | | | PackageDependencyManager Add function that returns the Sum of the size of all the packages which depend on a package. Access get_total_source_deps_size via a packages's dependency manager. (Bitbake rev: e4c86d2f6c2e86ad054b37d0a5bf7464a4de4f9a) 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: models fall back to a sensible string for no vcs referenceMichael Wood2016-02-101-1/+1
| | | | | | | | | | | Fall back to a 'n/a' string for the vcs reference, not all our source has to be in a vcs and therefore it is legitimate for this to be none. (Bitbake rev: 1739b509e9efc4b016fc73c2d4399f1f9d3d285f) 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: code formatting and clean-upElliot Smith2016-01-151-9/+3
| | | | | | | | | | | 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: convert all builds page to ToasterTableElliot Smith2016-01-151-1/+31
| | | | | | | | | | | | | | | | 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: toaster: check inferred file suffixes against list of known typesElliot Smith2016-01-151-3/+65
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+9
| | | | | | | | | | | | | | | | | | | | | 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: add Provider modelEd Bartosh2016-01-111-0/+5
| | | | | | | | | | | | | Added new model Provider and a foreign key 'via' to link Recipe_Dependency to it. [YOCTO #6169] (Bitbake rev: e45fff6314741d46e2549b2f72ed380cbbb95593) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: monkey patch QuerysetEd Bartosh2015-12-141-0/+30
| | | | | | | | | | | | | | | | Fixed 'database is locked' issue by monkey patching django QuerySet methods. The actual patching places were found by bisecting Django codebase. This commit should be removed after Django is fixed if it's fixed at all. (Bitbake rev: 175411bf05423b1892c7928c2b928843b39645f0) 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: work around 'database is locked' errorEd Bartosh2015-12-141-1/+19
| | | | | | | | | | | | | | When sqlite can not cope with a stream of 'insert' queries it throws 'database is locked' exception. Wrapping model.save in transaction.atomic context and repeating the call should solve this issue. (Bitbake rev: eb305308ca8f6228c6f52dac1bd941f29c7e5eb6) 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: fixed format stringsEd Bartosh2015-12-141-3/+3
| | | | | | | | | | | | | | Printing id as a number breaks toaster if object is not saved yet as id/pk is None in this case. Changed format spec to print id as a string in __str__ and __unicode__ methods of Build, Task and LayerVersion models. (Bitbake rev: d5ca2bae623db214764324da5c9e4dac6beef760) 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 compatible_layerversions() methodElliot Smith2015-12-141-18/+3
| | | | | | | | | | | | | | | | | 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: rename get_query_set -> get_querysetEd Bartosh2015-12-141-4/+4
| | | | | | | | | | | Renamed get_query_set to get_queryset as get_queryset causes deprecation warning in Django 1.7 and is deprecated in Django 1.8 (Bitbake rev: ef8b399dccd413070e32ce05e013337ea01fa64d) 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-8/+15
| | | | | | | | | | | | | | | | 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: CustomImageRecipe add search_allowed_fields to this modelMichael Wood2015-12-071-0/+1
| | | | | | | | | | | In order to search the model from the UI some fields must be nominated as searchable. (Bitbake rev: 2558729b4c248a2fa5a11d877bc42cb05a30602e) 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>