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

Feature/adding mset replacement functionality 20210615 #445

Open
wants to merge 65 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b73c2c9
added MsetReplacementEvent model
cschu Jun 15, 2021
c61ae1d
fixed alembic complaint
cschu Jun 15, 2021
723ec8b
added alembic script for revision related to b73c2c91
cschu Jun 15, 2021
e53527b
pleasing flake8
cschu Jun 15, 2021
157ef00
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
cschu Jun 16, 2021
0708ccb
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
cschu Jun 16, 2021
3dbc0f4
fixed MsetReplacement/MetaDataSet key issues (with @lkuchenb)
cschu Jun 24, 2021
df35eba
merged upstream
cschu Jun 24, 2021
1b3a3fc
pleasing flake8
cschu Jun 24, 2021
9f09d96
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
cschu Jun 24, 2021
729ddcc
added initial mset replacement logic
cschu Jun 24, 2021
85ade91
merged upstream
cschu Jun 24, 2021
2bd9b75
pleasing flake8 and mypy
cschu Jun 24, 2021
523208f
addressing @lkuchenb's code review
cschu Jun 25, 2021
9068be3
added user.can_update flag
cschu Jun 25, 2021
2392560
generated alembic script pertaining to 9068be3
cschu Jun 25, 2021
54d3b63
pleasing flake8
cschu Jun 25, 2021
1c9a668
pleasing flake8
cschu Jun 25, 2021
1ffefdb
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
cschu Jun 29, 2021
bf20b41
fixing the fixtures
cschu Jun 29, 2021
67fe823
fixing the fixtures
cschu Jun 29, 2021
9accbed
addressing mypy error
cschu Jun 29, 2021
5db3d83
implemented code review requests (@lkuchenb)
cschu Jun 30, 2021
b92e67e
patched exposed event id
cschu Jun 30, 2021
307353f
actually fixed exposed event id
cschu Jul 1, 2021
f5d2483
added can_update to restricted fields, updated info request integrati…
cschu Jul 1, 2021
7a4c6de
added metadataset->msetreplacementevent relationships
cschu Jul 1, 2021
effc7d7
simplified check for already replaced metadatasets
cschu Jul 1, 2021
db6efbc
added back_populates args
cschu Jul 1, 2021
6c7199b
fixed issue with introducing can_update column for existing users
cschu Jul 1, 2021
621babc
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
cschu Jul 1, 2021
55a11f7
openapi version bump (1.4.0)
cschu Jul 1, 2021
c6a340f
added/registered new api route; renamed information request operation…
cschu Jul 5, 2021
e0dfe33
added update_metadatasets protoype
cschu Jul 6, 2021
ce78f8a
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
cschu Jul 6, 2021
4fecd28
pleasing flake8 and mypy
cschu Jul 6, 2021
115eff6
package bump (pleasing versioning checks)
cschu Jul 6, 2021
4912fdb
merged openapi.yaml with upstream changes
cschu Jul 6, 2021
36cd8ec
Apply suggestions from code review
cschu Jul 6, 2021
ac112b7
works
cschu Jul 6, 2021
4a35bce
weird.
cschu Jul 6, 2021
e0803da
weird.
cschu Jul 6, 2021
6f75123
weird
cschu Jul 6, 2021
d0b3f6b
refactored + working
cschu Jul 7, 2021
e77bf56
added preliminary test for metadataset replacement
cschu Jul 7, 2021
0289f2a
workaround to re-enable bulk-deletion test
cschu Jul 7, 2021
ac2b431
removed redundant label from msetreplacementevents (label is attached…
cschu Jul 14, 2021
3e1bfcd
cleaning
cschu Jul 14, 2021
c6f22a0
added can_update=True to initial user
cschu Jul 14, 2021
9e88373
metadatasetresponses now include replaced/replaces information (#462)
cschu Jul 14, 2021
d882ffe
added more testcases
cschu Jul 28, 2021
d395384
pleasing flake8
cschu Jul 28, 2021
b7cf1ed
pleasing mypy
cschu Jul 28, 2021
e47a56d
pleasing mypy
cschu Jul 28, 2021
b87e481
removed comment
cschu Jul 28, 2021
455ee05
added information about replaced metadatasets to datatable
cschu Jul 28, 2021
27163f5
Apply suggestions from @lkuchenb's code review
cschu Aug 3, 2021
306cf35
implemented suggestions from @lkuchenb's code review
cschu Aug 3, 2021
d353255
merge upstream (github code review)
cschu Aug 3, 2021
455626a
dealt with fallout from renaming msetreplacements-table
cschu Aug 3, 2021
00738a1
fixed bulk deletion test
cschu Aug 4, 2021
ea30854
fixed failing stage_and_submit test
cschu Aug 4, 2021
cbe39eb
pleasing mypy
cschu Aug 4, 2021
dd036cc
fixed issue that prevented new user registration requests to be compl…
cschu Aug 24, 2021
216a08b
Merge branch 'develop' into feature/adding_mset_replacement_functiona…
lkuchenb Nov 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions datameta/alembic/versions/20210625_f6a70402119f.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"""added msetreplacements table, moved update-related fields from mset, added user.can_update flag

Revision ID: f6a70402119f
Revises: 7fdc829db18d
Create Date: 2021-06-25 15:27:37.638601

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'f6a70402119f'
down_revision = '7fdc829db18d'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
'msetreplacements',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('datetime', sa.DateTime(), nullable=False),
sa.Column('label', sa.String(length=140), nullable=False),
sa.Column('new_metadataset_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['new_metadataset_id'], ['metadatasets.id'], name=op.f('fk_msetreplacements_new_metadataset_id_metadatasets')),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], name=op.f('fk_msetreplacements_user_id_users')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_msetreplacements')),
sa.UniqueConstraint('uuid', name=op.f('uq_msetreplacements_uuid'))
)
op.add_column('metadatasets', sa.Column('replaced_via_event_id', sa.Integer(), nullable=True))
op.drop_constraint('fk_metadatasets_replaced_by_id_metadatasets', 'metadatasets', type_='foreignkey')
op.create_foreign_key(op.f('fk_metadatasets_replaced_via_event_id_msetreplacements'), 'metadatasets', 'msetreplacements', ['replaced_via_event_id'], ['id'], use_alter=True)
op.drop_column('metadatasets', 'deprecated_label')
op.drop_column('metadatasets', 'replaced_by_id')
op.drop_column('metadatasets', 'is_deprecated')
op.add_column('users', sa.Column('can_update', sa.Boolean(create_constraint=False), nullable=True))
op.execute('UPDATE users SET can_update = site_admin;')
op.alter_column('users', 'can_update', nullable=False)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'can_update')
op.add_column('metadatasets', sa.Column('is_deprecated', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.add_column('metadatasets', sa.Column('replaced_by_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('metadatasets', sa.Column('deprecated_label', sa.VARCHAR(), autoincrement=False, nullable=True))
op.drop_constraint(op.f('fk_metadatasets_replaced_via_event_id_msetreplacements'), 'metadatasets', type_='foreignkey')
op.create_foreign_key('fk_metadatasets_replaced_by_id_metadatasets', 'metadatasets', 'metadatasets', ['replaced_by_id'], ['id'])
op.drop_column('metadatasets', 'replaced_via_event_id')
op.drop_table('msetreplacements')
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions datameta/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def includeme(config: Configurator) -> None:
config.add_route("groups_id", base_url + "/groups/{id}")
config.add_route("rpc_delete_files", base_url + "/rpc/delete-files")
config.add_route("rpc_delete_metadatasets", base_url + "/rpc/delete-metadatasets")
config.add_route("rpc_replace_metadatasets", base_url + "/rpc/replace-metadatasets")
config.add_route("rpc_get_file_url", base_url + "/rpc/get-file-url/{id}")
config.add_route('register_submit', base_url + "/registrations")
config.add_route("register_settings", base_url + "/registrationsettings")
Expand Down
Loading