Merge lp:~fginther/uci-engine/add_ready_checkbox into lp:uci-engine

Proposed by Francis Ginther
Status: Merged
Approved by: Paul Larson
Approved revision: 910
Merged at revision: 915
Proposed branch: lp:~fginther/uci-engine/add_ready_checkbox
Merge into: lp:uci-engine
Diff against target: 92 lines (+50/-0)
2 files modified
tests/test_webui.py (+33/-0)
webui/tickets/static/tickets/webuiforms.js (+17/-0)
To merge this branch: bzr merge lp:~fginther/uci-engine/add_ready_checkbox
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Para Siva (community) Approve
Francis Ginther Pending
Review via email: mp+245245@code.launchpad.net

This proposal supersedes a proposal from 2014-12-05.

Commit message

Add "Ready to assign" checkbox to ticket create form.

* Sets current_workflow_step to 'Queued' when checked (upon form submission)

Description of the change

Add "Ready to assign" checkbox to ticket create form.

* Sets current_workflow_step to 'Queued' when checked (upon form submission)

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote : Posted in a previous version of this proposal

Joe,

Thanks for working on this.

Apart for the inline comment, can you extend the webui ticket creation test cover this new field ?

review: Needs Fixing
Revision history for this message
Celso Providelo (cprov) wrote : Posted in a previous version of this proposal

Joe,

To be clear, "Silo creating" + "In Progress" is the right step+status for this scenario.

Just a followup about the regarding the possible use of QUEUED, since it's value is greater than all CITRAIN-related constants, the status section will render full-checked, as it the ticket has completed itself successfully.

We can't mix CITRAIN & UCI-E step, because the way they were created, OTOH we can re-process completed ci-train tickets with UCI-E components if we need to (dropping the citrain-overlay and moving the ticket to QUEUED).

Revision history for this message
Para Siva (psivaa) wrote : Posted in a previous version of this proposal

+1, only an inline nitpick.

review: Approve
Revision history for this message
Francis Ginther (fginther) wrote : Posted in a previous version of this proposal

Sets the silo assigning spinner when checked. Looks good.

review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote : Posted in a previous version of this proposal

Attempt to merge into lp:uci-engine failed due to conflicts:

text conflict in tests/test_webui.py

Revision history for this message
Francis Ginther (fginther) wrote :

Merged trunk and update test_create_ticket_assignable() to meet new required fields.

Revision history for this message
Para Siva (psivaa) :
review: Approve
Revision history for this message
Celso Providelo (cprov) :
review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (119.5 KiB)

The attempt to merge lp:~fginther/uci-engine/add_ready_checkbox into lp:uci-engine failed. Below is the output from the failed tests.

Running cm...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
uploading webui-content.tgz to swift
Updating source dependencies...
Checking juju status
Private PPAs: disabled
Preparing local branch upload...
Uploading local branch, fingerprint 8ad508300eb8fd5751ea8fbcddfee19d47965049
Building charm: lander
Building charm: wsgi-app
Building charm: rabbitmq-worker
Building charm: chroot-builder
Building charm: key-secret-subordinate
Building charm: webui
Building charm: system-image-server
Installing keys from bzr+ssh://bazaar.launchpad.net/~ci-engineering-private/+junk/ci-airline-dev-keys/
Running juju-deployer -v -c /tmp/tmpOio8rb/deployer/relations.yaml -c /tmp/tmpOio8rb/deployer/services.yaml ci-airline
Tests running...
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testConnectFailed ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testProcessQueue ... OK (0.004 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testRunForever ... OK (0.103 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testSent ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp.TestProgressTrigger.testProgress ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testCancel ... OK (0.105 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testNoQueue ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testNoTicket ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageCalledProcessError ... OK (0.005 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageFail ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageKilled ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageSimple ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageUnexpected ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testSaveLastRun ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestTimer.testCBRuns ... OK (0.021 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestTimer.testCanCancel ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreConfig.test_invalid_auth_config ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreConfig.test_valid_auth_config ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreFileName.test_abspath ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreFileName.test_basename ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreFileName.test_relpath ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_deployer.TestDeployer.test_load_empty_single_config ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_deployer.TestDeployer.test_load_multiple_config ... OK (0.007 secs)
ci-utils.ci_utils.tests.test_deployer.TestDeployer.test_load_single_config ... OK ...

Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (60.0 KiB)

The attempt to merge lp:~fginther/uci-engine/add_ready_checkbox into lp:uci-engine failed. Below is the output from the failed tests.

2015-01-07 14:54:33 INFO juju.cmd supercommand.go:37 running jujud [1.20.14.1-precise-amd64 gc]
2015-01-07 14:54:33 DEBUG juju.agent agent.go:377 read agent config, format "1.18"
2015-01-07 14:54:33 INFO juju.jujud unit.go:78 unit agent unit-ci-airline-ts-django-0 start (1.20.14.1-precise-amd64 [gc])
2015-01-07 14:54:33 INFO juju.worker runner.go:260 start "api"
2015-01-07 14:54:34 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2015-01-07 14:54:34 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2015-01-07 14:54:34 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2015-01-07 14:54:34 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2015-01-07 14:54:34 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2015-01-07 14:54:34 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2015-01-07 14:54:34 INFO juju.worker runner.go:260 start "upgrader"
2015-01-07 14:54:34 INFO juju.worker runner.go:260 start "logger"
2015-01-07 14:54:34 DEBUG juju.worker.logger logger.go:35 initial log config: "<root>=DEBUG"
2015-01-07 14:54:34 INFO juju.worker runner.go:260 start "uniter"
2015-01-07 14:54:34 DEBUG juju.worker.logger logger.go:60 logger setup
2015-01-07 14:54:34 INFO juju.worker runner.go:260 start "apiaddressupdater"
2015-01-07 14:54:34 INFO juju.worker runner.go:260 start "rsyslog"
2015-01-07 14:54:34 DEBUG juju.worker.rsyslog worker.go:75 starting rsyslog worker mode 1 for "unit-ci-airline-ts-django-0" "tarmac-local"
2015-01-07 14:54:34 DEBUG juju.worker.logger logger.go:45 reconfiguring logging from "<root>=DEBUG" to "<root>=WARNING;unit=DEBUG"
2015-01-07 14:54:43 INFO juju-log Making dir /srv/ci-airline-ts-django/code/ root:root 555
2015-01-07 14:54:44 INFO juju-log Adding dependencies.
2015-01-07 14:54:44 INFO juju-log installing apt packages...
2015-01-07 14:54:46 INFO config-changed gpg: keyring `/tmp/tmpzv79Ta/secring.gpg' created
2015-01-07 14:54:46 INFO config-changed gpg: keyring `/tmp/tmpzv79Ta/pubring.gpg' created
2015-01-07 14:54:46 INFO config-changed gpg: requesting key 6A8DFC40 from hkp server keyserver.ubuntu.com
2015-01-07 14:54:46 INFO config-changed gpg: /tmp/tmpzv79Ta/trustdb.gpg: trustdb created
2015-01-07 14:54:46 INFO config-changed gpg: key 6A8DFC40: public key "Launchpad PPA for Canonical CI Engineering" imported
2015-01-07 14:54:46 INFO config-changed gpg: Total number processed: 1
2015-01-07 14:54:46 INFO config-changed gpg: imported: 1 (RSA: 1)
2015-01-07 14:54:51 INFO config-changed OK
2015-01-07 14:54:52 INFO config-changed Get:1 http://ubuntu-cloud.archive.canonical.com precise-updates/cloud-tools Release.gpg [543 B]
2015-01-07 14:54:52 INFO config-changed Get:2 http://ppa.launchpad.net precise Release.gpg [316 B]
2015-01-07 14:54:52 INFO config-changed Hit http://ubuntu-cloud.archive.canonical.com precise-updates/cloud-tools Release
2015-01-07 14:54:57 INFO config-changed Get...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/test_webui.py'
2--- tests/test_webui.py 2014-12-18 21:37:15 +0000
3+++ tests/test_webui.py 2014-12-19 21:52:34 +0000
4@@ -30,6 +30,7 @@
5 get_elements_by_css,
6 get_link_url,
7 set_base_url,
8+ set_checkbox_value,
9 set_window_size,
10 wait_for,
11 write_textfield,
12@@ -74,6 +75,38 @@
13 self.assertEqual(
14 'yui3-pagview-container', paginator.get_attribute("class"))
15
16+ def test_create_ticket_assignable(self):
17+ # Create a ticket via WebUI form.
18+ go_to('/create')
19+ assert_title('Ubuntu CI Engine')
20+ title_text = 'Testing Webui'
21+
22+ wait_for(get_element, tag='form')
23+
24+ # Submit the form with the required fields.
25+ title = get_element_by_css('input[name="title"]')
26+ write_textfield(title, title_text)
27+ landers = get_element_by_css('input[name="landers"]')
28+ write_textfield(landers, 'foo@bar.com')
29+ sources = get_element_by_css('textarea[name="sources"]')
30+ write_textfield(sources, 'testsource')
31+ test_notes = get_element_by_css('textarea[name="test_notes"]')
32+ write_textfield(test_notes, 'test this')
33+ assignable = get_element_by_css('input[name="assignable"]')
34+ set_checkbox_value(assignable, True)
35+
36+ submit = get_element_by_css('input[type="submit"]')
37+ click_button(submit, wait=True)
38+
39+ # Redirects to the ticket page.
40+ # XXX: this is fragile since at some point there might be two 'h2' tags
41+ ticket_title = wait_for(get_element, tag='h2')
42+ self.assertEqual(title_text, ticket_title.text)
43+
44+ spinners = get_elements_by_css('img[title="Silo creating"]')
45+ self.assertEqual(1, len(spinners),
46+ "Silo creating spinner is not shown on the page")
47+
48 def test_create_ticket_fails_without_required_fields(self):
49 # Creating a ticket without required fields should show errors
50 go_to('/create')
51
52=== modified file 'webui/tickets/static/tickets/webuiforms.js'
53--- webui/tickets/static/tickets/webuiforms.js 2014-12-18 20:27:04 +0000
54+++ webui/tickets/static/tickets/webuiforms.js 2014-12-19 21:52:34 +0000
55@@ -115,6 +115,20 @@
56 },
57
58 /**
59+ * Set current workflow step based on 'assignable' state.
60+ *
61+ * @method _mangleFormAssignable
62+ */
63+ _mangleFormAssignable: function (form_data) {
64+ if (form_data['assignable']) {
65+ form_data['current_workflow_step'] = 'Silo creating';
66+ form_data['status'] = 'In progress';
67+ };
68+ delete form_data['assignable'];
69+ return form_data;
70+ },
71+
72+ /**
73 * Setup a form for creating a new ticket.
74 *
75 * Uses Y.Form() to build and render the form dynamically and
76@@ -154,6 +168,8 @@
77 type: 'TextareaField'},
78 {name: 'comments', label: 'Comments:',
79 type: 'TextareaField'},
80+ {name: 'assignable', label: 'Ready to assign:',
81+ type: 'CheckboxField'},
82 {name: 'create-button', type: 'SubmitButton',
83 value: 'Create!'}
84 ]
85@@ -190,6 +206,7 @@
86 form_data = Y.webuiforms._mangleFormSources(form_data);
87 form_data = Y.webuiforms._mangleFormCitrain(form_data);
88 form_data = Y.webuiforms._mangleFormReviews(form_data);
89+ form_data = Y.webuiforms._mangleFormAssignable(form_data);
90 form_data['workflow'] = {'name': 'citrain'};
91
92 Y.io(f.get('action'), {

Subscribers

People subscribed via source and target branches