summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
Commit message (Collapse)AuthorAgeFilesLines
...
* bitbake: toaster: only show "New custom image" button for builds with image ↵Elliot Smith2016-07-191-0/+13
| | | | | | | | | | | | | | | | targets Add a has_image_targets() method to Build, and use that to hide the "New custom image" button on the build dashboard if a build has no targets which build images. [YOCTO #9514] (Bitbake rev: 3c4b053e44ea512ef2ced67289a7b0161db6ce9b) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use has_images() methods to display images correctlyElliot Smith2016-07-191-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the build dashboard, we had issues with showing images correctly, as we were using the is_image property of targets to determine whether a target would have image files. This property can be set to True if a target refers to an image recipe (e.g. "core-image-minimal"), even if the task used in the build didn't produce any image files. By adding has_images() methods to the Target and Build objects, which count associated Target_Image_File objects, we can correctly determine whether a target has image files associated with it, and if any of the targets for a build has image files. This means that we can screen out the left-hand "Images" menu options for builds which contained image-related targets (e.g. "core-image-minimal") but which didn't produce any images (e.g. "rootfs" task). [YOCTO #9500] [YOCTO #9784] (Bitbake rev: f6bba0ff254d5ed3163151d4b938f3a43c9acb0a) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: improve scan for SDK artifactsElliot Smith2016-07-191-42/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDK artifacts were previously picked up by toaster.bbclass and notified to buildinfohelper (via toasterui). The artifacts were then added to the Build object, so that it wasn't clear which artifact went with which target; we were also unable to attach SDK artifacts to a Build if they had already been attached to a previous build. Now, toaster.bbclass just notifies the TOOLCHAIN_OUTPUTNAME when a populate_sdk* target completes. The scan is moved to buildinfohelper, where we search the SDK deploy directory for files matching TOOLCHAIN_OUTPUTNAME and attach them to targets (not builds). If an SDK file is not produced by a target, we now look for a similar, previously-run target which did produce artifacts. If there is one, we clone the SDK artifacts from that target onto the current one. This all means that we can show SDK artifacts by target, and should always get artifacts associated with a target, regardless of whether it really build them. This requires an additional model, TargetSDKFile, which tracks the size and path of SDK artifact files with respect to Target objects. [YOCTO #8556] (Bitbake rev: 5e650c611605507e1e0d1588cd5eb6535c2d34fc) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: attach kernel artifacts to targetsElliot Smith2016-07-191-2/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bzImage and modules files were previously attached to a build, rather than to the target which produced them. This meant it was not possible to determine which kernel artifact produced by a build came from which target; which in turn made it difficult to associate existing kernel artifact with targets when those targets didn't produce artifacts (e.g. if the same machine + target combination was built again and didn't produce a bzImage or modules file because those files already existed). By associating kernel artifacts with the target (via a new TargetArtifactFile model), we make it possible to find all the artifacts for a given machine + target combination. Then, in cases where a build is completed but its targets don't produce any artifacts, we can find a previous Target object with the same machine + target and copy its artifacts to the targets for a just-completed build. Note that this doesn't cover SDK artifacts yet, which are still retrieved in toaster.bbclass and show up as "Other artifacts", lumped together for the whole build rather than by target. [YOCTO #8556] (Bitbake rev: 9b151416e428c2565a27d89116439f9a8d578e3d) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: improve image file suffix retrievalElliot Smith2016-07-191-37/+11
| | | | | | | | | | | | | | Refactor retrieval of suffix from image file path, making it a a method on Target_Image_File. This makes it easier to use this in the build dashboard for individual images, plus reduces the complexity of the code required to get all of the image file suffixes for a build. (Bitbake rev: 9c38de3dec74c122c2060cad37331bdafc6858ec) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: fix wrong usage of print_exc and format_excEd Bartosh2016-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | First parameter of traceback.print_exc and traceback.format_exc APIs is a 'limit' - a number of stracktraces to print. Passing exception object to print_exc or format_exc is incorrect, but it works in Python 2 and causes printing only one line of traceback. In Python 3 comparison of integer and exception object throws exception: TypeError: unorderable types: int() < <Exception type>() As these APIs are usually used in except block of handling another exception this can cause hard to find and debug bugs. (Bitbake rev: c5a48931ac8db9e56f978c50861c19d0d0c808e3) 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: Rework displaying package dependencies across ToasterMichael Wood2016-06-151-11/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After porting the build table to a unified mechanism for showing dependencies in tables it highlighted that the dependencies selected to be shown were un-filtered. i.e. all dependencies from all contexts were shown. The context for a package's dependencies is based on the target that they were installed onto, or if not installed then a "None" target. Depending on where the template for the dependencies are show we need to switch this target which is why a filter and utility function on the model is added. Additionally to use the same templates in the build analysis we also need to optionally add links to the build data for the packages being displayed as dependencies. Customising a Custom image recipes may or may not have a target depending on whether they have been built or not, if not we do a best effort at getting the dependencies by using the last known target on that package to get the dependency information. [YOCTO #9676] (Bitbake rev: 31e7c26cc31a7c8c78c1464fa01581683bfd2965) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use // operator instead of /Ed Bartosh2016-06-021-1/+1
| | | | | | | | | | | | | | Division operator works differently in Python 3. It results in float unlike in Python 2, where it results in int. Explicitly used "floor division" operator instead of 'division' operator. This should make the code to result in integer under both pythons. (Bitbake rev: 0c38441ed99b49dae8ef9613e320f0760853d6aa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: replace map with list comprehensionsEd Bartosh2016-06-021-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: d41eb6d6c061cb35ec1ecd899f856876f9077167) 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-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: use decode('utf-8') for binary dataEd Bartosh2016-06-021-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: 752ea00919ef054622a51ce097923309934eff2b) 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-06-021-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: 1abaa1c6a950b327e6468192dd910549643768bb) 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>