Skip to content

VERY BREAKING: Rename data and operations schemas#353

Open
MoralCode wants to merge 26 commits into
mainfrom
rename/schema
Open

VERY BREAKING: Rename data and operations schemas#353
MoralCode wants to merge 26 commits into
mainfrom
rename/schema

Conversation

@MoralCode
Copy link
Copy Markdown
Contributor

@MoralCode MoralCode commented May 29, 2026

Description
This PR renames the two core schemas CollectOSS uses

augur_data -> collection_data
augur_operations -> collection_operations

This change will be breaking for any downstream uses of the old CollectOSS schema names

The database migration included here is just an ALTER SCHEMA query and some small adjustments to existing schema comments - it is fully/losslessly reversible in case it is found to cause issues

This PR fixes #324

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

MoralCode added 24 commits May 27, 2026 15:51
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…tion)

Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

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

Bandit found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

def get_user_repos(connection):

return connection.execute(s.text("""SELECT * FROM "augur_operations"."user_repos";""")).fetchall()
return connection.execute(s.text("""SELECT * FROM "collection_operations"."user_repos";""")).fetchall()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

connection.execute("""DELETE FROM augur_operations.config""")
connection.execute("""DELETE FROM collection_operations.config""")

def test_get_config_key_with_none_specified(key_handler, test_db_engine):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'key_handler' from outer scope (line 22) (redefined-outer-name)

@@ -9,11 +9,11 @@
@pytest.fixture
def set_up_repo_groups(database_connection):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'database_connection' from outer scope (line 2) (redefined-outer-name)

def set_up_repo_groups(database_connection):

df = pd.read_sql(s.sql.text("SELECT repo_group_id FROM augur_data.repo_groups"), database_connection)
df = pd.read_sql(s.sql.text("SELECT repo_group_id FROM collection_data.repo_groups"), database_connection)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

df = pd.read_sql(s.sql.text("SELECT repo_group_id FROM collection_data.repo_groups"), database_connection)
repo_group_IDs = df['repo_group_id'].values.tolist()

insert_repo_group_sql = s.sql.text("""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)


repo_group_IDs = [group[0] for group in df.fetchall()]

insertSQL = s.sql.text("""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

@@ -12,7 +12,7 @@ def poll_database_connection(database_string):
print("Attempting to create db engine")

db = s.create_engine(database_string, poolclass=s.pool.NullPool,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

@@ -12,7 +12,7 @@ def poll_database_connection(database_string):
print("Attempting to create db engine")

db = s.create_engine(database_string, poolclass=s.pool.NullPool,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

self.db_schema = 'collectoss_data'
self.helper_schema = 'collection_operations'

self.helper_db = s.create_engine(DB_STR, poolclass=s.pool.NullPool,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

self.db_schema = 'collectoss_data'
self.helper_schema = 'collection_operations'

self.helper_db = s.create_engine(DB_STR, poolclass=s.pool.NullPool,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0602: Undefined variable 's' (undefined-variable)

@MoralCode MoralCode added this to the v1.1 Migration Release milestone May 29, 2026
@MoralCode MoralCode added the database Related to the unifed data model/schema label May 29, 2026
MoralCode added 2 commits May 29, 2026 11:51
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database Related to the unifed data model/schema

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename database schema names (augur_data, etc)

2 participants