Commit Graph

416 Commits

Author SHA1 Message Date
Aníbal Limón
6ac4e8fbb5 layerindex/models.py: Branch model fix inital_data fixture
Add default = datetime.now attr to updated field of Branch
model because it fails when try to insert inital data with NULL.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2014-12-22 00:29:23 +00:00
Alexandru DAMIAN
40d05f928c adding updated field for certain models
We add an automatically-updateing "updated" datetime
field to Branch, LayerItem, LayerBranch, Recipe and
Machine models to allow date-based incremental updates
through the API.

The added field does not interfere with the existing
form-based pages (auto_now sets editable to false).

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-09-24 11:32:34 +01:00
Alexandru DAMIAN
1d84f282de adding CORS policy for the API
We add the corsheaders application in order to
enable the CORS policy for the read-only REST API.

This is needed to allow AJAX queries to the layerindex
application from a browser environment.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-09-24 11:32:34 +01:00
Alexandru DAMIAN
1c9d6be527 expose REST API for layerindex
This patch enables a read-only REST API for the layerindex
application using Django REST Framework.

The objects of types Branch, LayerBranch and LayerItem are
exposed to queries so that the layerindex application can
function as a Layer Source in Toaster.

The library dependencies are documented in the requirements.txt
file.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-09-24 11:32:34 +01:00
Alexandru DAMIAN
99b9b014db adding environment description for virtualenv
General practice influenced by heroku.com is to create
a requirements.txt documenting the python library dependencies
for the project. This allows a user to easy setup a running
environment for the project using virtualenv and pip.

Extending .gitignore to ignore venv (reserved for virtualenv
use) and vim swap files.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-09-24 11:32:34 +01:00
Paul Eggleton
749793f55b Support newly added API for enabling variable history tracking
See:
http://cgit.openembedded.org/bitbake/commit/?id=a9439b136f55f3f0e80ff053cd3b159da69ba362

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-09-24 11:29:08 +01:00
Paul Eggleton
7a432108c0 tools/import_layer: fix errors in maintainer scraping code
* Fix "sre_constants.error: nothing to repeat" error due to .* inside
  group made optional with ? in regex
* Avoid error if maintainer responsibility is not specified

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-06-12 11:24:25 +01:00
Paul Eggleton
0ec1909051 update.py: fix not clearing recipe files list on reload
When we did a full reload this list wasn't getting cleared for the next
layer, and we look at the contents of the list unconditionally later to
determine which files need to be added. Given that the list items are
full paths, this is unlikely to have caused any problems; however it
could possibly have been an issue for nested layers with the right
update order, or lead to issues if the usage of the list changes in
future.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-06-12 11:21:09 +01:00
Paul Eggleton
ab393b18c6 update.py: ignore layers within layers
Some layers, such as meta-intel, also contain other layers. We don't
want recipes/classes/appends in those child layers to appear in the
parent layer so ignore any that appear within subdirectories that
contain a conf/layer.conf file.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-06-12 11:15:14 +01:00
Paul Eggleton
7c4a1c1dab update.py: fix layer exists-on-branch check
There was a logic error here - we were checking to see if the layer
directory existed before actually checking out the branch, which means
we were looking at the state of whatever branch was previously checked
out. Replace this with some validation of the last revision check and an
additional check for the directory after checking out the branch.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-05-24 17:29:23 +01:00
Paul Eggleton
f0b517796f update.py: use actual branch when getting last revision
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-05-24 17:23:56 +01:00
Paul Eggleton
bbbf5e9939 Handle % characters in URLs
If there is a % character in the path to a file / directory, we need to
properly encode it when creating the repo web URL or the link won't
work. Thanks to Khem Raj for reporting this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-05-12 14:15:31 +01:00
Paul Eggleton
f7fa15dd36 Allow layers to have no master branch
With BSPs being "retired" e.g. in meta-intel, it is possible for layers
to not exist on the master branch; since this is legitimate we need the
layer index to handle it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-04-06 15:01:24 +01:00
Paul Eggleton
4c08b28387 recipes: preserve search keyword when switching between branches
If you want to check what the same search returns on a different branch
it makes things easier if you don't have to re-type the search after
selecting the branch.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-09 21:16:08 +00:00
Paul Eggleton
cd26148eed Fix append list name matching
* Recipes without versions in the file name (such as alsa-state.bb)
  weren't having their bbappends listed. Use a regex match to fix this.
* Use the prefix from the filename instead of PN, since that's how
  BitBake does it
* List version matching bbappends first, then non-matching in muted
  colour

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-09 20:58:24 +00:00
Paul Eggleton
4db9555a67 Show branch name next to last update date
Just to reinforce which branch is being viewed.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-09 19:23:59 +00:00
Paul Eggleton
81588881cb duplicates: sort recipes by version (descending) after other sorts
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-09 19:18:01 +00:00
Paul Eggleton
6d0b9d40aa duplicates: add ability to select layers
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-09 19:17:49 +00:00
Paul Eggleton
7f990bc085 README: update tested versions for required packages
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-04 12:27:06 +00:00
Paul Eggleton
5aa533b678 Fix OE-Classic stats page for update to latest django-nvd3 (0.6.0)
Update d3/nvd3 js files in the process, but hold off on nv.d3.css for
now because the latest version breaks the formatting/fading on tooltips.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-03-03 23:12:35 +00:00
Paul Eggleton
5ee1bb255b TODO: Add some more todo items
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-02-23 02:14:13 +00:00
Paul Eggleton
47d6ab50c8 Add layer import script
Adds a simple way to add a new layer to the database in an automated
manner, given only a URL and optionally a name and subdirectory. If no
subdirectory is given, the root and all first-level subdirectories that
contain conf/layer.conf will be created as layers. Guesses will be made
as to the right values for certain fields, by looking at
README/MAINTAINERS files and github repository information.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-02-23 02:13:10 +00:00
Paul Eggleton
3588053069 Use CORE_LAYER_NAME when setting default layer dependency
If the site is configured to use a different core layer then we ought to
use it for the default layer dependency instead of hardcoding
openembedded-core.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-12-28 11:03:29 +00:00
Paul Eggleton
fabc06b2d0 Check that the core layer contains conf/bitbake.conf
This ensures we get a sensible error message prompting the user to set
the subdirectory, instead of a BitBake parse error.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-12-28 11:03:29 +00:00
Paul Eggleton
75c44fd770 Use Django sites framework to specify website title
This allows specifying the site title in the database, instead of hardcoding
it in the template. Just change it to something other than "example.com" to
apply your own title.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-12-28 11:03:29 +00:00
Paul Eggleton
5ce6448a12 update.py: fix subdirectory does not exist error message
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-12-27 00:13:53 +00:00
Paul Eggleton
a51515341d README: add some instructions on creating the core layer
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-12-27 00:13:53 +00:00
Paul Eggleton
960fd61a93 README: note that LAYER_FETCH_DIR needs to be an absolute path
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-11-14 14:00:58 +00:00
Paul Eggleton
ae69297a12 README: add instruction to run migration on install
Since South was added this is an additional mandatory step for new
installations.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-11-13 10:18:36 +00:00
Paul Eggleton
1b0294a766 admin: enable adding layer branches
Allow editing the layer/branch fields when adding a layer branch record.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-11-04 10:57:51 +00:00
Paul Eggleton
84eecd7a54 update.py: add --fullreload option
Recently the -r/--reload option was changed to preserve existing recipe
data, so that it could be used to load values into newly added fields;
however we still need an option to load recipe data from scratch for
testing purposes (e.g. in combination with --nocheckout) so add a
 --fullreload option to do this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-20 07:08:22 +01:00
Paul Eggleton
fe717e0ad1 update.py: fix ability to test updating with --nocheckout
In order to test updating we need to be able to check out a previous
revision of the repository and have the update script load from that
without checking out the latest revision, so fix the --nocheckout
option to work properly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-20 07:08:22 +01:00
Paul Eggleton
ce25644664 update.py: fix Ctrl+C handling during layer update
We do not want to continue on to the next layer on Ctrl+C.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-20 07:08:09 +01:00
Paul Eggleton
482e7c437f TODO: update todo list
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-20 07:03:30 +01:00
Paul Eggleton
980778a4ad layerindex/tools: fix permissions
These should all have the execute bit set.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-20 06:49:12 +01:00
Paul Eggleton
07810d2354 README: update for recent changes
* There is no longer a frontpage template
* BitBake requires Python 2.7.3 so we might as well state it here also

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-20 06:47:59 +01:00
Paul Eggleton
dcd312b9fb Fix tree link on layer list for layers with no subdirectory
We always need to replace %path% in the URL, not just when there is a
non-blank path to replace it with.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-13 11:39:13 +01:00
Paul Eggleton
aa2c67c92d Fix fields not saving their values when disabled
We grey out some fields because we don't want to allow the user to
change them. However, we were setting the "disabled" jQuery property to
do this, and this results in the read value for the form field being
blank and thus the field in the database being blank. Set the "readonly"
property instead to get the correct behaviour.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-13 11:29:32 +01:00
Paul Eggleton
97cf2f8afb Fix error when editing layer from review page
The layer_review URL does not take a branch argument, so we can't send
one or it'll fail.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-13 11:12:51 +01:00
Paul Eggleton
399dddbcfe Fix detail page breadcrumbs to show layer branch instead of "Layers"
This makes it easier to tell what branch you are looking at.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 10:41:22 +01:00
Paul Eggleton
157656cec9 update.py: hide DeprecationWarnings
These are just annoying if the script is called from a cron job.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
8b6b40018a manage.py: add workaround for old project layout
Apparently we're using a deprecated directory layout; with some versions
of Django this results in an error running manage.py, so add a
workaround for this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
157e377d00 Use actual_branch in URLs if available
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
c567b7f4f4 Disable web URL fields when repository is known
Some users seem to think it's necessary to clear these fields out when
they are auto-set. The most appropriate thing to do seems to be to
disable editing them if we know what their values should be.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
b5074ed2aa Top bar functions improvements
* Change Submit layer link into a button
* Ensure tools dropdown menu doesn't show on layer submit/edit page

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
c2e36cda11 update.py: handle if deleted recipe can't be found
Show a warning instead of a traceback if a deleted recipe can't be found
in the database.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
42561c3a65 Allow SHA1 hash for bitbake branch
Allow the bitbake branch to be a SHA1 hash as well as a branch/tag.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
91a0bbea06 Disable rawrecipes URL
It's not really completely functional and puts quite a bit of load on
the server when used, so just disable it for now.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
bea2db8464 Show a coherent error on bulk change lock timeout
Since it's possible that the user will try to get patches while the
update script is running, ensure we show a sensible error if the script
times out waiting for a lock.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00
Paul Eggleton
93ce26f21c Ensure logger is passed into runcmd function or use sys.stderr.write
Otherwise it might not be defined when an error.needs to be printed.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2013-09-05 00:31:23 +01:00