internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: rucio/rucio

Issue:
Upgrade of dependencies for 1.19.0
Modification
------------
# pip-requires
SQLAlchemy 1.2.7 --> 1.2.16
alembic 0.9.9 --> 1.0.6
python-dateutil 2.7.2 --> 2.7.5
s3cmd 2.0.1 --> 2.0.2
stomp.py 4.1.20 --> 4.1.21
dnspython 1.15.0 --> 1.16.0
geoip2 2.8.0 --> 2.9.0
maxminddb 1.3.0 --> 1.4.1
pycparser 2.18 --> 2.19
googleapis-common-protos 1.5.3 --> 1.5.6
httplib2 0.11.3 --> 0.12.0
pyOpenSSL 18.0.0 --> 19.0.0
cryptography 2.3.1 --> 2.4.2
oauth2client 4.1.2 --> 4.1.3
protobuf 3.5.2.post1 --> 3.6.1
grpcio 1.11.0 --> 1.18.0
pyasn1 0.4.2 --> 0.4.5
pyasn1-modules 0.2.1 --> 0.2.3
rsa 3.4.2 --> 4.0
redis 2.10.6 --> 3.0.1
numpy 1.14.2 --> 1.16.0
paramiko 2.4.1 --> 2.4.2
Flask 0.12.4 --> 1.0.2
idna 2.6 --> 2.8
MyProxyClient 2.0.1 --> 2.1.0

# pip-requires-test
Paste 2.0.3 --> 3.0.6
coverage 4.4.2 --> 4.5.2
Sphinx 1.6.5 --> 1.8.3
sphinx-rtd-theme 0.2.4 --> 0.4.2
sphinxcontrib-httpdomain 1.6.0 --> 1.7.0
Pygments 2.2.0 --> 2.3.1
pyflakes 1.6.0 --> 2.0.0
flake8 3.5.0 --> 3.6.0
pylint 1.7.4 --> 2.2.2
virtualenv 15.1.0 --> 16.2.0
tox 2.9.1 --> 3.7.0
pytest 3.2.5 --> 4.1.1
pytest-xdist 1.20.1 --> 1.26.0
pytz 2017.3 --> 2018.9
Babel 2.5.1 --> 2.6.0
subprocess32 3.2.7 --> 3.5.3
pycodestyle 2.3.1 --> 2.4.0


Discussion:
Notes: 
# pip-requires
- numpy: There are some complications with numpy and wsgi, this needs to be handled separately in another issue. numpy stays at `1.14.2`

# pip-requires-client
- pylint: Upgrading pylint to `1.9.4` instead of `2.2.2`. 1.9.4 is the last version which is py2.7 compatible, everything else only py3.
- flake8 and pycodestyles: Leaving them at their respective version, as a new version generates some errors. This will be handled in a separate PR.

Resolving patch:
diff --git a/lib/rucio/db/sqla/migrate_repo/versions/3345511706b8_replicas_table_pk_definition_is_in_.py b/lib/rucio/db/sqla/migrate_repo/versions/3345511706b8_replicas_table_pk_definition_is_in_.py
--- a/lib/rucio/db/sqla/migrate_repo/versions/3345511706b8_replicas_table_pk_definition_is_in_.py
+++ b/lib/rucio/db/sqla/migrate_repo/versions/3345511706b8_replicas_table_pk_definition_is_in_.py
@@ -27,7 +27,7 @@
 
 # revision identifiers used by alembic
 revision = '3345511706b8'       # pylint: disable=invalid-name
-down_revision = 'bf3baa1c1474'  # pylint: disable=invalid-name
+down_revision = '01eaf73ab656'  # pylint: disable=invalid-name
 
 
 def upgrade():


Test patch:
Repository: rucio/rucio

Issue:
Updated psycopg2 package to psycopg2-binary
Motivation
----------

```
/usr/lib64/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
```




Discussion:

Resolving patch:
diff --git a/lib/rucio/db/sqla/session.py b/lib/rucio/db/sqla/session.py
--- a/lib/rucio/db/sqla/session.py
+++ b/lib/rucio/db/sqla/session.py
@@ -15,7 +15,7 @@
 # Authors:
 # - Vincent Garonne <vgaronne@gmail.com>, 2015-2018
 # - Wen Guan <wguan.icedew@gmail.com>, 2016
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2017
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2017-2019
 # - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2019
 #
 # PY3K COMPATIBLE
@@ -128,7 +128,7 @@ def psql_convert_decimal_to_float(dbapi_conn, connection_rec):
     try:
         import psycopg2.extensions  # pylint: disable=import-error
     except:
-        raise RucioException('Trying to use PostgreSQL without psycopg2 installed!')
+        raise RucioException('Trying to use PostgreSQL without psycopg2 or psycopg2-binary installed!')
 
     DEC2FLOAT = psycopg2.extensions.new_type(psycopg2.extensions.DECIMAL.values,
                                              'DEC2FLOAT',
diff --git a/setup_rucio.py b/setup_rucio.py
--- a/setup_rucio.py
+++ b/setup_rucio.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2018 CERN for the benefit of the ATLAS collaboration.
+# Copyright 2014-2019 CERN for the benefit of the ATLAS collaboration.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -13,11 +13,10 @@
 # limitations under the License.
 #
 # Authors:
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2014
-# - Vincent Garonne <vgaronne@gmail.com>, 2012-2018
-# - Martin Barisits <martin.barisits@cern.ch>, 2012-2018
-# - Wen Guan <wguan.icedew@gmail.com>, 2014
+# - Vincent Garonne <vgaronne@gmail.com>, 2014-2018
 # - Thomas Beermann <thomas.beermann@cern.ch>, 2014-2018
+# - Martin Barisits <martin.barisits@cern.ch>, 2016-2018
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2019
 
 '''
 Setup.py which moves kerberos modules in extra dependencies to be buildthedocs compliant.
@@ -165,7 +164,7 @@ def write_requirements():
 
 
 oracle_extras = ['cx_oracle==6.3.1']
-postgresql_extras = ['psycopg2>=2.4.2']
+postgresql_extras = ['psycopg2-binary>=2.4.2']
 mysql_extras = ['PyMySQL']
 kerberos_extras = ['kerberos>=1.3.0', 'pykerberos>=1.2.1', 'requests-kerberos>=0.12.0']
 dev_extras = parse_requirements(requirements_files=['tools/pip-requires-test', ])


Test patch:
Repository: rucio/rucio

Issue:
Updated psycopg2 package to psycopg2-binary
Motivation
----------

```
/usr/lib64/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
```


View for suspicious files
Motivation
----------
The sites/clouds squads need a view to list the suspicious files on their site.





Discussion:

Resolving patch:
diff --git a/lib/rucio/db/sqla/session.py b/lib/rucio/db/sqla/session.py
--- a/lib/rucio/db/sqla/session.py
+++ b/lib/rucio/db/sqla/session.py
@@ -15,7 +15,7 @@
 # Authors:
 # - Vincent Garonne <vgaronne@gmail.com>, 2015-2018
 # - Wen Guan <wguan.icedew@gmail.com>, 2016
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2017
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2017-2019
 # - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2019
 #
 # PY3K COMPATIBLE
@@ -128,7 +128,7 @@ def psql_convert_decimal_to_float(dbapi_conn, connection_rec):
     try:
         import psycopg2.extensions  # pylint: disable=import-error
     except:
-        raise RucioException('Trying to use PostgreSQL without psycopg2 installed!')
+        raise RucioException('Trying to use PostgreSQL without psycopg2 or psycopg2-binary installed!')
 
     DEC2FLOAT = psycopg2.extensions.new_type(psycopg2.extensions.DECIMAL.values,
                                              'DEC2FLOAT',
diff --git a/setup_rucio.py b/setup_rucio.py
--- a/setup_rucio.py
+++ b/setup_rucio.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2018 CERN for the benefit of the ATLAS collaboration.
+# Copyright 2014-2019 CERN for the benefit of the ATLAS collaboration.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -13,11 +13,10 @@
 # limitations under the License.
 #
 # Authors:
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2014
-# - Vincent Garonne <vgaronne@gmail.com>, 2012-2018
-# - Martin Barisits <martin.barisits@cern.ch>, 2012-2018
-# - Wen Guan <wguan.icedew@gmail.com>, 2014
+# - Vincent Garonne <vgaronne@gmail.com>, 2014-2018
 # - Thomas Beermann <thomas.beermann@cern.ch>, 2014-2018
+# - Martin Barisits <martin.barisits@cern.ch>, 2016-2018
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2019
 
 '''
 Setup.py which moves kerberos modules in extra dependencies to be buildthedocs compliant.
@@ -165,7 +164,7 @@ def write_requirements():
 
 
 oracle_extras = ['cx_oracle==6.3.1']
-postgresql_extras = ['psycopg2>=2.4.2']
+postgresql_extras = ['psycopg2-binary>=2.4.2']
 mysql_extras = ['PyMySQL']
 kerberos_extras = ['kerberos>=1.3.0', 'pykerberos>=1.2.1', 'requests-kerberos>=0.12.0']
 dev_extras = parse_requirements(requirements_files=['tools/pip-requires-test', ])


Test patch:
Repository: rucio/rucio

Issue:
import errors in the readthedocs environment
Motivation
----------
The fts3 package is missing in the readthedocs environment. Therefore the build sometimes fails if the cache gets reset.


Modification
------------
It needs to be mocked because it can not be installed through the readthedocs.requirements.txt because of missing pycurl. 





Discussion:

Resolving patch:
diff --git a/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -33,7 +33,7 @@ def __getitem__(cls, name):
         return Mock()
 
 
-MOCK_MODULES = ['pycurl', 'M2Crypto']
+MOCK_MODULES = ['pycurl', 'M2Crypto', 'fts3', 'fts3.rest', 'fts3.rest.client', 'fts3.rest.client.easy', 'fts3.rest.client.exceptions', 'builtins']
 sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
 
 # -- General configuration ------------------------------------------------
diff --git a/lib/rucio/db/sqla/models.py b/lib/rucio/db/sqla/models.py
--- a/lib/rucio/db/sqla/models.py
+++ b/lib/rucio/db/sqla/models.py
@@ -27,7 +27,6 @@
 import datetime
 import uuid
 
-from builtins import object
 from sqlalchemy import BigInteger, Boolean, Column, DateTime, Float, Integer, SmallInteger, String as _String, Text, event, UniqueConstraint
 from sqlalchemy.engine import Engine
 from sqlalchemy.ext.compiler import compiles


Test patch:
Repository: rucio/rucio

Issue:
import errors in the readthedocs environment
Motivation
----------
The fts3 package is missing in the readthedocs environment. Therefore the build sometimes fails if the cache gets reset.


Modification
------------
It needs to be mocked because it can not be installed through the readthedocs.requirements.txt because of missing pycurl. 



View for suspicious files
Motivation
----------
The sites/clouds squads need a view to list the suspicious files on their site.





Discussion:

Resolving patch:
diff --git a/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -33,7 +33,7 @@ def __getitem__(cls, name):
         return Mock()
 
 
-MOCK_MODULES = ['pycurl', 'M2Crypto']
+MOCK_MODULES = ['pycurl', 'M2Crypto', 'fts3', 'fts3.rest', 'fts3.rest.client', 'fts3.rest.client.easy', 'fts3.rest.client.exceptions', 'builtins']
 sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
 
 # -- General configuration ------------------------------------------------
diff --git a/lib/rucio/db/sqla/models.py b/lib/rucio/db/sqla/models.py
--- a/lib/rucio/db/sqla/models.py
+++ b/lib/rucio/db/sqla/models.py
@@ -27,7 +27,6 @@
 import datetime
 import uuid
 
-from builtins import object
 from sqlalchemy import BigInteger, Boolean, Column, DateTime, Float, Integer, SmallInteger, String as _String, Text, event, UniqueConstraint
 from sqlalchemy.engine import Engine
 from sqlalchemy.ext.compiler import compiles


Test patch:
Repository: rucio/rucio

Issue:
Release: Alembic upgrade script for rule notification references wrong column
Motivation
----------
The upgrade script should be fixed in a hotfix release `1.19.0.post1` and the `1.19.0` release should be pulled from PyPi. This only impacts database upgrades from an older version.


Discussion:

Resolving patch:
diff --git a/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py b/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
--- a/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
+++ b/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
@@ -36,7 +36,7 @@ def upgrade():
     if context.get_context().dialect.name not in ('sqlite'):  # pylint: disable=no-member
         drop_constraint('RULES_NOTIFICATION_CHK', 'rules', type_='check')
         create_check_constraint(name='RULES_NOTIFICATION_CHK', source='rules',
-                                condition="state in ('Y', 'N', 'C', 'P')")
+                                condition="notification in ('Y', 'N', 'C', 'P')")
 
 
 def downgrade():
@@ -46,4 +46,4 @@ def downgrade():
     if context.get_context().dialect.name not in ('sqlite'):  # pylint: disable=no-member
         drop_constraint('RULES_NOTIFICATION_CHK', 'rules', type_='check')
         create_check_constraint(name='RULES_NOTIFICATION_CHK', source='rules',
-                                condition="state in ('Y', 'N', 'C')")
+                                condition="notification in ('Y', 'N', 'C')")


Test patch:
Repository: rucio/rucio

Issue:
Release: Alembic upgrade script for rule notification references wrong column
Motivation
----------
The upgrade script should be fixed in a hotfix release `1.19.0.post1` and the `1.19.0` release should be pulled from PyPi. This only impacts database upgrades from an older version.
View for suspicious files
Motivation
----------
The sites/clouds squads need a view to list the suspicious files on their site.





Discussion:

Resolving patch:
diff --git a/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py b/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
--- a/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
+++ b/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
@@ -36,7 +36,7 @@ def upgrade():
     if context.get_context().dialect.name not in ('sqlite'):  # pylint: disable=no-member
         drop_constraint('RULES_NOTIFICATION_CHK', 'rules', type_='check')
         create_check_constraint(name='RULES_NOTIFICATION_CHK', source='rules',
-                                condition="state in ('Y', 'N', 'C', 'P')")
+                                condition="notification in ('Y', 'N', 'C', 'P')")
 
 
 def downgrade():
@@ -46,4 +46,4 @@ def downgrade():
     if context.get_context().dialect.name not in ('sqlite'):  # pylint: disable=no-member
         drop_constraint('RULES_NOTIFICATION_CHK', 'rules', type_='check')
         create_check_constraint(name='RULES_NOTIFICATION_CHK', source='rules',
-                                condition="state in ('Y', 'N', 'C')")
+                                condition="notification in ('Y', 'N', 'C')")


Test patch:
Repository: rucio/rucio

Issue:
core: rse listing needs additional handling of legacy 0/1 values
Motivation
----------

Existing RSE attributes which use 0/1 as true/false are not found if they are the sole solution to an RSE expression.


Discussion:

Resolving patch:
diff --git a/lib/rucio/core/rse.py b/lib/rucio/core/rse.py
--- a/lib/rucio/core/rse.py
+++ b/lib/rucio/core/rse.py
@@ -15,7 +15,7 @@
 # Authors:
 # - Vincent Garonne <vgaronne@gmail.com>, 2012-2018
 # - Ralph Vigne <ralph.vigne@cern.ch>, 2012-2015
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2018
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2012-2019
 # - Martin Barisits <martin.barisits@cern.ch>, 2013-2018
 # - Cedric Serfon <cedric.serfon@cern.ch>, 2013-2018
 # - Thomas Beermann <thomas.beermann@cern.ch>, 2014-2017
@@ -302,8 +302,13 @@ def list_rses(filters={}, session=None):
                 # ATLAS RSE listing workaround (since booleans are capital 'True'/'False')
                 # remove elif branch after appropriate database fix has been applied
                 # see also db/types.py
-                query = query.filter(or_(t.value == v,
-                                         t.value == 'tmp_atlas_%s' % v))
+                if isinstance(v, bool):
+                    query = query.filter(or_(t.value == v,
+                                             t.value == 'tmp_atlas_%s' % v,
+                                             t.value == 'tmp_atlas_%s' % 1 if v else 0))
+                else:
+                    query = query.filter(or_(t.value == v,
+                                             t.value == 'tmp_atlas_%s' % v))
 
         condition1, condition2 = [], []
         for i in range(0, 8):


Test patch:
Repository: rucio/rucio

Issue:
idna==2.8 not compatible with requests
Motivation
----------
Change idna to 2.7


Kronos crashes when updating eol_at
Motivation
----------
Kronos crashes when updating eol_at


Discussion:

Resolving patch:
diff --git a/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py b/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
--- a/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
+++ b/lib/rucio/db/sqla/migrate_repo/versions/01eaf73ab656_add_new_rule_notification_state_progress.py
@@ -36,7 +36,7 @@ def upgrade():
     if context.get_context().dialect.name not in ('sqlite'):  # pylint: disable=no-member
         drop_constraint('RULES_NOTIFICATION_CHK', 'rules', type_='check')
         create_check_constraint(name='RULES_NOTIFICATION_CHK', source='rules',
-                                condition="state in ('Y', 'N', 'C', 'P')")
+                                condition="notification in ('Y', 'N', 'C', 'P')")
 
 
 def downgrade():
@@ -46,4 +46,4 @@ def downgrade():
     if context.get_context().dialect.name not in ('sqlite'):  # pylint: disable=no-member
         drop_constraint('RULES_NOTIFICATION_CHK', 'rules', type_='check')
         create_check_constraint(name='RULES_NOTIFICATION_CHK', source='rules',
-                                condition="state in ('Y', 'N', 'C')")
+                                condition="notification in ('Y', 'N', 'C')")


Test patch:
Repository: rucio/rucio

Issue:
Add the possibility to declare bad files in the WebUI
Motivation
----------
Add the possibility to declare bad files in the WebUI






Discussion:

Resolving patch:
diff --git a/lib/rucio/core/permission/atlas.py b/lib/rucio/core/permission/atlas.py
--- a/lib/rucio/core/permission/atlas.py
+++ b/lib/rucio/core/permission/atlas.py
@@ -15,7 +15,7 @@
 # Authors:
 # - Vincent Garonne <vgaronne@gmail.com>, 2016
 # - Martin Barisits <martin.barisits@cern.ch>, 2016-2018
-# - Cedric Serfon <cedric.serfon@cern.ch>, 2016-2018
+# - Cedric Serfon <cedric.serfon@cern.ch>, 2016-2019
 # - Mario Lassnig <mario.lassnig@cern.ch>, 2018
 # - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2018-2019
 #
@@ -1031,9 +1031,9 @@ def perm_add_bad_pfns(issuer, kwargs):
     :param kwargs: List of arguments for the action.
     :returns: True if account is allowed, otherwise False
     """
-    if kwargs['state'] in [BadPFNStatus.BAD, BadPFNStatus.TEMPORARY_UNAVAILABLE]:
+    if kwargs['state'] in [str(BadPFNStatus.BAD), str(BadPFNStatus.TEMPORARY_UNAVAILABLE)]:
         is_cloud_admin = bool([acc_attr for acc_attr in list_account_attributes(account=issuer) if (acc_attr['key'].startswith('cloud-')) and (acc_attr['value'] == 'admin')])
         return issuer == 'root' or has_account_attribute(account=issuer, key='admin') or is_cloud_admin
-    elif kwargs['state'] == BadPFNStatus.SUSPICIOUS:
+    elif kwargs['state'] == str(BadPFNStatus.SUSPICIOUS):
         return True
     return issuer == 'root'


Test patch:
Repository: rucio/rucio

Issue:
Relay of constituent rule to archive rule should not consider temporary unavailable replicas
Motivation
----------
Currently it considers TU replicas, which makes testing the feature impossible.



Discussion:

Resolving patch:
diff --git a/lib/rucio/core/rule.py b/lib/rucio/core/rule.py
--- a/lib/rucio/core/rule.py
+++ b/lib/rucio/core/rule.py
@@ -182,8 +182,7 @@ def add_rule(dids, account, copies, rse_expression, grouping, weight, lifetime,
                 replica_cnt = session.query(models.RSEFileAssociation).join(models.RSE, models.RSEFileAssociation.rse_id == models.RSE.id)\
                     .filter(models.RSEFileAssociation.scope == did.scope,
                             models.RSEFileAssociation.name == did.name,
-                            or_(models.RSEFileAssociation.state == ReplicaState.AVAILABLE,
-                                models.RSEFileAssociation.state == ReplicaState.TEMPORARY_UNAVAILABLE),
+                            models.RSEFileAssociation.state == ReplicaState.AVAILABLE,
                             models.RSE.rse_type != RSEType.TAPE).count()
                 if replica_cnt == 0:  # Put the rule on the archive
                     archive = session.query(models.ConstituentAssociation).join(models.RSEFileAssociation,
@@ -397,8 +396,7 @@ def add_rules(dids, rules, session=None):
                 replica_cnt = session.query(models.RSEFileAssociation).join(models.RSE, models.RSEFileAssociation.rse_id == models.RSE.id)\
                     .filter(models.RSEFileAssociation.scope == did.scope,
                             models.RSEFileAssociation.name == did.name,
-                            or_(models.RSEFileAssociation.state == ReplicaState.AVAILABLE,
-                                models.RSEFileAssociation.state == ReplicaState.AVAILABLE),
+                            models.RSEFileAssociation.state == ReplicaState.AVAILABLE,
                             models.RSE.rse_type != RSEType.TAPE).count()
                 if replica_cnt == 0:  # Put the rule on the archive
                     archive = session.query(models.ConstituentAssociation).join(models.RSEFileAssociation,


Test patch:
Repository: rucio/rucio

Issue:
Alembic script for comments column in subscription_history table needed






Discussion:

Resolving patch:
diff --git a/lib/rucio/db/sqla/migrate_repo/versions/b8caac94d7f0_add_comments_column_for_subscriptions_.py b/lib/rucio/db/sqla/migrate_repo/versions/b8caac94d7f0_add_comments_column_for_subscriptions_.py
new file mode 100644
--- /dev/null
+++ b/lib/rucio/db/sqla/migrate_repo/versions/b8caac94d7f0_add_comments_column_for_subscriptions_.py
@@ -0,0 +1,47 @@
+# Copyright 2013-2019 CERN for the benefit of the ATLAS collaboration.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Authors:
+# - Martin Barisits <martin.barisits@cern.ch>, 2019
+#
+# Topic: Add comments column for subscriptions_history
+# Revision ID: b8caac94d7f0
+# Revises: 3345511706b8
+# Creation Date: 2019-02-20 16:52:28.549840
+
+from alembic.op import (add_column, drop_column)
+
+from alembic import context
+
+import sqlalchemy as sa
+
+
+# revision identifiers used by alembic
+revision = 'b8caac94d7f0'       # pylint: disable=invalid-name
+down_revision = '3345511706b8'  # pylint: disable=invalid-name
+
+
+def upgrade():
+    '''
+    Upgrade the database to this revision
+    '''
+    add_column('subscriptions_history', sa.Column('comments', sa.String(4000)))
+
+
+def downgrade():
+    '''
+    Downgrade the database to the previous revision
+    '''
+    if context.get_context().dialect.name != 'sqlite':
+        drop_column('subscriptions_history', 'comments')


Test patch: