-
Notifications
You must be signed in to change notification settings - Fork 20
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
RBAC for Test Repositories - Issue #105 #855
Conversation
Migrated database to include new team/test repo role mappings
-Added Test Repo permission checks in update/delete repo -Added code to add test repo/team role mappings to db - Currently broken -Updated the calls to crud in routers to include requisite user object -Updated roles and actions to include update/delete roles/actions
Code Coverage Summary
Linter reportsPylint report
Black report
Isort report
Bandit report
View full reports on the Job Summary page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amizhen! Great job on your very first contribution to ALBS!
Overall, looks good, but needs some work. I left some review comments, none of them critical but must be addressed.
sa.ForeignKeyConstraint(['test_repository_id'], ['test_repositories.id'], name='fk_test_repositories_role_mapping_product_id', ondelete='CASCADE'), | ||
sa.PrimaryKeyConstraint('test_repository_id', 'role_id') | ||
) | ||
op.alter_column('build_releases', 'status', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to figure out why all these nullable=False
are getting introduced in the migration. I bet is a side effect from recent migration to fastapi-sqla. @Korulag, any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, when I was experimenting on it, it was not introducing unnecessary nullable=False
statements unless it really needed to do so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this seems to be a side-effect of the recent migration to sqlalchemy 2. I checked one by one in production db and all can be safely updated to set nullable
to False
, but some of them need to be handled:
build_tasks.mock_options
: these are old builds from 2021 - I'd say that we can update these with an empty{}
or, if we don't want to, turn this intonullable=True
builds.mock_options
: these are old builds from 2021-2022 - I'd say that we can update these with a{'definitions': {}}
or, if we don't want to, make itnullable=True
builds.cancel_testing
- These are builds before the introduction of cancel_testing - can set those without cancel_testing with default value (False)
@Korulag any thoughts? Also, would you like to make these adjustments within this PR? Or do you prefer to create another one?
@@ -1,12 +1,12 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave this file untouched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up
Regarding the tests failure of |
ALBS is still on Python 3.9 and osv is moving to >3.11 See: google/osv.dev#2281
If the first match in the affected regex search is the devel module, we fail when trying to map errata packages later. Fixes: AlmaLinux/build-system#304
* origin/master: Fix MissingGreenlet in getting new test tasks Bump fastapi-sqla from 3.1.2 to 3.3.0 Bump pylint from 3.2.2 to 3.2.3 Bump pytest from 8.2.1 to 8.2.2 Bump pydantic-settings from 2.3.1 to 2.3.2 Disable expire_on_commit in some interactions with pulp db Bump structlog from 24.1.0 to 24.2.0 Bump pydantic-settings from 2.2.1 to 2.3.1 Bump pydantic from 2.7.1 to 2.7.3 Bump sentry-sdk[fastapi] from 2.2.1 to 2.5.1 Ensure we get the non-devel module from OVAL data (AlmaLinux#859) Separated packages list in failed errata release Add platform_id in /errata/all/ endpoint (AlmaLinux/build-system#207) Bump uvicorn from 0.29.0 to 0.30.1 Bump errata2osv from 0.0.3 to 0.0.4 (AlmaLinux#856)
CLOSED: PR MOVED TO: #881
Resolves: AlmaLinux/build-system#105
•Teams must now be assigned to Test Repositories upon creation
•Only members of a Test Repo's team can modify the Test Repo
•Done in conjunction with a pull request in frontend: https://github.com/amizhen/albs-frontend/tree/bs-105