Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only push updates that have all builds marked as signed #1011

Merged
merged 3 commits into from
Oct 18, 2016

Conversation

puiterwijk
Copy link
Contributor

@puiterwijk puiterwijk commented Oct 7, 2016

This PR will make Bodhi play along nicely with RoboSignatory.

% if build.signed
<span class="glyphicon glyphicon-unlock"></span>
% else
<span class="glyphicon glyphicon-lock"></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the lock and unlock icons might be backwards here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -71,19 +72,27 @@ def push(username, password, cert_prefix, **kwargs):
updates.append(update)
click.echo(update)
else:
config_uri = '/etc/bodhi/production.ini'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to make this non-hardcoded, especially if we want to be able to unit test this module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, made it an optional argument, which defaults to production.ini

@puiterwijk puiterwijk changed the title [WIP] Only push updates that have all builds marked as signed Only push updates that have all builds marked as signed Oct 7, 2016
@puiterwijk
Copy link
Contributor Author

This pull request is no longer WIP, and should be ready.

@puiterwijk
Copy link
Contributor Author

My last commit makes us lock the updates as we're sending them off to the masher.
This would make sure that updates are locked the moment they're sent off, instead of some arbitrary time later.
I can back it out if we don't want it in though, as it's not related to the rest of my patch, but it was just easy to throw it in.

@puiterwijk puiterwijk added Critical We can't go on living in this sqalor, drop everything and fix it! Composer Issues related to the composer labels Oct 7, 2016
@puiterwijk puiterwijk added this to the 2.3 milestone Oct 7, 2016
@puiterwijk puiterwijk force-pushed the sign-request branch 2 times, most recently from 32f45b1 to ef48383 Compare October 8, 2016 14:56
@bowlofeggs bowlofeggs self-assigned this Oct 11, 2016
click.echo('\nLocking updates...')
for update in updates:
update.locked = True
update.date_locked = datetime.utcnow()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to commit the transaction after this for loop is done. Otherwise, we will send the message to start the mash and commit the transaction, rather than committing the transaction and then starting the mash. I know this is a race we are likely to win, but it's a race that easy to avoid ☺

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

<td>Request</td><td>${self.util.request2html(update.request) | n}</td>
<td>Request</td><td>${self.util.request2html(update.request) | n}
% if not update.signed
<span class="glyphicon glyphicon-unlock"></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to add hoverover texts explaining what these icons mean, otherwise they might just be mysterious to people.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -495,6 +495,7 @@ class Build(Base):
package_id = Column(Integer, ForeignKey('packages.id'))
release_id = Column(Integer, ForeignKey('releases.id'))
update_id = Column(Integer, ForeignKey('updates.id'))
signed = Column(Boolean, default=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to go ahead and slap a nullable=False on this guy, just to be opinionated about it. (I think a lot of fields should have this, but I can deal with that another day).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

from bodhi.server.models import Base, Build, Release

import logging
log = logging.getLogger('bodhi')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For PEP-8, let's regroup these imports:

import logging
import pprint

import fedmsg.consumers
from pyramid.paster import get_appsettings
from sqlalchemy import engine_from_config

from bodhi.server.util import transactional_session_maker
from bodhi.server.models import Base, Build, Release

That way I don't have to fix that when I get around to adding this new module to flake8's automatic test ☺

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

"""
config_key = 'signed_handler'

def __init__(self, hub, db_factory=None, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write a docblock here, describing the arguments? It would be helpful to know when/why the db_factory might be None.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will never be a db_factory. I just killed that.

self.settings = get_appsettings(config_uri)
engine = engine_from_config(self.settings, 'sqlalchemy.')
Base.metadata.create_all(engine)
self.db_factory = transactional_session_maker(engine)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code like this is repeated around Bodhi, and actually appears twice in this pull request. I think it makes sense to make this a utility function and call it from the places than need the db_factory.


log.info("Signed Handler handling %s, %s" % (alias, topic))

build_nvr = '%(name)s-%(version)s-%(release)s' % msg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the epoch not supposed to be considered here?

Copy link
Contributor Author

@puiterwijk puiterwijk Oct 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is taken as part of version.

Copy link
Contributor Author

@puiterwijk puiterwijk Oct 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better: epoch is totally ignored by bodhi, everywhere. (and in koji build identification too btw)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hahah, well that sounds like something I should probably fix eventually. Since that's the case I agree we can ignore for this PR.

build = Build.get(build_nvr, session)
if not build:
log.info("Build was not submitted, skipping")
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a build gets signed before being submitted to Bodhi, how will the Build.signed column get updated? It seems like this would be the more common case, since I'd expect signing to happen shortly after the build. Or does the signing not happen until the build is submitted as an update by Bodhi typically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signing is only done after the update is submitted to bodhi: the tagging into the pending-signing tag will trigger it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic.

@bowlofeggs
Copy link
Contributor

Here's a migration starter-pack, but I think you should adjust it to make the signed column non-nullable. To do that, you probably need to do something like making the column nullable, going and setting all Builds to the default value (False, right?), then converting the column to be non-nullable:

[vagrant@localhost vagrant]$ alembic revision --autogenerate -m "Add a signed column to the Builds model."
WARNING:fedmsg.crypto.x509:Crypto disabled ImportError('No module named M2Crypto',)
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.ddl.postgresql] Detected sequence named 'users_id_seq' as owned by integer column 'users(id)', assuming SERIAL and omitting
INFO  [alembic.ddl.postgresql] Detected sequence named 'builds_id_seq' as owned by integer column 'builds(id)', assuming SERIAL and omitting
INFO  [alembic.ddl.postgresql] Detected sequence named 'comment_bug_assoc_id_seq' as owned by integer column 'comment_bug_assoc(id)', assuming SERIAL and omitting
INFO  [alembic.ddl.postgresql] Detected sequence named 'comment_testcase_assoc_id_seq' as owned by integer column 'comment_testcase_assoc(id)', assuming SERIAL and omitting
INFO  [alembic.ddl.postgresql] Detected sequence named 'buildroot_overrides_id_seq' as owned by integer column 'buildroot_overrides(id)', assuming SERIAL and omitting
INFO  [alembic.autogenerate.compare] Detected added column 'builds.signed'
  Generating /vagrant/alembic/versions/3cde3882442a_add_a_signed_column_to_the_builds_model.py ... done
[vagrant@localhost vagrant]$ cat alembic/versions/3cde3882442a_add_a_signed_column_to_the_builds_model.py
"""Add a signed column to the Builds model.

Revision ID: 3cde3882442a
Revises: 4df1fcd59050
Create Date: 2016-10-11 19:37:30.847965

"""

# revision identifiers, used by Alembic.
revision = '3cde3882442a'
down_revision = '4df1fcd59050'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('builds', sa.Column('signed', sa.Boolean(), nullable=True))
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('builds', 'signed')
    ### end Alembic commands ###

@bowlofeggs
Copy link
Contributor

bowlofeggs commented Oct 11, 2016

There seems to be some problem with the DeclEnumType class that is causing this code to blow up when looping on the Builds:

[vagrant@localhost vagrant]$ bodhi-push --config /vagrant/development.ini
WARNING:fedmsg.crypto.x509:Crypto disabled ImportError('No module named M2Crypto',)
Traceback (most recent call last):
  File "/usr/bin/bodhi-push", line 9, in <module>
    load_entry_point('bodhi-server', 'console_scripts', 'bodhi-push')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/vagrant/bodhi/server/push.py", line 97, in push
    for update in query.all():
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2613, in all
    return list(self)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2761, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2776, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1078, in _execute_context
    None, None)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1073, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 600, in _init_compiled
    for key in compiled_params
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 600, in <genexpr>
    for key in compiled_params
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/type_api.py", line 982, in process
    return process_param(value, dialect)
  File "/vagrant/bodhi/server/models/enum.py", line 109, in process_bind_param
    return value.value
sqlalchemy.exc.StatementError: (exceptions.AttributeError) 'unicode' object has no attribute 'value' [SQL: u'SELECT updates.id AS updates_id, updates.title AS updates_title, updates.karma AS updates_karma, updates.autokarma AS updates_autokarma, updates.stable_karma AS updates_stable_karma, updates.unstable_karma AS updates_unstable_karma, updates.requirements AS updates_requirements, updates.require_bugs AS updates_require_bugs, updates.require_testcases AS updates_require_testcases, updates.notes AS updates_notes, updates.type AS updates_type, updates.status AS updates_status, updates.request AS updates_request, updates.severity AS updates_severity, updates.suggest AS updates_suggest, updates.locked AS updates_locked, updates.pushed AS updates_pushed, updates.critpath AS updates_critpath, updates.close_bugs AS updates_close_bugs, updates.date_submitted AS updates_date_submitted, updates.date_modified AS updates_date_modified, updates.date_approved AS updates_date_approved, updates.date_pushed AS updates_date_pushed, updates.date_testing AS updates_date_testing, updates.date_stable AS updates_date_stable, updates.date_locked AS updates_date_locked, updates.alias AS updates_alias, updates.old_updateid AS updates_old_updateid, updates.release_id AS updates_release_id, updates.user_id AS updates_user_id, releases_1.id AS releases_1_id, releases_1.name AS releases_1_name, releases_1.long_name AS releases_1_long_name, releases_1.version AS releases_1_version, releases_1.id_prefix AS releases_1_id_prefix, releases_1.branch AS releases_1_branch, releases_1.dist_tag AS releases_1_dist_tag, releases_1.stable_tag AS releases_1_stable_tag, releases_1.testing_tag AS releases_1_testing_tag, releases_1.candidate_tag AS releases_1_candidate_tag, releases_1.pending_signing_tag AS releases_1_pending_signing_tag, releases_1.pending_testing_tag AS releases_1_pending_testing_tag, releases_1.pending_stable_tag AS releases_1_pending_stable_tag, releases_1.override_tag AS releases_1_override_tag, releases_1.state AS releases_1_state, comments_1.id AS comments_1_id, comments_1.karma AS comments_1_karma, comments_1.karma_critpath AS comments_1_karma_critpath, comments_1.text AS comments_1_text, comments_1.anonymous AS comments_1_anonymous, comments_1.timestamp AS comments_1_timestamp, comments_1.update_id AS comments_1_update_id, comments_1.user_id AS comments_1_user_id, releases_2.id AS releases_2_id, releases_2.name AS releases_2_name, releases_2.long_name AS releases_2_long_name, releases_2.version AS releases_2_version, releases_2.id_prefix AS releases_2_id_prefix, releases_2.branch AS releases_2_branch, releases_2.dist_tag AS releases_2_dist_tag, releases_2.stable_tag AS releases_2_stable_tag, releases_2.testing_tag AS releases_2_testing_tag, releases_2.candidate_tag AS releases_2_candidate_tag, releases_2.pending_signing_tag AS releases_2_pending_signing_tag, releases_2.pending_testing_tag AS releases_2_pending_testing_tag, releases_2.pending_stable_tag AS releases_2_pending_stable_tag, releases_2.override_tag AS releases_2_override_tag, releases_2.state AS releases_2_state, builds_1.id AS builds_1_id, builds_1.nvr AS builds_1_nvr, builds_1.epoch AS builds_1_epoch, builds_1.inherited AS builds_1_inherited, builds_1.package_id AS builds_1_package_id, builds_1.release_id AS builds_1_release_id, builds_1.update_id AS builds_1_update_id, builds_1.signed AS builds_1_signed, packages_1.id AS packages_1_id, packages_1.name AS packages_1_name, packages_1.requirements AS packages_1_requirements, packages_1.stack_id AS packages_1_stack_id, users_1.id AS users_1_id, users_1.name AS users_1_name, users_1.email AS users_1_email, users_1.show_popups AS users_1_show_popups, buildroot_overrides_1.id AS buildroot_overrides_1_id, buildroot_overrides_1.build_id AS buildroot_overrides_1_build_id, buildroot_overrides_1.submitter_id AS buildroot_overrides_1_submitter_id, buildroot_overrides_1.notes AS buildroot_overrides_1_notes, buildroot_overrides_1.submission_date AS buildroot_overrides_1_submission_date, buildroot_overrides_1.expiration_date AS buildroot_overrides_1_expiration_date, buildroot_overrides_1.expired_date AS buildroot_overrides_1_expired_date \nFROM updates LEFT OUTER JOIN releases AS releases_1 ON releases_1.id = updates.release_id LEFT OUTER JOIN comments AS comments_1 ON updates.id = comments_1.update_id LEFT OUTER JOIN builds AS builds_1 ON updates.id = builds_1.update_id LEFT OUTER JOIN releases AS releases_2 ON releases_2.id = builds_1.release_id LEFT OUTER JOIN packages AS packages_1 ON packages_1.id = builds_1.package_id LEFT OUTER JOIN buildroot_overrides AS buildroot_overrides_1 ON builds_1.id = buildroot_overrides_1.build_id LEFT OUTER JOIN users AS users_1 ON users_1.id = buildroot_overrides_1.submitter_id \nWHERE updates.request IN (%(request_1)s, %(request_2)s) ORDER BY comments_1.timestamp'] [parameters: [immutabledict({})]]

I'm going to try to reproduce this outside of your PR, and if I can I'll fix it in another PR.

@bowlofeggs
Copy link
Contributor

I've been able to reproduce the traceback on the value.value line outside of your pull request, so I've filed an issue about that at #1023

I'm going to go fix that and then come back to reviewing this PR so I can test it.

@bowlofeggs
Copy link
Contributor

bowlofeggs commented Oct 12, 2016

It turns out that you can't query with strings on the release, and that you have to use the enum when querying. You need to replace 'testing' in your query with models.UpdateRequest.testing.

We could get this merged more quickly if we didn't rely on me to do all the testing for this PR. The Vagrant environment is designed to be easy for contributors to get a development environment running without much hassle. All you need to do is install some packages, copy some files, and type "vagrant up" and off you go! See the README for details.

@puiterwijk
Copy link
Contributor Author

I would be more inclined to test if the official methods of getting it running actually worked, as there's also a virtualenv method in the documentation taht doesn't work at all, and I reported that before.

@bowlofeggs
Copy link
Contributor

There seems to be an issue with how the transaction commit is happening:

[vagrant@localhost ~]$ bodhi-push --config /vagrant/development.ini
WARNING:fedmsg.crypto.x509:Crypto disabled ImportError('No module named M2Crypto',)
Warning: libgphoto2-2.5.8-1.fc22 has unsigned builds and has been skipped
Warning: monitorix-3.8.1-1.fc21 has unsigned builds and has been skipped
Warning: libtirpc-0.3.2-5.rc3.fc22 has unsigned builds and has been skipped
<snip tons of lines like this>
Push these 0 updates? (y/n)y

Locking updates...
Traceback (most recent call last):
  File "/usr/bin/bodhi-push", line 9, in <module>
    load_entry_point('bodhi-server', 'console_scripts', 'bodhi-push')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/vagrant/bodhi/server/push.py", line 133, in push
    session.commit()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 801, in commit
    self.transaction.commit()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 392, in commit
    self._prepare_impl()
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 361, in _prepare_impl
    self.session.dispatch.before_commit(self.session)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/event/attr.py", line 256, in __call__
    fn(*args, **kw)
  File "/usr/lib/python2.7/site-packages/zope.sqlalchemy-0.7.7-py2.7.egg/zope/sqlalchemy/datamanager.py", line 254, in before_commit
    "Transaction must be committed using the transaction manager"
AssertionError: Transaction must be committed using the transaction manager

I think maybe we want transaction.commit() instead, but to be honest I'm still trying to wrap my head around how python-zope-sqlalchemy changes things from stock sqlalchemy.


def upgrade():
op.add_column('builds', sa.Column('signed', sa.Boolean(), nullable=True, default=False))
op.execute('''UPDATE "builds" SET signed=0;''')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had an IRC chat about this, and @puiterwijk and I both think that setting existing builds to True is better than setting them to False because existing builds that are signed will be labeled as unsigned and will be unpushable. Falsely listing Builds as signed will be OK because the autosigner will still get to them and they will become signed eventually (i.e., we will rely on eventual consistency).

This signature is a randomly generated UUID used to de-duplicate
alerts and version information. This signature is random, it is
not based on any personally identifiable information. To create
a new signature, you can simply delete this file at any time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, I have a .vagrant folder, not a .vagrant.d and only .vagrant is in the .gitignore. Can you remove these files from your commit? I'll make a PR to add .vagrant.d to the .gitignore for you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1045

P.S. I wonder if this is the way never Vagrant versions do it (since you are working on Rawhide)?

agent=username,
),
force=True,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this fedmsg to be outside of the transaction so that the transaction is committed before the message is sent? It could be bad if the transaction.commit() fails and we sent the message already, or if the message is received and processed before the transaction is committed somehow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hahah I think I was writing this comment right when you made the change, so my comment went on the code that was already changed. This looks good.

@puiterwijk puiterwijk force-pushed the sign-request branch 2 times, most recently from 2eb2df2 to e42cb9b Compare October 18, 2016 18:27
@bowlofeggs
Copy link
Contributor

bowlofeggs commented Oct 18, 2016

The migration seems to fail:

[vagrant@localhost vagrant]$ alembic upgrade head
WARNING:fedmsg.crypto.x509:Crypto disabled ImportError('No module named M2Crypto',)
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 5110dfc1a01a -> 4df1fcd59050, Add the new pending_signing_tag column to the releases table.
INFO  [alembic.runtime.migration] Running upgrade 4df1fcd59050 -> 3cde3882442a, Add a signed column to the Builds model.
Traceback (most recent call last):
  File "/usr/bin/alembic", line 9, in <module>
    load_entry_point('alembic==0.8.3', 'console_scripts', 'alembic')()
  File "/usr/lib/python2.7/site-packages/alembic/config.py", line 450, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/usr/lib/python2.7/site-packages/alembic/config.py", line 444, in main
    self.run_cmd(cfg, options)
  File "/usr/lib/python2.7/site-packages/alembic/config.py", line 427, in run_cmd
    **dict((k, getattr(options, k)) for k in kwarg)
  File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
    script.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 397, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "alembic/env.py", line 72, in <module>
    run_migrations_online()
  File "alembic/env.py", line 65, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/lib/python2.7/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/lib/python2.7/site-packages/alembic/runtime/migration.py", line 312, in run_migrations
    step.migration_fn(**kw)
  File "/vagrant/alembic/versions/3cde3882442a_add_signed_column_to_builds.py", line 19, in upgrade
    op.execute('''UPDATE "builds" SET signed=1;''')
  File "<string>", line 8, in execute
  File "<string>", line 3, in execute
  File "/usr/lib/python2.7/site-packages/alembic/operations/ops.py", line 1826, in execute
    return operations.invoke(op)
  File "/usr/lib/python2.7/site-packages/alembic/operations/base.py", line 318, in invoke
    return fn(self, operation)
  File "/usr/lib/python2.7/site-packages/alembic/operations/toimpl.py", line 161, in execute_sql
    execution_options=operation.execution_options
  File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 121, in execute
    self._exec(sql, execution_options)
  File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 118, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column "signed" is of type boolean but expression is of type integer
LINE 1: UPDATE "builds" SET signed=1;
                                   ^
HINT:  You will need to rewrite or cast the expression.
 [SQL: 'UPDATE "builds" SET signed=1;']

I suggest using sqlalchemy core to form the update query so that the right thing happens no matter what the backend is.

@bowlofeggs
Copy link
Contributor

There are five failing tests in this PR, and I think they are all similar. There is too much output to list here, so I'll just list one:

======================================================================
ERROR: test_push_to_stable_for_obsolete_update (bodhi.tests.server.functional.test_updates.TestUpdatesService)
Obsolete update should not be submitted to testing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/vagrant/bodhi/tests/server/functional/test_updates.py", line 1874, in test_push_to_stable_for_obsolete_update
    headers={'Accept': 'text/html'})
  File "/usr/lib/python2.7/site-packages/webtest/app.py", line 323, in get
    expect_errors=expect_errors)
  File "/usr/lib/python2.7/site-packages/webtest/app.py", line 632, in do_request
    self._check_status(status, res)
  File "/usr/lib/python2.7/site-packages/webtest/app.py", line 664, in _check_status
    res)
AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/updates/bodhi-2.0.0-2.fc17)





<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="management of Fedora Project updates" />
    <meta name="author" content="Luke Macken" />
    <meta name="author" content="Ralph Bean" />

    <!-- Only allow websockets connections to fedoraproject.org. -->
    <meta http-equiv="Content-Security-Policy" content="connect-src http://0.0.0.0:6543">

    <link rel="shortcut icon" href="http://localhost/static/ico/favicon.ico">

    <base href="http://0.0.0.0:6543"/>
        <title>Fedora Updates System</title>
    <link href="http://localhost/static/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="http://localhost/static/font-awesome-4.4.0/css/font-awesome.min.css" rel="stylesheet" />
    <link href="http://localhost/static/css/text.css" rel="stylesheet" />
    <link href="http://localhost/static/css/navbar.css" rel="stylesheet" />
    <link href="http://localhost/static/css/footer.css" rel="stylesheet" />
    <link href="http://localhost/static/css/site.css" rel="stylesheet" />
    <link href="http://localhost/static/css/datagrepper-feed.css" rel="stylesheet" />
    <link href="http://localhost/static/css/panel.css" rel="stylesheet" />
    <script src="http://localhost/static/js/jquery-1.10.2.min.js"></script>
    <script src="http://localhost/static/js/Chart-0.2.0.min.js"></script>
  </head>

  <body>
    <div id="wrap">
      <!-- Static navbar -->
      <div class="navbar navbar-default navbar-fixed-top">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target=".navbar-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="http://localhost/">
              Fedora Update System
            </a>
          </div>

          <div class="navbar-collapse collapse">
            <form id="search" role="search" class="nav navbar-form navbar-left">
              <div id="bloodhound" class="form-group">
                <input class="typeahead form-control" name="term" type="text" placeholder="Search...">
              </div>
            </form>

            <div class="clearfix hidden-md hidden-lg"></div>

            <ul class="nav navbar-nav navbar-right">
              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                  <span class="glyphicon glyphicon-plus"></span>
                  Create
                </a>
                <ul class="dropdown-menu">
                  <li><a href="http://localhost/updates/new">
                      New Update
                  </a></li>
                  <li><a href="http://localhost/overrides/new">
                      New Override
                  </a></li>
                </ul>
              </li>

              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                  <span class="glyphicon glyphicon-tags"></span>
                  Releases
                </a>
                <ul class="dropdown-menu">
                  <li>
                    <a href="http://localhost/metrics">
                      Overall Metrics
                    </a>
                  </li>
                  <li>
                    <a href="http://localhost/masher">
                      Masher Status
                    </a>
                  </li>
                  <li role="separator" class="divider"></li>
                  <li>
                    <a href="http://localhost/releases/F17">
                      Fedora 17
                    </a>
                  </li>
                </ul>
              </li>

              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                  <span class="glyphicon glyphicon-user"></span>
                  Profile
                </a>
                <ul class="dropdown-menu">

                  <li>
                    <a href="http://localhost/users/guest">
                      Your Profile
                    </a>
                  </li>
                  <li>
                    <a href="Noneguest.id.fedoraproject.org/">
                      Manage Alerts
                    </a>
                  </li>
                  <li>
                    <form id="popup_toggle" action="http://localhost/popup_toggle" method="POST">
                      <input type="hidden" name="next" value="http://localhost/updates/bodhi-2.0.0-2.fc17">
                    </form>
                    <a href="javascript:$('#popup_toggle').submit();">
                      Disable popups
                    </a>
                  </li>
                </ul>
              </li>


              <li>
                <a href="http://localhost/logout">
                  <span class="glyphicon glyphicon-log-out"></span>
                  Logout</a>
              </li>
            </ul>
          </div>
        </div><!--/.nav-collapse -->
      </div>

      <div class="container">


<div class="row">
  <div class="col-md-offset-3 col-md-6">
    <div class="panel error-page-panel">
      <h1>500 <small>Internal Server Error</small></h1>
      <p class="lead">Fragment 'if build.signed' is not a partial control statement in file '/vagrant/bodhi/server/templates/update.html' at line: 377 char: 1</p>
    </div>
  </div>
</div>

      </div>

      <div id="ghost-cabbage">
        <img src="http://localhost/static/img/logo-large.png"/>
      </div>
    </div> <!-- /#wrap -->

    <div id="footer">
      <div class="container">
        <p class="text-muted text-center"> Running
          <code>bodhi-2.2.4</code> on
          <code>localhost</code>.
        <a href="https://github.com/fedora-infra/bodhi">
        bodhi<span class="glyphicon glyphicon-link"></span></a> is Free Software.
        Please <a href="https://github.com/fedora-infra/bodhi/issues">
        file issues<span class="glyphicon glyphicon-link"></span></a>
        if you have any problems.  Copyright &copy; 2007-2016 Red Hat, Inc. and
        <a href="https://github.com/fedora-infra/bodhi/graphs/contributors">
        others<span class="glyphicon glyphicon-link"></span></a>.
        </p>
      </div>
    </div>

    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://localhost/static/jquery.flot.js"></script>
    <script src="http://localhost/static/jquery.flot.stack.js"></script>
    <script src="http://localhost/static/bootstrap/js/bootstrap.min.js"></script>
    <script src="http://localhost/static/moment/moment.min.js"></script>
    <script src="http://localhost/static/js/cabbage.js"></script>
    <script src="http://localhost/static/js/forms.js"></script>
    <script src="http://localhost/static/js/site.js"></script>
    <script src="http://localhost/static/js/live.js"></script>
    <script src="http://localhost/static/messenger/js/messenger.min.js"></script>
    <script src="http://localhost/static/messenger/js/messenger-theme-flat.js"></script>
    <link href="http://localhost/static/messenger/css/messenger.css" rel="stylesheet" />
    <link href="http://localhost/static/messenger/css/messenger-theme-flat.css" rel="stylesheet" />
    <script src="http://localhost/static/js/typeahead.bundle.js"></script>
    <script src="http://localhost/static/js/search.js"></script>
    <script src="http://localhost/static/js/konami.js"></script>


  </body>
</html>

-------------------- >> begin captured logging << --------------------
bodhi.server: DEBUG: Creating all models for Engine(sqlite://)
bodhi.server: DEBUG: Setting alias for bodhi-2.0-1.fc17 to FEDORA-2016-a3bbe1a8f2
dogpile.lock: DEBUG: NeedRegenerationException
dogpile.lock: DEBUG: no value, waiting for create lock
dogpile.lock: DEBUG: value creation lock <dogpile.cache.region._LockWrapper object at 0x7f06ed836350> acquired
dogpile.lock: DEBUG: Calling creation function
dogpile.lock: DEBUG: Released creation lock
bodhi.server: DEBUG: validated = {'close_bugs': True, 'stable_karma': 3, 'csrf_token': u'd9b59034f28ecbe6d677af75b99dd67384ed5659', 'requirements': u'rpmlint', 'builds': [u'bodhi-2.0.0-2.fc17'], 'autokarma': True, 'edited': '', 'suggest': <unspecified>, 'notes': u'this is a test update', 'request': <testing>, 'bugs': [], 'unstable_karma': -3, 'require_bugs': False, 'require_testcases': True, 'type': <bugfix>, 'severity': <unspecified>}
bodhi.server: DEBUG: Adding nvr bodhi-2.0.0-2.fc17
bodhi.server: INFO: Creating new update: [<Build {'epoch': 0, 'nvr': u'bodhi-2.0.0-2.fc17', 'signed': False}>]
bodhi.server: DEBUG: Creating new Update(**data) object.
bodhi.server: DEBUG: Assigning alias for new update..
bodhi.server: DEBUG: Setting alias for bodhi-2.0.0-2.fc17 to FEDORA-2016-033713b73b
bodhi.server: DEBUG: Setting request for new update.
bodhi.server: DEBUG: Attempting to set request <testing>
bodhi.server: DEBUG: Adding tag f17-updates-testing-signing to bodhi-2.0.0-2.fc17
bodhi: DEBUG: tagBuild(f17-updates-testing-signing, bodhi-2.0.0-2.fc17)
bodhi.server: DEBUG: bodhi-2.0.0-2.fc17 has been submitted for testing. 
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-2.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
bodhi.server: DEBUG: Adding new update to the db.
bodhi.server: DEBUG: Triggering db flush for new update.
bodhi.server: DEBUG: Done with Update.new(...)
bodhi.server: DEBUG: bodhi-2.0.0-2.fc17 update created
dogpile.lock: DEBUG: NeedRegenerationException
dogpile.lock: DEBUG: no value, waiting for create lock
dogpile.lock: DEBUG: value creation lock <dogpile.cache.region._LockWrapper object at 0x7f06ed56a350> acquired
dogpile.lock: DEBUG: Calling creation function
dogpile.lock: DEBUG: Released creation lock
bodhi.server: DEBUG: validated = {'close_bugs': True, 'stable_karma': 3, 'csrf_token': u'd9b59034f28ecbe6d677af75b99dd67384ed5659', 'requirements': u'rpmlint', 'builds': [u'bodhi-2.0.0-3.fc17'], 'autokarma': True, 'edited': '', 'suggest': <unspecified>, 'notes': u'this is a test update', 'request': <testing>, 'bugs': [], 'unstable_karma': -3, 'require_bugs': False, 'require_testcases': True, 'type': <bugfix>, 'severity': <unspecified>}
bodhi.server: DEBUG: Adding nvr bodhi-2.0.0-3.fc17
bodhi.server: INFO: Creating new update: [<Build {'epoch': 0, 'nvr': u'bodhi-2.0.0-3.fc17', 'signed': False}>]
bodhi.server: DEBUG: Creating new Update(**data) object.
bodhi.server: DEBUG: Assigning alias for new update..
bodhi.server: DEBUG: Setting alias for bodhi-2.0.0-3.fc17 to FEDORA-2016-53345602d5
bodhi.server: DEBUG: Setting request for new update.
bodhi.server: DEBUG: Attempting to set request <testing>
bodhi.server: DEBUG: Adding tag f17-updates-testing-signing to bodhi-2.0.0-3.fc17
bodhi: DEBUG: tagBuild(f17-updates-testing-signing, bodhi-2.0.0-3.fc17)
bodhi.server: DEBUG: bodhi-2.0.0-3.fc17 has been submitted for testing. 
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-3.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
bodhi.server: DEBUG: Adding new update to the db.
bodhi.server: DEBUG: Triggering db flush for new update.
bodhi.server: DEBUG: Done with Update.new(...)
bodhi.server: DEBUG: bodhi-2.0.0-3.fc17 update created
bodhi.server: DEBUG: ('bodhi', '2.0.0', '3.fc17') is newer than bodhi-2.0.0-2.fc17
bodhi.server: INFO: bodhi-2.0.0-2.fc17 is obsoletable
bodhi.server: DEBUG: Obsoleting bodhi-2.0.0-2.fc17
bodhi.server: INFO: Untagging bodhi-2.0.0-2.fc17
bodhi: DEBUG: untagBuild(f17-updates-candidate, bodhi-2.0.0-2.fc17)
bodhi.server: INFO: Skipping tag that we don't know about: f17
bodhi: DEBUG: untagBuild(f17-updates-testing, bodhi-2.0.0-2.fc17)
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-2.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-3.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
dogpile.lock: DEBUG: NeedRegenerationException
dogpile.lock: DEBUG: no value, waiting for create lock
dogpile.lock: DEBUG: value creation lock <dogpile.cache.region._LockWrapper object at 0x7f06ed4cf350> acquired
dogpile.lock: DEBUG: Calling creation function
dogpile.lock: DEBUG: Released creation lock
bodhi.server: ERROR: Error caught.  Handling HTML response.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/tweens.py", line 22, in excview_tween
    response = handler(request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/router.py", line 158, in handle_request
    view_name
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/view.py", line 547, in _call_view
    response = view_callable(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/config/views.py", line 182, in __call__
    return view(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/viewderivers.py", line 393, in attr_view
    return view(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/viewderivers.py", line 371, in predicate_wrapper
    return view(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/viewderivers.py", line 465, in rendered_view
    request, result, view_inst, context)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/renderers.py", line 432, in render_view
    return self.render_to_response(response, system, request=request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/renderers.py", line 455, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/renderers.py", line 451, in render
    result = renderer(value, system_values)
  File "/usr/lib/python2.7/site-packages/pyramid_mako-1.0.2-py2.7.egg/pyramid_mako/__init__.py", line 144, in __call__
    template = self.template
  File "/usr/lib/python2.7/site-packages/pyramid_mako-1.0.2-py2.7.egg/pyramid_mako/__init__.py", line 110, in template
    template = self.lookup.get_template(spec)
  File "/usr/lib/python2.7/site-packages/pyramid_mako-1.0.2-py2.7.egg/pyramid_mako/__init__.py", line 77, in get_template
    return TemplateLookup.get_template(self, uri)
  File "/usr/lib/python2.7/site-packages/mako/lookup.py", line 256, in get_template
    return self._load(srcfile, uri)
  File "/usr/lib/python2.7/site-packages/mako/lookup.py", line 321, in _load
    **self.template_args)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 322, in __init__
    module = self._compile_from_file(path, filename)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 399, in _compile_from_file
    filename)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 677, in _compile_text
    generate_magic_comment=template.disable_unicode)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 657, in _compile
    node = lexer.parse()
  File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 237, in parse
    if self.match_control_line():
  File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 429, in match_control_line
    self.append_node(parsetree.ControlLine, keyword, isend, text)
  File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 134, in append_node
    node = nodecls(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mako/parsetree.py", line 83, in __init__
    code = ast.PythonFragment(text, **self.exception_kwargs)
  File "/usr/lib/python2.7/site-packages/mako/ast.py", line 87, in __init__
    code, **exception_kwargs)
CompileException: Fragment 'if build.signed' is not a partial control statement in file '/vagrant/bodhi/server/templates/update.html' at line: 377 char: 1
bodhi.server: ERROR: Unhandled exception raised:  <html_handler at 0x7f06ed47e050 500 Internal Server Error>
None
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 417 tests in 146.797s

FAILED (errors=5)

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
@bowlofeggs
Copy link
Contributor

It sounds like it should be showing me which updates it's about to push, but it doesn't print any:

[vagrant@localhost ~]$ bodhi-push --config /vagrant/development.ini
WARNING:fedmsg.crypto.x509:Crypto disabled ImportError('No module named M2Crypto',)
Push these 411 updates? (y/n)y

Locking updates...

Sending masher.start fedmsg
WARNING:bodhi.server:fedmsg disabled.  not initializing.
WARNING:bodhi.server:fedmsg disabled.  not sending 'masher.start'



if update_titles:
click.echo('\nSending masher.start fedmsg')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is over-indented. It should be four spaces instead of 8.

@bowlofeggs
Copy link
Contributor

@puiterwijk There are still some failing unit tests. They are again long output, so I'll just show the last one (they all seem similar):

======================================================================
ERROR: test_push_to_stable_for_obsolete_update (bodhi.tests.server.functional.test_updates.TestUpdatesService)
Obsolete update should not be submitted to testing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/vagrant/bodhi/tests/server/functional/test_updates.py", line 1874, in test_push_to_stable_for_obsolete_update
    headers={'Accept': 'text/html'})
  File "/usr/lib/python2.7/site-packages/webtest/app.py", line 323, in get
    expect_errors=expect_errors)
  File "/usr/lib/python2.7/site-packages/webtest/app.py", line 632, in do_request
    self._check_status(status, res)
  File "/usr/lib/python2.7/site-packages/webtest/app.py", line 664, in _check_status
    res)
AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/updates/bodhi-2.0.0-2.fc17)





<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="management of Fedora Project updates" />
    <meta name="author" content="Luke Macken" />
    <meta name="author" content="Ralph Bean" />

    <!-- Only allow websockets connections to fedoraproject.org. -->
    <meta http-equiv="Content-Security-Policy" content="connect-src http://0.0.0.0:6543">

    <link rel="shortcut icon" href="http://localhost/static/ico/favicon.ico">

    <base href="http://0.0.0.0:6543"/>
        <title>Fedora Updates System</title>
    <link href="http://localhost/static/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="http://localhost/static/font-awesome-4.4.0/css/font-awesome.min.css" rel="stylesheet" />
    <link href="http://localhost/static/css/text.css" rel="stylesheet" />
    <link href="http://localhost/static/css/navbar.css" rel="stylesheet" />
    <link href="http://localhost/static/css/footer.css" rel="stylesheet" />
    <link href="http://localhost/static/css/site.css" rel="stylesheet" />
    <link href="http://localhost/static/css/datagrepper-feed.css" rel="stylesheet" />
    <link href="http://localhost/static/css/panel.css" rel="stylesheet" />
    <script src="http://localhost/static/js/jquery-1.10.2.min.js"></script>
    <script src="http://localhost/static/js/Chart-0.2.0.min.js"></script>
  </head>

  <body>
    <div id="wrap">
      <!-- Static navbar -->
      <div class="navbar navbar-default navbar-fixed-top">
        <div class="container">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target=".navbar-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="http://localhost/">
              Fedora Update System
            </a>
          </div>

          <div class="navbar-collapse collapse">
            <form id="search" role="search" class="nav navbar-form navbar-left">
              <div id="bloodhound" class="form-group">
                <input class="typeahead form-control" name="term" type="text" placeholder="Search...">
              </div>
            </form>

            <div class="clearfix hidden-md hidden-lg"></div>

            <ul class="nav navbar-nav navbar-right">
              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                  <span class="glyphicon glyphicon-plus"></span>
                  Create
                </a>
                <ul class="dropdown-menu">
                  <li><a href="http://localhost/updates/new">
                      New Update
                  </a></li>
                  <li><a href="http://localhost/overrides/new">
                      New Override
                  </a></li>
                </ul>
              </li>

              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                  <span class="glyphicon glyphicon-tags"></span>
                  Releases
                </a>
                <ul class="dropdown-menu">
                  <li>
                    <a href="http://localhost/metrics">
                      Overall Metrics
                    </a>
                  </li>
                  <li>
                    <a href="http://localhost/masher">
                      Masher Status
                    </a>
                  </li>
                  <li role="separator" class="divider"></li>
                  <li>
                    <a href="http://localhost/releases/F17">
                      Fedora 17
                    </a>
                  </li>
                </ul>
              </li>

              <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                  <span class="glyphicon glyphicon-user"></span>
                  Profile
                </a>
                <ul class="dropdown-menu">

                  <li>
                    <a href="http://localhost/users/guest">
                      Your Profile
                    </a>
                  </li>
                  <li>
                    <a href="Noneguest.id.fedoraproject.org/">
                      Manage Alerts
                    </a>
                  </li>
                  <li>
                    <form id="popup_toggle" action="http://localhost/popup_toggle" method="POST">
                      <input type="hidden" name="next" value="http://localhost/updates/bodhi-2.0.0-2.fc17">
                    </form>
                    <a href="javascript:$('#popup_toggle').submit();">
                      Disable popups
                    </a>
                  </li>
                </ul>
              </li>


              <li>
                <a href="http://localhost/logout">
                  <span class="glyphicon glyphicon-log-out"></span>
                  Logout</a>
              </li>
            </ul>
          </div>
        </div><!--/.nav-collapse -->
      </div>

      <div class="container">


<div class="row">
  <div class="col-md-offset-3 col-md-6">
    <div class="panel error-page-panel">
      <h1>500 <small>Internal Server Error</small></h1>
      <p class="lead">Fragment 'else' is not a partial control statement in file '/vagrant/bodhi/server/templates/update.html' at line: 379 char: 1</p>
    </div>
  </div>
</div>

      </div>

      <div id="ghost-cabbage">
        <img src="http://localhost/static/img/logo-large.png"/>
      </div>
    </div> <!-- /#wrap -->

    <div id="footer">
      <div class="container">
        <p class="text-muted text-center"> Running
          <code>bodhi-2.2.4</code> on
          <code>localhost</code>.
        <a href="https://github.com/fedora-infra/bodhi">
        bodhi<span class="glyphicon glyphicon-link"></span></a> is Free Software.
        Please <a href="https://github.com/fedora-infra/bodhi/issues">
        file issues<span class="glyphicon glyphicon-link"></span></a>
        if you have any problems.  Copyright &copy; 2007-2016 Red Hat, Inc. and
        <a href="https://github.com/fedora-infra/bodhi/graphs/contributors">
        others<span class="glyphicon glyphicon-link"></span></a>.
        </p>
      </div>
    </div>

    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://localhost/static/jquery.flot.js"></script>
    <script src="http://localhost/static/jquery.flot.stack.js"></script>
    <script src="http://localhost/static/bootstrap/js/bootstrap.min.js"></script>
    <script src="http://localhost/static/moment/moment.min.js"></script>
    <script src="http://localhost/static/js/cabbage.js"></script>
    <script src="http://localhost/static/js/forms.js"></script>
    <script src="http://localhost/static/js/site.js"></script>
    <script src="http://localhost/static/js/live.js"></script>
    <script src="http://localhost/static/messenger/js/messenger.min.js"></script>
    <script src="http://localhost/static/messenger/js/messenger-theme-flat.js"></script>
    <link href="http://localhost/static/messenger/css/messenger.css" rel="stylesheet" />
    <link href="http://localhost/static/messenger/css/messenger-theme-flat.css" rel="stylesheet" />
    <script src="http://localhost/static/js/typeahead.bundle.js"></script>
    <script src="http://localhost/static/js/search.js"></script>
    <script src="http://localhost/static/js/konami.js"></script>


  </body>
</html>

-------------------- >> begin captured logging << --------------------
bodhi.server: DEBUG: Creating all models for Engine(sqlite://)
bodhi.server: DEBUG: Setting alias for bodhi-2.0-1.fc17 to FEDORA-2016-a3bbe1a8f2
dogpile.lock: DEBUG: NeedRegenerationException
dogpile.lock: DEBUG: no value, waiting for create lock
dogpile.lock: DEBUG: value creation lock <dogpile.cache.region._LockWrapper object at 0x7f0b8df298d0> acquired
dogpile.lock: DEBUG: Calling creation function
dogpile.lock: DEBUG: Released creation lock
bodhi.server: DEBUG: validated = {'close_bugs': True, 'stable_karma': 3, 'csrf_token': u'40a64d67db22a40e53deb86c3341464d42ab272f', 'requirements': u'rpmlint', 'builds': [u'bodhi-2.0.0-2.fc17'], 'autokarma': True, 'edited': '', 'suggest': <unspecified>, 'notes': u'this is a test update', 'request': <testing>, 'bugs': [], 'unstable_karma': -3, 'require_bugs': False, 'require_testcases': True, 'type': <bugfix>, 'severity': <unspecified>}
bodhi.server: DEBUG: Adding nvr bodhi-2.0.0-2.fc17
bodhi.server: INFO: Creating new update: [<Build {'epoch': 0, 'nvr': u'bodhi-2.0.0-2.fc17', 'signed': False}>]
bodhi.server: DEBUG: Creating new Update(**data) object.
bodhi.server: DEBUG: Assigning alias for new update..
bodhi.server: DEBUG: Setting alias for bodhi-2.0.0-2.fc17 to FEDORA-2016-033713b73b
bodhi.server: DEBUG: Setting request for new update.
bodhi.server: DEBUG: Attempting to set request <testing>
bodhi.server: DEBUG: Adding tag f17-updates-testing-signing to bodhi-2.0.0-2.fc17
bodhi: DEBUG: tagBuild(f17-updates-testing-signing, bodhi-2.0.0-2.fc17)
bodhi.server: DEBUG: bodhi-2.0.0-2.fc17 has been submitted for testing. 
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-2.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
bodhi.server: DEBUG: Adding new update to the db.
bodhi.server: DEBUG: Triggering db flush for new update.
bodhi.server: DEBUG: Done with Update.new(...)
bodhi.server: DEBUG: bodhi-2.0.0-2.fc17 update created
dogpile.lock: DEBUG: NeedRegenerationException
dogpile.lock: DEBUG: no value, waiting for create lock
dogpile.lock: DEBUG: value creation lock <dogpile.cache.region._LockWrapper object at 0x7f0b8dcbb610> acquired
dogpile.lock: DEBUG: Calling creation function
dogpile.lock: DEBUG: Released creation lock
bodhi.server: DEBUG: validated = {'close_bugs': True, 'stable_karma': 3, 'csrf_token': u'40a64d67db22a40e53deb86c3341464d42ab272f', 'requirements': u'rpmlint', 'builds': [u'bodhi-2.0.0-3.fc17'], 'autokarma': True, 'edited': '', 'suggest': <unspecified>, 'notes': u'this is a test update', 'request': <testing>, 'bugs': [], 'unstable_karma': -3, 'require_bugs': False, 'require_testcases': True, 'type': <bugfix>, 'severity': <unspecified>}
bodhi.server: DEBUG: Adding nvr bodhi-2.0.0-3.fc17
bodhi.server: INFO: Creating new update: [<Build {'epoch': 0, 'nvr': u'bodhi-2.0.0-3.fc17', 'signed': False}>]
bodhi.server: DEBUG: Creating new Update(**data) object.
bodhi.server: DEBUG: Assigning alias for new update..
bodhi.server: DEBUG: Setting alias for bodhi-2.0.0-3.fc17 to FEDORA-2016-53345602d5
bodhi.server: DEBUG: Setting request for new update.
bodhi.server: DEBUG: Attempting to set request <testing>
bodhi.server: DEBUG: Adding tag f17-updates-testing-signing to bodhi-2.0.0-3.fc17
bodhi: DEBUG: tagBuild(f17-updates-testing-signing, bodhi-2.0.0-3.fc17)
bodhi.server: DEBUG: bodhi-2.0.0-3.fc17 has been submitted for testing. 
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-3.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
bodhi.server: DEBUG: Adding new update to the db.
bodhi.server: DEBUG: Triggering db flush for new update.
bodhi.server: DEBUG: Done with Update.new(...)
bodhi.server: DEBUG: bodhi-2.0.0-3.fc17 update created
bodhi.server: DEBUG: ('bodhi', '2.0.0', '3.fc17') is newer than bodhi-2.0.0-2.fc17
bodhi.server: INFO: bodhi-2.0.0-2.fc17 is obsoletable
bodhi.server: DEBUG: Obsoleting bodhi-2.0.0-2.fc17
bodhi.server: INFO: Untagging bodhi-2.0.0-2.fc17
bodhi: DEBUG: untagBuild(f17-updates-candidate, bodhi-2.0.0-2.fc17)
bodhi.server: INFO: Skipping tag that we don't know about: f17
bodhi: DEBUG: untagBuild(f17-updates-testing, bodhi-2.0.0-2.fc17)
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-2.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
bodhi.server: INFO: Sending mail to guest: [Fedora Update] [comment] bodhi-2.0.0-3.fc17
bodhi.server: INFO: Not sending email: No smtp_server defined
dogpile.lock: DEBUG: NeedRegenerationException
dogpile.lock: DEBUG: no value, waiting for create lock
dogpile.lock: DEBUG: value creation lock <dogpile.cache.region._LockWrapper object at 0x7f0b8dfa08d0> acquired
dogpile.lock: DEBUG: Calling creation function
dogpile.lock: DEBUG: Released creation lock
bodhi.server: ERROR: Error caught.  Handling HTML response.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/tweens.py", line 22, in excview_tween
    response = handler(request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/router.py", line 158, in handle_request
    view_name
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/view.py", line 547, in _call_view
    response = view_callable(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/config/views.py", line 182, in __call__
    return view(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/viewderivers.py", line 393, in attr_view
    return view(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/viewderivers.py", line 371, in predicate_wrapper
    return view(context, request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/viewderivers.py", line 465, in rendered_view
    request, result, view_inst, context)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/renderers.py", line 432, in render_view
    return self.render_to_response(response, system, request=request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/renderers.py", line 455, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/usr/lib/python2.7/site-packages/pyramid-1.7.3-py2.7.egg/pyramid/renderers.py", line 451, in render
    result = renderer(value, system_values)
  File "/usr/lib/python2.7/site-packages/pyramid_mako-1.0.2-py2.7.egg/pyramid_mako/__init__.py", line 144, in __call__
    template = self.template
  File "/usr/lib/python2.7/site-packages/pyramid_mako-1.0.2-py2.7.egg/pyramid_mako/__init__.py", line 110, in template
    template = self.lookup.get_template(spec)
  File "/usr/lib/python2.7/site-packages/pyramid_mako-1.0.2-py2.7.egg/pyramid_mako/__init__.py", line 77, in get_template
    return TemplateLookup.get_template(self, uri)
  File "/usr/lib/python2.7/site-packages/mako/lookup.py", line 256, in get_template
    return self._load(srcfile, uri)
  File "/usr/lib/python2.7/site-packages/mako/lookup.py", line 321, in _load
    **self.template_args)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 322, in __init__
    module = self._compile_from_file(path, filename)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 399, in _compile_from_file
    filename)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 677, in _compile_text
    generate_magic_comment=template.disable_unicode)
  File "/usr/lib/python2.7/site-packages/mako/template.py", line 657, in _compile
    node = lexer.parse()
  File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 237, in parse
    if self.match_control_line():
  File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 429, in match_control_line
    self.append_node(parsetree.ControlLine, keyword, isend, text)
  File "/usr/lib/python2.7/site-packages/mako/lexer.py", line 134, in append_node
    node = nodecls(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/mako/parsetree.py", line 83, in __init__
    code = ast.PythonFragment(text, **self.exception_kwargs)
  File "/usr/lib/python2.7/site-packages/mako/ast.py", line 87, in __init__
    code, **exception_kwargs)
CompileException: Fragment 'else' is not a partial control statement in file '/vagrant/bodhi/server/templates/update.html' at line: 379 char: 1
bodhi.server: ERROR: Unhandled exception raised:  <html_handler at 0x7f0b8d9f9be0 500 Internal Server Error>
None
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 417 tests in 143.775s

FAILED (errors=5)

This makes bodhi-push:
- Use its own database connection
- Only submit updates that are marked as signed

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
…in koji

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Copy link
Contributor

@bowlofeggs bowlofeggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@puiterwijk This looks good to me, thanks so much for your patience with all the back and forth on this one. I think we've got something pretty nice here and I think releng will be happy with this huge improvement.

Nice work!

@bowlofeggs bowlofeggs merged commit 6e4d121 into develop Oct 18, 2016
@bowlofeggs bowlofeggs deleted the sign-request branch October 18, 2016 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Composer Issues related to the composer Critical We can't go on living in this sqalor, drop everything and fix it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants