Commit Graph

414 Commits

Author SHA1 Message Date
Jose Lamego
be4ce0edf3 layerindex/update_layer: update src_uri from new recipe
A wrong Source URI may be displayed at the recipedetail view
if the related db field does not get updated routinely.

This change updates the src_uri db field when updating
recipe info from a new recipe file.

[#YOCTO 10899]

Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
2017-08-17 16:47:56 -05:00
Aníbal Limón
43c02acfa4 rrs/tools/rrs_upstream_history.py: Change regex variables to tuple
This are causing a failure when access the remote datastore.

File "rrs/rrs/tools/rrs_upstream_history.py", line 169, in <module>
    set_regexes(recipe_data)
  File "rrs/rrs/tools/rrs_upstream_history.py", line 53, in set_regexes
    if any(d.getVar(var, True) for var in variables):
  File "rrs/rrs/tools/rrs_upstream_history.py", line 53, in <genexpr>
    if any(d.getVar(var, True) for var in variables):
  File "/srv/rrs/layers/bitbake/lib/bb/data_smart.py", line 608, in
getVar
    return self.getVarFlag(var, "_content", expand, noweakdefault,
parsing)
  File "/srv/rrs/layers/bitbake/lib/bb/data_smart.py", line 723, in
getVarFlag
    local_var, overridedata = self._findVar(var)
  File "/srv/rrs/layers/bitbake/lib/bb/data_smart.py", line 480, in
_findVar
    return connector.getVar(var)
  File "/srv/rrs/layers/bitbake/lib/bb/tinfoil.py", line 62, in getVar
    value = self.tinfoil.run_command('dataStoreConnectorFindVar',
self.dsindex, name)
  File "/srv/rrs/layers/bitbake/lib/bb/tinfoil.py", line 316, in
run_command
    raise TinfoilCommandFailed(result[1])
bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last):
  File "/srv/rrs/layers/bitbake/lib/bb/command.py", line 81, in
runCommand
    result = command_method(self, commandline)
  File "/srv/rrs/layers/bitbake/lib/bb/command.py", line 465, in
dataStoreConnectorFindVar
    datastore = command.remotedatastores[dsindex]
  File "/srv/rrs/layers/bitbake/lib/bb/remotedata.py", line 39, in
__getitem__
    return self.datastores[key]
TypeError: unhashable type: 'list'

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-05-09 12:52:43 -05:00
Aníbal Limón
ece20f30ba templates/rrs/recipedetail.html: Change Maintainer to Committer
To avoid confusion about who is the current maintainer.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-05-09 10:21:04 -05:00
Aníbal Limón
6902ad40b7 rrs/views.py: When export to csv use release_milestone.csv
To be more descriptive about what report is.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-05-09 10:18:03 -05:00
Aníbal Limón
553680728f layerindex/models.py: Recipe increase size of fields
To fix errors when contents of the fields becomes bigger.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-04-03 16:29:20 -05:00
Aníbal Limón
c576874628 rrs/tools/rrs_upstream_history.py: Disable threads due to new tinfoil API
The new tinfoil API don't support pythreads so set to 1 while
tinfoil have support.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-06 10:38:41 -06:00
Aníbal Limón
81ddfcbeff rrs/tools/rrs_distros.py: Don't open files in binary mode
It ends on failures with Python 3.x when do a split method
over binary data.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-06 10:07:09 -06:00
Aníbal Limón
d5eb493806 rrs/tools/rrs_upgrade_history.py: Remove mp process related code
The new tinfoil API acts as a client/server so isn't need to work
around creating process to avoid errors in cooker with different
data revisions.

Also add a try/except when create an upgrade display the error.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-05 17:55:00 -06:00
Aníbal Limón
0eb6d3e870 rrs/tools/common.py: Fix typo when load recipes
[YOCTO #10863]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-05 17:54:32 -06:00
Aníbal Limón
3f883b5f86 rrs/tools: Upgrade to use new API of tinfoil
The new client/server API of tinfoil requires explicit call of
shutdown method to send the event for finalize cooker process.

[YOCTO #10863]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-05 15:52:55 -06:00
Aníbal Limón
9001631a2e rrs/tools: Upgrade to use transaction.atomic() in Django 1.6
Django 1.6 provides a context manager for atomic transactions so
update the way for make db transactions.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-05 15:37:15 -06:00
Aníbal Limón
cb6f6b50d0 layerindex: Update tinfoil to call shutdown method
The new client/server API of tinfoil requires explicit call of
shutdown method to send the event for finalize cooker process.

Also in update_layer remove the databuilder and cache instance
now isn't needed.

[YOCTO #10863]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-05 15:21:50 -06:00
Paul Eggleton
c1ba5f65f1 Fix for changes to auth views in Django 1.6
Part of this change is temporary for django-registration 1.0; later
versions probably won't require the workaround URLs.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-04 14:16:29 -06:00
Paul Eggleton
410569a701 update_layer.py: fix up for bitbake API change
The multiconfig changes broke the calls here to loadDataFull(). To avoid
this being an issue in future, make use of tinfoil's new parse_recipe_file()
function (if available) to isolate the code here from any future changes to
bitbake's internal code.

Part of the fix for [YOCTO #10192].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-04 14:16:12 -06:00
Paul Eggleton
81e3086f4c Fix output decoding/reporting for bulk change patch download
With Python 3 we need to take care of decoding the output so we can
treat it as a string. At the same time, it's more useful to see the
output string rather than the exception if there is some output.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-04 14:16:04 -06:00
Paul Eggleton
ef00bf4df5 Use python3 commands in README
If you're in a virtualenv it doesn't make a difference, but outside of
one it will.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-04 14:15:49 -06:00
Paul Eggleton
087b4cd06a Use functools.reduce instead of reduce
This is apparently required in Python 3.3+, although I have been unable
to verify this locally.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-04 14:15:42 -06:00
Paul Eggleton
773a6475af Fix not null error on database migration
The updated field on the branch table was not null and this breaks the
fixture. It's too painful to specify a value for a datetime field in a
fixture json file and it wouldn't even make sense to specify a value in
this case anyway, so just allow the field to be null.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-04 14:15:36 -06:00
Aníbal Limón
940cf6f174 templates/rrs/recipedetail.html: Fix unneeded quotes in url call
The url template function resolve an URL associated with a model, so
in Django 1.6 quotes around variables don't get the variable value.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-04 13:42:32 -06:00
Aníbal Limón
1d93010038 layerindex/tools/import_layer.py: Fix Openembedded VCS URL
Since Openembedded cgit was upgrade so point to new url to reflect
the real URL.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-01-04 12:11:23 -06:00
Aníbal Limón
c815923aed rrs/tools/common.py: When load a recipe use tinfoil cache
Due to multi-configuration builds in bitbake now is needed
to use a tinfoil cache instance instead of call directly in
bb.cache.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-08-29 16:12:23 -05:00
Aníbal Limón
33110335d2 layerindex: Fix recipe loading using tinfoil
Due to enablement of the Bitbake multiconfiguration
builds now the bb.cache requires an instance to load
a recipe.

This changes adds an instance of the databuilder and
cache to tinfoil, in the future we need to provide a
method for get data from the recipe at tinfoil level.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-08-29 16:12:04 -05:00
Aníbal Limón
42d9891497 rrs/tools/rrs_upgrade_history.py: Fix import of split_recipe_fn
split_recipe_fn function was moved to update_layer during python3
upgrade in layerindex.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-06-29 15:24:35 -05:00
Aníbal Limón
a99837213f rrs/tools/common.py: common_setup() Add layerindex to the path.
Add explicity layerindex folder to the path for avoid errors
in imports.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-06-29 15:19:14 -05:00
Aníbal Limón
931297fb58 layerindex,rrs: Minor changes to work with python3.
[YOCTO #9746]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-06-29 15:08:54 -05:00
Aníbal Limón
b274a65f65 rrs: Frontend update to work with Python3 and django
[YOCTO #9746]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-06-23 10:04:53 -05:00
Aníbal Limón
eb13bb4ce7 layerindex/migrations: Update remaning migrations for apply at top of
RRS

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2016-06-22 17:00:52 -05:00
Paul Eggleton
2cf4269ed2 Explicitly specify temporary redirection
Django 1.8 warns that the default for the "permanent" parameter to
RedirectView is changing in 1.9 from True to False, but I believe we
should be specifying False for these redirections - these are not just
redirections from old URLs and may in fact change in the future if the
site structure changes.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:39:41 -05:00
Paul Eggleton
3d6dc8f35a update_layer.py: use new-style transaction API
The old transaction API has been removed in Django 1.8 and was
deprecated at 1.6. There's no explicit open transaction, commit or
rollback now - we just wrap the layer operations in
"with transaction.atomic()"; if we need to roll back we just raise a
"dummy" exception.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:39:11 -05:00
Paul Eggleton
3df2b1c5d9 Preemptive auto_now fix for Django 1.8
Django 1.8 does not allow DateFields that have both auto_now and default
set - since they are mutually exclusive; if you have auto_now you don't
need a default.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:39:10 -05:00
Paul Eggleton
d4b4f40eca Handle Python 2 and Python 3 branches in the same index
Add a model to support setting a python command and virtualenv per
branch, which allows you to parse master with python3 and krogoth with
python2 for example.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:38:50 -05:00
Paul Eggleton
72fcee545a update_layer.py: fix handling of renames with newer GitPython
Newer versions of GitPython implement rename detection, which means that
such changes don't show up as adds and deletes anymore and you get a
bunch of ENOENT errors for renamed files. Add some code to explicitly
look for renames and process them appropriately.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:38:50 -05:00
Paul Eggleton
cfc911a254 update_layer.py: rename confusing loop variables
Stop using "d" (sometimes multiple levels!) and use proper descriptive
variable names instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:38:50 -05:00
Paul Eggleton
fdd3a8935e Support (and require) Python 3
We need to be able to support Python 3 so that we can parse master of
OE-Core with bitbake (which now requires it). This now means the
interface itself and the update script require Python 3.4+.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:38:50 -05:00
Paul Eggleton
edba6fdeeb Fix for changes in modern django-reversion
We have to upgrade django-reversion to 1.8 due to upgrading Django, but
unfortunately in that same version the author has removed the type field
on Version model, without a particularly good explanation as to why. This
is really annoying as we were using it to provide a reasonable audit
including for deletes. I suspect we'll need to move away from
django-reversion and do our own thing in future, but for now at least
allow the layer index to keep working.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:38:50 -05:00
Paul Eggleton
82266556cd Upgrade to Django 1.6+
I'd like to be upgrading to 1.8 but that causes problems with South, and
we're not quite ready to dispense with our existing migrations yet.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:38:45 -05:00
Paul Eggleton
fee87f4353 bulkchange: drop temp paths in multi-patch tarball
We were getting temporary paths appearing in the tarball that gets
created to allow you to download the patches for a bulk change operation
that crosses multiple layers - we don't need those.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:36:26 -05:00
Paul Eggleton
3bf44a1bfc Increase size of Recipe provides and license fields
Fix "data truncated" warnings/errors when loading data for OE-Core:
* PROVIDES for recipe packagegroup-base is ~1452 characters
* LICENSE for recipe linux-firmware is ~1053 characters

(These aren't shown with SQLite, only with something like MariaDB where
column sizes are enforced.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:36:17 -05:00
Paul Eggleton
c1bce2795f Fix listing *_git.bbappend as appends for git recipe
Fix a greedy regex in the recipe detail view resulting in the git recipe
listing all bbappends named *_git.bbappend as its bbappends (quite a few
in the public instance).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:49 -05:00
Paul Eggleton
d0719ca951 update.py: allow updating all branches with one command
Allow updating multiple branches, and if no branches are specified,
update all branches that have a new "updates_enabled" flag field set to
True. This avoids the need to have a separate shell script which runs
update.py for each branch (and thus has hardcoded knowledge of each
active branch in the index, i.e. it needs to be kept up-to-date in
addition to the database.)

The migration will default updates_enabled to True for all branches so
if you wish to take advantage of this functionality, the flag will need
to be set to False for any branches that shouldn't be updated.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:49 -05:00
Paul Eggleton
0d642c525a update.py: refactor into two separate scripts
In order to try to avoid problems with leaking memory, context bleeding
from one layer to another, and lay the groundwork for supporting
updating all branches in one operation, split the updating of a single
layer out to its own internal script. This means that the tinfoil
instantiation and metadata parsing is in a completely separate process
per layer.

Implements [YOCTO #9647].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:49 -05:00
Paul Eggleton
79282350f8 Allow blanking out field values in bulk change
If you're moving a short description value from DESCRIPTION to SUMMARY
then part of that is setting DESCRIPTION to blank, however that wasn't
possible - the code was assuming that a null value meant "keep the
original value". Change the logic so that the value in the bulk change
object is always set and is compared to the original value to see if it
is different. This provides less safety against bulk change data going
stale in the face of the metadata being updated, but without using an
additional "magic" field value that's the price we have to pay, and it's
unlikely to bother too many people I would imagine.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:49 -05:00
Paul Eggleton
fbc6a058d3 TODO: drop some completed items
We took care of showing blacklist info and searching for the git recipe
recently. We've used "git fetch" rather than "git pull" for some time
now so we won't be hitting merge situations.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:49 -05:00
Alex Franco
c6d0a8292a Display recipe blacklist information
Display blacklist information for recipes in the recipe details,
as well as the recipe search page, and layer page tables. This
information is pulled from the PNBLACKLIST variable. Includes a
hover text containing the reason for blacklist labels.

Changes to Django and Layerindex files:
- models.py, update.py
- migration file
- templates and static content (stylesheet)

[YOCTO #7855]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-22 16:35:29 -05:00
Elliot Smith
d6a601c738 search: show matches against pn at top of recipe search results
Using the search box creates a query against the pns,
summaries, descriptions and filenames of recipes.
This results in a lot of spurious results for common terms
like "git" when performing a recipe search.

Make the results more useful by:

* Only searching against pn, description and summary (not file).
* Putting matches against pn at the top of the list, followed by
matches against description and summary.

[YOCTO #9159]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-22 16:35:06 -05:00
Paul Eggleton
f619474bc9 update.py: fix splitting on _ when getting class inheritance
The code to populate the inherits information was using a function
designed to get the recipe name from a file path, but unlike recipe
filenames, the underscore isn't treated as special in class filenames
and in fact it's quite common to use underscores there; we were ending
up with items in the inherit list such as "populate" and "rootfs". Use
the standard python os.path functions to do the splitting instead and
avoid this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:06 -05:00
Paul Eggleton
de30c3a634 Update TODO with more ideas
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:06 -05:00
Alex Franco
e6233b61cd Docker based environment setup
Replicate production setup in Docker containers

[YOCTO #7575]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:35:06 -05:00
Alex Franco
d83844736f requirements.txt: added GitPython
As it is needed for layerindex anyway

[YOCTO #7575]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
2016-06-22 16:35:03 -05:00
Alex Franco
512e6c53ef Support for recipe inherits field
To identify image recipes and provide inheritance data for recipes, an
inherits field was added to the recipe model, and then populated using
refactored data from __inherit_cache. Finally the field was also added
to page templates, along with style changes proposed in attachment, and
an additional style change to display the inherits field as a list in
detailed view. The field skips globally inherited data as proposed.

[YOCTO #7575]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-22 16:33:52 -05:00