From bfe6afcd7ac5ae7b6f07caa7b02a33fec710ebda Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 28 Apr 2011 17:58:13 -0500 Subject: Rename isotests to releng Signed-off-by: Dan McGee --- releng/views.py | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 releng/views.py (limited to 'releng/views.py') diff --git a/releng/views.py b/releng/views.py new file mode 100644 index 00000000..5cffb2f5 --- /dev/null +++ b/releng/views.py @@ -0,0 +1,132 @@ +from django import forms +from django.conf import settings +from django.http import Http404 +from django.shortcuts import get_object_or_404, redirect +from django.views.generic.simple import direct_to_template + +from .models import (Architecture, BootType, Bootloader, ClockChoice, + Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, + Test) + +def standard_field(model, help_text=None): + return forms.ModelChoiceField(queryset=model.objects.all(), + widget=forms.RadioSelect(), empty_label=None, help_text=help_text) + +class TestForm(forms.ModelForm): + iso = forms.ModelChoiceField(queryset=Iso.objects.filter(active=True)) + architecture = standard_field(Architecture) + iso_type = standard_field(IsoType) + boot_type = standard_field(BootType) + hardware_type = standard_field(HardwareType) + install_type = standard_field(InstallType) + source = standard_field(Source) + clock_choice = standard_field(ClockChoice) + filesystem = standard_field(Filesystem, + help_text="Check the installed system, including fstab.") + modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), + help_text="", widget=forms.CheckboxSelectMultiple(), required=False) + bootloader = standard_field(Bootloader) + rollback_filesystem = forms.ModelChoiceField(queryset=Filesystem.objects.all(), + help_text="If you did a rollback followed by a new attempt to setup " \ + "your lockdevices/filesystems, select which option you took here.", + widget=forms.RadioSelect(), required=False) + rollback_modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), + help_text="If you did a rollback followed b a new attempt to setup " \ + "your lockdevices/filesystems, select which option you took here.", + widget=forms.CheckboxSelectMultiple(), required=False) + success = forms.BooleanField(help_text="Only check this if everything went fine. " \ + "If you you ran into any errors please specify them in the " \ + "comments.", required=False) + website = forms.CharField(label='', + widget=forms.TextInput(attrs={'style': 'display:none;'}), required=False) + + class Meta: + model = Test + fields = ("user_name", "user_email", "iso", "architecture", + "iso_type", "boot_type", "hardware_type", + "install_type", "source", "clock_choice", "filesystem", + "modules", "bootloader", "rollback_filesystem", + "rollback_modules", "success", "comments") + widgets = { + "modules": forms.CheckboxSelectMultiple(), + } + +def submit_test_result(request): + if request.POST: + form = TestForm(request.POST) + if form.is_valid() and request.POST['website'] == '': + test = form.save(commit=False) + test.ip_address = request.META.get("REMOTE_ADDR", None) + test.save() + return redirect('releng-test-thanks') + else: + form = TestForm() + + context = {'form': form} + return direct_to_template(request, 'releng/add.html', context) + +def calculate_option_overview(model, is_rollback=False): + option = { + 'option': model, + 'name': model._meta.verbose_name, + 'is_rollback': is_rollback, + 'values': [] + } + for value in model.objects.all(): + data = { 'value': value } + if is_rollback: + data['success'] = value.get_last_rollback_success() + data['failure'] = value.get_last_rollback_failure() + else: + data['success'] = value.get_last_success() + data['failure'] = value.get_last_failure() + option['values'].append(data) + + return option + +def test_results_overview(request): + # data structure produced: + # [ { option, name, is_rollback, values: [ { value, success, failure } ... ] } ... ] + all_options = [] + models = [ Architecture, IsoType, BootType, HardwareType, InstallType, + Source, ClockChoice, Filesystem, Module, Bootloader ] + for model in models: + all_options.append(calculate_option_overview(model)) + # now handle rollback options + for model in [ Filesystem, Module ]: + all_options.append(calculate_option_overview(model, True)) + + print all_options + context = { + 'options': all_options, + 'iso_url': settings.ISO_LIST_URL, + } + return direct_to_template(request, 'releng/results.html', context) + +def test_results_iso(request, iso_id): + iso = get_object_or_404(Iso, pk=iso_id) + test_list = iso.test_set.all() + context = { + 'iso_name': iso.name, + 'test_list': test_list + } + return direct_to_template(request, 'releng/result_list.html', context) + +def test_results_for(request, option, value): + if option not in Test._meta.get_all_field_names(): + raise Http404 + option_model = getattr(Test, option).field.rel.to + real_value = get_object_or_404(option_model, pk=value) + test_list = real_value.test_set.order_by("iso__name", "pk") + context = { + 'option': option, + 'value': real_value, + 'value_id': value, + 'test_list': test_list + } + return direct_to_template(request, 'releng/result_list.html', context) + +def submit_test_thanks(request): + return direct_to_template(request, "releng/thanks.html", None) + +# vim: set ts=4 sw=4 et: -- cgit v1.2.3-54-g00ecf From 1ab065a982f489368b88ae67ec2997ed2777519a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 29 Apr 2011 09:31:16 -0500 Subject: releng: enhance admin, remove errant print statement Signed-off-by: Dan McGee --- releng/admin.py | 26 +++++++++++++++++++------- releng/views.py | 1 - 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'releng/views.py') diff --git a/releng/admin.py b/releng/admin.py index 10acaa98..3d3e7c0b 100644 --- a/releng/admin.py +++ b/releng/admin.py @@ -1,18 +1,30 @@ from django.contrib import admin from .models import (Architecture, BootType, Bootloader, ClockChoice, - Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source) + Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, + Test) + +class IsoAdmin(admin.ModelAdmin): + list_display = ('name', 'created', 'active') + list_filter = ('active',) + +class TestAdmin(admin.ModelAdmin): + list_display = ('user_name', 'user_email', 'created', 'ip_address', 'iso', 'success') + list_filter = ('success', 'iso') + -admin.site.register(Iso) admin.site.register(Architecture) -admin.site.register(IsoType) admin.site.register(BootType) -admin.site.register(HardwareType) -admin.site.register(InstallType) -admin.site.register(Source) +admin.site.register(Bootloader) admin.site.register(ClockChoice) admin.site.register(Filesystem) +admin.site.register(HardwareType) +admin.site.register(InstallType) +admin.site.register(IsoType) admin.site.register(Module) -admin.site.register(Bootloader) +admin.site.register(Source) + +admin.site.register(Iso, IsoAdmin) +admin.site.register(Test, TestAdmin) # vim: set ts=4 sw=4 et: diff --git a/releng/views.py b/releng/views.py index 5cffb2f5..973cf330 100644 --- a/releng/views.py +++ b/releng/views.py @@ -96,7 +96,6 @@ def test_results_overview(request): for model in [ Filesystem, Module ]: all_options.append(calculate_option_overview(model, True)) - print all_options context = { 'options': all_options, 'iso_url': settings.ISO_LIST_URL, -- cgit v1.2.3-54-g00ecf From abb3ae1502ea66d93d1d12487b195a6c6b8de35b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 29 Apr 2011 09:33:30 -0500 Subject: releng: make rollback fs a standard_option Signed-off-by: Dan McGee --- releng/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'releng/views.py') diff --git a/releng/views.py b/releng/views.py index 973cf330..f23869f7 100644 --- a/releng/views.py +++ b/releng/views.py @@ -8,9 +8,10 @@ Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, Test) -def standard_field(model, help_text=None): +def standard_field(model, help_text=None, required=True): return forms.ModelChoiceField(queryset=model.objects.all(), - widget=forms.RadioSelect(), empty_label=None, help_text=help_text) + widget=forms.RadioSelect(), empty_label=None, help_text=help_text, + required=required) class TestForm(forms.ModelForm): iso = forms.ModelChoiceField(queryset=Iso.objects.filter(active=True)) @@ -26,10 +27,10 @@ class TestForm(forms.ModelForm): modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), help_text="", widget=forms.CheckboxSelectMultiple(), required=False) bootloader = standard_field(Bootloader) - rollback_filesystem = forms.ModelChoiceField(queryset=Filesystem.objects.all(), + rollback_filesystem = standard_field(Filesystem, help_text="If you did a rollback followed by a new attempt to setup " \ "your lockdevices/filesystems, select which option you took here.", - widget=forms.RadioSelect(), required=False) + required=False) rollback_modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), help_text="If you did a rollback followed b a new attempt to setup " \ "your lockdevices/filesystems, select which option you took here.", -- cgit v1.2.3-54-g00ecf From 2d02bf77196b830f3c0022306188147f998afe0b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 2 May 2011 11:18:39 -0500 Subject: releng: fix FS#24021, allow unselection of rollback FS Signed-off-by: Dan McGee --- releng/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'releng/views.py') diff --git a/releng/views.py b/releng/views.py index f23869f7..f3c48cc1 100644 --- a/releng/views.py +++ b/releng/views.py @@ -8,10 +8,10 @@ Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, Test) -def standard_field(model, help_text=None, required=True): +def standard_field(model, empty_label=None, help_text=None, required=True): return forms.ModelChoiceField(queryset=model.objects.all(), - widget=forms.RadioSelect(), empty_label=None, help_text=help_text, - required=required) + widget=forms.RadioSelect(), empty_label=empty_label, + help_text=help_text, required=required) class TestForm(forms.ModelForm): iso = forms.ModelChoiceField(queryset=Iso.objects.filter(active=True)) @@ -30,7 +30,7 @@ class TestForm(forms.ModelForm): rollback_filesystem = standard_field(Filesystem, help_text="If you did a rollback followed by a new attempt to setup " \ "your lockdevices/filesystems, select which option you took here.", - required=False) + empty_label="N/A (did not rollback)", required=False) rollback_modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), help_text="If you did a rollback followed b a new attempt to setup " \ "your lockdevices/filesystems, select which option you took here.", -- cgit v1.2.3-54-g00ecf From 5a417bd7e24e1001a6219c18dac1e2a424982b65 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 2 May 2011 11:25:40 -0500 Subject: releng: ensure we save M2M values from submission form Whoops- forgot to add this rather important call back in here when I made the form not auto-commit. Fixes FS#24019. Signed-off-by: Dan McGee --- releng/views.py | 1 + 1 file changed, 1 insertion(+) (limited to 'releng/views.py') diff --git a/releng/views.py b/releng/views.py index f3c48cc1..ae9c8682 100644 --- a/releng/views.py +++ b/releng/views.py @@ -59,6 +59,7 @@ def submit_test_result(request): test = form.save(commit=False) test.ip_address = request.META.get("REMOTE_ADDR", None) test.save() + form.save_m2m() return redirect('releng-test-thanks') else: form = TestForm() -- cgit v1.2.3-54-g00ecf From 03bc3e619f311e11323be5bfce57ebd0842e6595 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 8 May 2011 18:02:55 +0200 Subject: releng: clarify some text and options Signed-off-by: Dieter Plaetinck Signed-off-by: Dan McGee --- releng/fixtures/installtype.json | 2 +- releng/fixtures/source.json | 4 ++-- releng/views.py | 6 ++++-- templates/releng/add.html | 15 +++++++++++---- templates/releng/results.html | 4 ++++ 5 files changed, 22 insertions(+), 9 deletions(-) (limited to 'releng/views.py') diff --git a/releng/fixtures/installtype.json b/releng/fixtures/installtype.json index 7fa21fc1..07d17f28 100644 --- a/releng/fixtures/installtype.json +++ b/releng/fixtures/installtype.json @@ -24,7 +24,7 @@ "pk": 4, "model": "releng.installtype", "fields": { - "name": "automatic install custom config (specify in comments)" + "name": "automatic install custom config (if special, specify in comments)" } } ] diff --git a/releng/fixtures/source.json b/releng/fixtures/source.json index 2622f4c1..9d1950a5 100644 --- a/releng/fixtures/source.json +++ b/releng/fixtures/source.json @@ -3,14 +3,14 @@ "pk": 1, "model": "releng.source", "fields": { - "name": "net install manual networking config (Check that it works + rc.conf, resolv.conf, mirrorlist)" + "name": "net install manual networking config (verify network, rc.conf, resolv.conf, mirrorlist)" } }, { "pk": 2, "model": "releng.source", "fields": { - "name": "net install dhcp (Check that it works + rc.conf)" + "name": "net install dhcp (verify network, rc.conf, mirrorlist)" } }, { diff --git a/releng/views.py b/releng/views.py index ae9c8682..70aaaf52 100644 --- a/releng/views.py +++ b/releng/views.py @@ -23,10 +23,12 @@ class TestForm(forms.ModelForm): source = standard_field(Source) clock_choice = standard_field(ClockChoice) filesystem = standard_field(Filesystem, - help_text="Check the installed system, including fstab.") + help_text="verify /etc/fstab, `df -hT` output and commands like " \ + "lvdisplay for special modules") modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), help_text="", widget=forms.CheckboxSelectMultiple(), required=False) - bootloader = standard_field(Bootloader) + bootloader = standard_field(Bootloader, + help_text="Verify that the entries in the bootloader config look ok") rollback_filesystem = standard_field(Filesystem, help_text="If you did a rollback followed by a new attempt to setup " \ "your lockdevices/filesystems, select which option you took here.", diff --git a/templates/releng/add.html b/templates/releng/add.html index 3678532d..8488b40c 100644 --- a/templates/releng/add.html +++ b/templates/releng/add.html @@ -6,10 +6,17 @@

Arch Releng Testbuild Feedback Entry

-

This page allows you to submit feedback after testing and using a - release engineering install ISO. If you do not currently have feedback to - submit, you may want to take a look at the current - results page.

+

This page allows you to submit feedback after testing an Arch Linux installation + using a release engineering testbuild. Mark all the options you used during the + installation; at the end you can specify whether everything went OK. Be + sure to only denote a successful install after having checked the + installation properly. Some options require you to check several things (such as + config files), this will be mentioned alongside the option.

+

There is also an overview of all feedback on the + results page. Once we have + builds that are properly tested (enough successful feedback for all + important features of the ISO or a slightly earlier ISO), we can release new + official media.

{% csrf_token %} {{ form.as_p }} diff --git a/templates/releng/results.html b/templates/releng/results.html index 4aca1f10..d7708cb7 100644 --- a/templates/releng/results.html +++ b/templates/releng/results.html @@ -13,6 +13,10 @@

Release Engineering Testbuild Results

if you have tested and used any ISOs. Both successful and failed results are encouraged and welcome.

+

For more information, see the documentation + on the wiki

+

All ISOs referenced on this page are available from {{ iso_url }}.

-- cgit v1.2.3-54-g00ecf From 9881ba5c238edbaec3b9c6f38b00a6a39ff168b4 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 8 May 2011 18:02:56 +0200 Subject: releng: fix typos Signed-off-by: Dieter Plaetinck Signed-off-by: Dan McGee --- releng/views.py | 6 +++--- templates/releng/results.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'releng/views.py') diff --git a/releng/views.py b/releng/views.py index 70aaaf52..0f81948c 100644 --- a/releng/views.py +++ b/releng/views.py @@ -31,11 +31,11 @@ class TestForm(forms.ModelForm): help_text="Verify that the entries in the bootloader config look ok") rollback_filesystem = standard_field(Filesystem, help_text="If you did a rollback followed by a new attempt to setup " \ - "your lockdevices/filesystems, select which option you took here.", + "your blockdevices/filesystems, select which option you took here.", empty_label="N/A (did not rollback)", required=False) rollback_modules = forms.ModelMultipleChoiceField(queryset=Module.objects.all(), - help_text="If you did a rollback followed b a new attempt to setup " \ - "your lockdevices/filesystems, select which option you took here.", + help_text="If you did a rollback followed by a new attempt to setup " \ + "your blockdevices/filesystems, select which option you took here.", widget=forms.CheckboxSelectMultiple(), required=False) success = forms.BooleanField(help_text="Only check this if everything went fine. " \ "If you you ran into any errors please specify them in the " \ diff --git a/templates/releng/results.html b/templates/releng/results.html index d7708cb7..70d0f618 100644 --- a/templates/releng/results.html +++ b/templates/releng/results.html @@ -6,7 +6,7 @@

Release Engineering Testbuild Results

-

This is a overview screen showing a test results matrix of release +

This is an overview screen showing a test results matrix of release engineering produced ISOs. Various options and configurations are shown with last success and last failure results, if known. To help improve ISO quality, you are encouraged to give feedback -- cgit v1.2.3-54-g00ecf From 972b010743e5e8844fda8e9862c85289541eb621 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 10 May 2011 14:38:37 -0500 Subject: Ensure releng modules links work correctly Signed-off-by: Dan McGee --- releng/views.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'releng/views.py') diff --git a/releng/views.py b/releng/views.py index 0f81948c..a810bbbc 100644 --- a/releng/views.py +++ b/releng/views.py @@ -69,10 +69,13 @@ def submit_test_result(request): context = {'form': form} return direct_to_template(request, 'releng/add.html', context) -def calculate_option_overview(model, is_rollback=False): +def calculate_option_overview(field_name): + field = Test._meta.get_field(field_name) + model = field.rel.to + is_rollback = field_name.startswith('rollback_') option = { 'option': model, - 'name': model._meta.verbose_name, + 'name': field_name, 'is_rollback': is_rollback, 'values': [] } @@ -92,13 +95,11 @@ def test_results_overview(request): # data structure produced: # [ { option, name, is_rollback, values: [ { value, success, failure } ... ] } ... ] all_options = [] - models = [ Architecture, IsoType, BootType, HardwareType, InstallType, - Source, ClockChoice, Filesystem, Module, Bootloader ] - for model in models: - all_options.append(calculate_option_overview(model)) - # now handle rollback options - for model in [ Filesystem, Module ]: - all_options.append(calculate_option_overview(model, True)) + fields = [ 'architecture', 'iso_type', 'boot_type', 'hardware_type', + 'install_type', 'source', 'clock_choice', 'filesystem', 'modules', + 'bootloader', 'rollback_filesystem', 'rollback_modules' ] + for field in fields: + all_options.append(calculate_option_overview(field)) context = { 'options': all_options, -- cgit v1.2.3-54-g00ecf