Upgrade to Django 3.2 LTS
cover Upgrade to Django 3.2 LTS
Django 2.2 LTS will go EOL in April 2022.
Upgrade to Django 3.2 LTS which is supported through April 2024.
https://www.djangoproject.com/download/
The tests in bitbake/lib/toaster/tests need updating to at least Selenium 3.141.0 (which is what the crops/toaster-container uses for tests). For now this is out of scope of this patch series as it is not clear the tests are working now (the tests/browser/README is very out of date).
The following changes since commit b31eb2156d273fe70bc0b49c1549c07f6521b936:
bitbake: toaster: automation to generate fixture files (2022-03-12 13:27:59 +0000)
are available in the Git repository at:
git://git.yoctoproject.org/git/poky-contrib timo/toaster-updates
http://git.yoctoproject.org/cgit.cgi/git/poky-contrib/log/?h=timo/toaster-updates
Tim Orling (7):
toaster-requirements.txt: Django 3.2 LTS
toaster: Update docs links in templates
toaster: orm/models -- drop django.utils.six
toaster: set DEFAULT_AUTO_FIELD
toaster: migratation for models.BigAutoField
bitbake: buildinfohelper.py fix for Django 3.2
toaster: drop landing_not_managed template
bitbake/lib/bb/ui/buildinfohelper.py | 16 +- .../migrations/0008_models_bigautofield.py | 48 +++++ .../migrations/0020_models_bigautofield.py | 173 ++++++++++++++++++ bitbake/lib/toaster/orm/models.py | 1 - .../toaster/toastergui/templates/base.html | 2 +- .../toastergui/templates/configvars.html | 2 +- .../toaster/toastergui/templates/landing.html | 6 +- .../templates/landing_not_managed.html | 34 ---- .../toaster/toastergui/templates/project.html | 2 +- .../templates/project_specific.html | 2 +- .../toastergui/templates/projectconf.html | 8 +- bitbake/lib/toaster/toastermain/settings.py | 3 + bitbake/toaster-requirements.txt | 2 +- 13 files changed, 241 insertions(+), 58 deletions(-) create mode 100644 bitbake/lib/toaster/bldcontrol/migrations/0008_models_bigautofield.py create mode 100644 bitbake/lib/toaster/orm/migrations/0020_models_bigautofield.py delete mode 100644 bitbake/lib/toaster/toastergui/templates/landing_not_managed.html
Signature · 1 line
2.30.2
PATCH 1/7 toaster-requirements.txt: Django 3.2 LTS
Django 2.2.x goes EOL April 2022.
Switch the to current LTS Django 3.2.x supported until April 2024.
--- bitbake/toaster-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/toaster-requirements.txt +1 -1
@@ -1,3 +1,3 @@ -Django>2.2,<2.3 +Django>3.2,<3.3 beautifulsoup4>=4.4.0 pytz
Signature · 1 line
2.30.2
PATCH 2/7 toaster: Update docs links in templates
In reply to Tim OrlingUpdate docs links from www.yoctoproject.org to the docs.yoctoproject.org equivalents.
--- bitbake/lib/toaster/toastergui/templates/base.html | 2 +- bitbake/lib/toaster/toastergui/templates/configvars.html | 2 +- bitbake/lib/toaster/toastergui/templates/landing.html | 6 +++--- bitbake/lib/toaster/toastergui/templates/project.html | 2 +- .../toaster/toastergui/templates/project_specific.html | 2 +- bitbake/lib/toaster/toastergui/templates/projectconf.html | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-)
bitbake/lib/toaster/toastergui/templates/base.html +1 -1
@@ -123,7 +123,7 @@ {% endif %} {% endif %} <li id="navbar-docs"> - <a target="_blank" href="https://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html"> + <a target="_blank" href="http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual"> <i class="glyphicon glyphicon-book"></i> Documentation </a>
bitbake/lib/toaster/toastergui/templates/configvars.html +1 -1
@@ -66,7 +66,7 @@ <td class="description"> {% if variable.description %} {{variable.description}} - <a href="https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-{{variable.variable_name|variable_parent_name}}" target="_blank"> + <a href="http://docs.yoctoproject.org/ref-manual/variables.html#term-{{variable.variable_name|variable_parent_name}}" target="_blank"> <span class="glyphicon glyphicon-new-window get-info"></span></a> {% endif %} </td>
bitbake/lib/toaster/toastergui/templates/landing.html +3 -3
@@ -15,7 +15,7 @@ <p>A web interface to <a href="https://www.openembedded.org">OpenEmbedded</a> and <a href="https://www.yoctoproject.org/tools-resources/projects/bitbake">BitBake</a>, the <a href="https://www.yoctoproject.org">Yocto Project</a> build system.</p> <p class="top-air"> - <a class="btn btn-info btn-lg" href="https://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#toaster-manual-setup-and-use"> + <a class="btn btn-info btn-lg" href="http://docs.yoctoproject.org/toaster-manual/setup-and-use.html#setting-up-and-using-toaster"> Toaster is ready to capture your command line builds </a> </p>
@@ -33,7 +33,7 @@ Toaster has no layer information. Without layer information, you cannot run builds. To generate layer information you can: <ul> <li> - <a href="https://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#layer-source">Configure a layer source</a> + <a href="http://docs.yoctoproject.org/toaster-manual/reference.html#layer-source">Configure a layer source</a> </li> <li> <a href="{% url 'newproject' %}">Create a project</a>, then import layers
@@ -44,7 +44,7 @@ <ul class="list-unstyled lead"> <li> - <a href="https://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html"> + <a href="http://docs.yoctoproject.org/toaster-manual/index.html#toaster-user-manual"> Read the Toaster manual </a> </li>
bitbake/lib/toaster/toastergui/templates/project.html +1 -1
@@ -139,7 +139,7 @@ <ul> <li><a href="{% url 'projectlayers' project.id %}">Choose from the layers compatible with this project</a></li> <li><a href="{% url 'importlayer' project.id %}">Import a layer</a></li> - <li><a href="https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#understanding-and-creating-layers" target="_blank">Read about layers in the documentation</a></li> + <li><a href="http://docs.yoctoproject.org/dev-manual/common-tasks.html#understanding-and-creating-layers" target="_blank">Read about layers in the documentation</a></li> <li>Or type a layer name below</li> </ul> </div>
bitbake/lib/toaster/toastergui/templates/project_specific.html +1 -1
@@ -137,7 +137,7 @@ <ul> <li><a href="{% url 'projectlayers' project.id %}">Choose from the layers compatible with this project</a></li> <li><a href="{% url 'importlayer' project.id %}">Import a layer</a></li> - <li><a href="https://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#understanding-and-creating-layers" target="_blank">Read about layers in the documentation</a></li> + <li><a href="http://docs.yoctoproject.org/dev-manual/common-tasks.html#understanding-and-creating-layers" target="_blank">Read about layers in the documentation</a></li> <li>Or type a layer name below</li> </ul> </div>
bitbake/lib/toaster/toastergui/templates/projectconf.html +4 -4
@@ -201,12 +201,12 @@ <p>Toaster cannot set any variables that impact 1) the configuration of the build servers, or 2) where artifacts produced by the build are stored. Such variables include: </p> <p> - <code><a href="https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-BB_DISKMON_DIRS" target="_blank">BB_DISKMON_DIRS</a></code> - <code><a href="https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-BB_NUMBER_THREADS" target="_blank">BB_NUMBER_THREADS</a></code> + <code><a href="http://docs.yoctoproject.org/ref-manual/variables.html#term-BB_DISKMON_DIRS" target="_blank">BB_DISKMON_DIRS</a></code> + <code><a href="http://docs.yoctoproject.org/ref-manual/variables.html#term-BB_NUMBER_THREADS" target="_blank">BB_NUMBER_THREADS</a></code> <code>CVS_PROXY_HOST</code> <code>CVS_PROXY_PORT</code> - <code><a href="https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-PARALLEL_MAKE" target="_blank">PARALLEL_MAKE</a></code> - <code><a href="https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-TMPDIR" target="_blank">TMPDIR</a></code></p> + <code><a href="http://docs.yoctoproject.org/ref-manual/variables.html#term-PARALLEL_MAKE" target="_blank">PARALLEL_MAKE</a></code> + <code><a href="http://docs.yoctoproject.org/ref-manual/variables.html#term-TMPDIR" target="_blank">TMPDIR</a></code></p> <p>Plus the following standard shell environment variables:</p> <p><code>http_proxy</code> <code>ftp_proxy</code> <code>https_proxy</code> <code>all_proxy</code></p> </div>
Signature · 1 line
2.30.2
PATCH 3/7 toaster: orm/models -- drop django.utils.six
In reply to Tim OrlingDjango 3.2 no longer has django.utils.six module.
--- bitbake/lib/toaster/orm/models.py | 1 - 1 file changed, 1 deletion(-)
bitbake/lib/toaster/orm/models.py +0 -1
@@ -58,7 +58,6 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']: return _base_insert(self, *args, **kwargs) QuerySet._insert = _insert - from django.utils import six def _create_object_from_params(self, lookup, params): """ Tries to create an object using passed params.
Signature · 1 line
2.30.2
PATCH 4/7 toaster: set DEFAULT_AUTO_FIELD
In reply to Tim OrlingNew in Django 3.2.
Silence warnings by adding:
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
in toastermain/settings.py
--- bitbake/lib/toaster/toastermain/settings.py | 3 +++ 1 file changed, 3 insertions(+)
bitbake/lib/toaster/toastermain/settings.py +3 -0
@@ -39,6 +39,9 @@ DATABASES = { } } +# New in Django 3.2 +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + # Needed when Using sqlite especially to add a longer timeout for waiting # for the database lock to be released # https://docs.djangoproject.com/en/1.6/ref/databases/#database-is-locked-errors
Signature · 1 line
2.30.2
PATCH 5/7 toaster: migratation for models.BigAutoField
In reply to Tim OrlingFollow the default guidelines from Django 3.2 setting DEFAULT_AUTO_FIELD to django.db.models.BigAutoField which leads to these migrations.
--- .../migrations/0008_models_bigautofield.py | 48 +++++ .../migrations/0020_models_bigautofield.py | 173 ++++++++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 bitbake/lib/toaster/bldcontrol/migrations/0008_models_bigautofield.py create mode 100644 bitbake/lib/toaster/orm/migrations/0020_models_bigautofield.py
bitbake/lib/toaster/bldcontrol/migrations/0008_models_bigautofield.py new file +48 -0
@@ -0,0 +1,48 @@ +# Generated by Django 3.2.12 on 2022-03-06 03:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bldcontrol', '0007_brlayers_optional_gitinfo'), + ] + + operations = [ + migrations.AlterField( + model_name='brbitbake', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='brerror', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='brlayer', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='brtarget', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='brvariable', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='buildenvironment', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='buildrequest', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + ]
bitbake/lib/toaster/orm/migrations/0020_models_bigautofield.py new file +173 -0
173 lines not on this page · raw message
Signature · 1 line
2.30.2
PATCH 6/7 bitbake: buildinfohelper.py fix for Django 3.2
In reply to Tim Orlingconnection.features.autocommits_when_autocommit_is_off was deprecated in 3.0 and is no longer present in 3.2
--- bitbake/lib/bb/ui/buildinfohelper.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
bitbake/lib/bb/ui/buildinfohelper.py +5 -11
@@ -893,9 +893,6 @@ class BuildInfoHelper(object): self.task_order = 0 self.autocommit_step = 1 self.server = server - # we use manual transactions if the database doesn't autocommit on us - if not connection.features.autocommits_when_autocommit_is_off: - transaction.set_autocommit(False) self.orm_wrapper = ORMWrapper() self.has_build_history = has_build_history self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
@@ -1313,12 +1310,11 @@ class BuildInfoHelper(object): task_information['outcome'] = Task.OUTCOME_FAILED del self.internal_state['taskdata'][identifier] - if not connection.features.autocommits_when_autocommit_is_off: - # we force a sync point here, to get the progress bar to show - if self.autocommit_step % 3 == 0: - transaction.set_autocommit(True) - transaction.set_autocommit(False) - self.autocommit_step += 1 + # we force a sync point here, to get the progress bar to show + if self.autocommit_step % 3 == 0: + transaction.set_autocommit(True) + transaction.set_autocommit(False) + self.autocommit_step += 1 self.orm_wrapper.get_update_task_object(task_information, True) # must exist
@@ -1990,8 +1986,6 @@ class BuildInfoHelper(object): # Do not skip command line build events self.store_log_event(tempevent,False) - if not connection.features.autocommits_when_autocommit_is_off: - transaction.set_autocommit(True) # unset the brbe; this is to prevent subsequent command-line builds # being incorrectly attached to the previous Toaster-triggered build;
Signature · 1 line
2.30.2
PATCH 7/7 toaster: drop landing_not_managed template
In reply to Tim OrlingThis template is not referenced anywhere and therefore not used. It also refers to the obsolete "build mode" in the old docs.
--- .../templates/landing_not_managed.html | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 bitbake/lib/toaster/toastergui/templates/landing_not_managed.html
bitbake/lib/toaster/toastergui/templates/landing_not_managed.html deleted +0 -34
@@ -1,34 +0,0 @@ -{% extends "base.html" %} - -{% load static %} -{% load projecttags %} -{% load humanize %} - -{% block title %} Welcome to Toaster {% endblock %} - -{% block pagecontent %} - - <div class="container"> - <div class="row"> - <!-- Empty - no build module --> - <div class="page-header top-air"> - <h1> - This page only works with Toaster in 'Build' mode - </h1> - </div> - <div class="alert alert-info lead"> - <p"> - The 'Build' mode allows you to configure and run your Yocto Project builds from Toaster. - <ul> - <li><a href="https://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#intro-modes"> - Read about the 'Build' mode - </a></li> - <li><a href="/"> - View your builds - </a></li> - </ul> - </p> - </div> - </div> - -{% endblock %}
Signature · 1 line
2.30.2