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

alembic 1.2.0 broke the alembic.command.stamp() revision parameter #601

Closed
toabctl opened this issue Sep 24, 2019 · 4 comments

Comments

@toabctl
Copy link
Contributor

commented Sep 24, 2019

Trying to use OpenStack services with alembic 1.2.0 (currently 1.1.0 is used) is breaking a lot of services with (Ironic example):

[...]
    b'  File "ronic/ironic/db/sqlalchemy/migration.py", line 99, in stamp'
    b'    return alembic.command.stamp(config, revision=revision)'
    b"TypeError: stamp() got an unexpected keyword argument 'revision'"

Looks like the stamp method does no longer accept the parameter revision (done in commit fdcc5bf).

I wonder if it would be possible (until 2.0.0 comes up) to support revision and revisions as parameter to be backward compatible?

Also oslo.db is affected. It tries to use the revision parameter. See https://opendev.org/openstack/oslo.db/src/branch/master/oslo_db/sqlalchemy/migration_cli/ext_alembic.py#L92

toabctl added a commit to toabctl/alembic that referenced this issue Sep 24, 2019
Commit [1] changed the method signature. "revision" as parameter name
was no longer accepted. This is now fixed.

Fixes: sqlalchemy#601

[1] sqlalchemy@fdcc5bf
toabctl added a commit to toabctl/alembic that referenced this issue Sep 24, 2019
Commit [1] changed the method signature. "revision" as parameter name
was no longer accepted. This is now fixed.

Fixes: sqlalchemy#601

[1] sqlalchemy@fdcc5bf
zzzeek referenced this issue Sep 24, 2019
Added new ``--purge`` flag to the ``alembic stamp`` command, which will
unconditionally erase the version table before stamping anything.  This is
useful for development where non-existent version identifiers might be left
within the table.  Additionally, ``alembic.stamp`` now supports a list of
revision identifiers, which are intended to allow setting up muliple heads
at once.  Overall handling of version identifiers within the
``alembic.stamp`` command has been improved with many new tests and
use cases added.

Fixes: #473
Change-Id: If06501b69afae9956df3d0bcd739063fb8042a02
@zzzeek

This comment has been minimized.

Copy link
Member

commented Sep 24, 2019

someone actually noted that I changed this name, and I asked, you're not actualy using the positional argument as a kw are you, and they said no, and I was like, OK, great. But then here we are. Alembic is actually tested against neutron and oslo.db, I can add more alembic-using projects like ironic since nova/keystone have unfortuantely never switched.

There's a decorator I can use to allow for both kw args but also it should be passed positionally.

@sqla-tester

This comment has been minimized.

Copy link
Collaborator

commented Sep 24, 2019

Thomas Bechtold has proposed a fix for this issue in the master branch:

Fix alembic.command.stamp() signature and allow revision again https://gerrit.sqlalchemy.org/1477

@zzzeek

This comment has been minimized.

Copy link
Member

commented Sep 24, 2019

also why didn't oslo.db's test fail in my own CI

@zzzeek

This comment has been minimized.

Copy link
Member

commented Sep 24, 2019

also as far as 1.2 etc we don't use pure semver, see https://www.sqlalchemy.org/download.html#versions. there's never going to be an alembic 2.0

openstack-gerrit added a commit to openstack/openstack that referenced this issue Sep 25, 2019
* Update requirements from branch 'master'
  - Merge "Skip alembic 1.2.0"
  - Skip alembic 1.2.0
    
    Version 1.2.0 changed the alembic.command.stamp() method which no
    longer accepts a "revision" parameter (not it accepts a "revisions"
    parameter).
    Upstream bug is: sqlalchemy/alembic#601
    
    Change-Id: Iec1f21e544b6efc17401c0cb9ff7472f020a7dc3
openstack-gerrit pushed a commit to openstack/requirements that referenced this issue Sep 25, 2019
Version 1.2.0 changed the alembic.command.stamp() method which no
longer accepts a "revision" parameter (not it accepts a "revisions"
parameter).
Upstream bug is: sqlalchemy/alembic#601

Change-Id: Iec1f21e544b6efc17401c0cb9ff7472f020a7dc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.