Skip to content

ROX-13326: Use UUID columns for roles, permissionsets and simpleaccessscopes in postgres mode.#3802

Merged
rhybrillou merged 6 commits intomasterfrom
yann/ROX-13326-use_uuids_for_role_internals
Nov 20, 2022
Merged

ROX-13326: Use UUID columns for roles, permissionsets and simpleaccessscopes in postgres mode.#3802
rhybrillou merged 6 commits intomasterfrom
yann/ROX-13326-use_uuids_for_role_internals

Conversation

@rhybrillou
Copy link
Contributor

@rhybrillou rhybrillou commented Nov 14, 2022

Description

This PR was split out from #3725 . The goal is to isolate the support code from the data migration.

PR stack:
#3802 (server support code)
+- #3725 (data migration)
... +- #3818 (UI code)

Checklist

  • Investigated and inspected CI test results
  • Unit test and regression tests added
    - [ ] Evaluated and added CHANGELOG entry if required
    - [ ] Determined and documented upgrade steps
    - [ ] Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

If any of these don't apply, please comment below.

Testing Performed

CI is sufficient.

@rhybrillou
Copy link
Contributor Author

/test all

@openshift-ci
Copy link

openshift-ci bot commented Nov 14, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhybrillou rhybrillou requested a review from a team November 14, 2022 14:02
@ghost
Copy link

ghost commented Nov 14, 2022

Images are ready for the commit at a96d60a.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.73.x-27-ga96d60a256.

@rhybrillou rhybrillou force-pushed the yann/ROX-13326-use_uuids_for_role_internals branch 2 times, most recently from e9108ae to 3fb695c Compare November 14, 2022 16:25
@rhybrillou
Copy link
Contributor Author

/test all

@rhybrillou rhybrillou changed the base branch from master to yann/postgres-test-migrations November 14, 2022 22:32
@rhybrillou rhybrillou marked this pull request as ready for review November 14, 2022 22:33
@rhybrillou rhybrillou force-pushed the yann/ROX-13326-use_uuids_for_role_internals branch from 3fb695c to 44a1246 Compare November 14, 2022 23:31
Base automatically changed from yann/postgres-test-migrations to master November 15, 2022 01:15
@rhybrillou rhybrillou force-pushed the yann/ROX-13326-use_uuids_for_role_internals branch from 44a1246 to 3cb7347 Compare November 15, 2022 01:16
@janisz
Copy link
Contributor

janisz commented Nov 15, 2022

/retest

@rhybrillou
Copy link
Contributor Author

/retest

@rhybrillou
Copy link
Contributor Author

/test gke-postgres-upgrade-tests

@rhybrillou
Copy link
Contributor Author

The failure in postgres upgrade test is due to the fact that the data migration is in a separate PR.

panic: Id is not a valid uuid -- id:"io.stackrox.authz.permissionset.1ee52f65-c548-4b00-8514-0149a19f415d" name:"Continuous Integration Permissions" description:"This permission set was created as part of the migration from the old Role format to the new Role + Permission Set format." resource_to_access:<key:"Detection" value:READ_ACCESS > resource_to_access:<key:"Image" value:READ_WRITE_ACCESS > resource_to_access:<key:"VulnerabilityManagementApprovals" value:READ_WRITE_ACCESS > resource_to_access:<key:"VulnerabilityManagementRequests" value:READ_WRITE_ACCESS > 

goroutine 1 [running]:
github.com/stackrox/rox/pkg/utils.hardPanic({0x1c6ca80?, 0xc00442a7b0})
	github.com/stackrox/rox/pkg/utils/must.go:25 +0xb6
github.com/stackrox/rox/pkg/utils.Should(...)
	github.com/stackrox/rox/pkg/utils/must.go:51
github.com/stackrox/rox/migrator/migrations/n_37_to_n_38_postgres_permission_sets/postgres.insertIntoPermissionSets({0xc000fb7640?, 0x2158ae0?}, 0xc00442a4f8, 0xc000d5c840)
	github.com/stackrox/rox/migrator/migrations/n_37_to_n_38_postgres_permission_sets/postgres/postgres_plugin.go:88 +0x326
github.com/stackrox/rox/migrator/migrations/n_37_to_n_38_postgres_permission_sets/postgres.(*storeImpl).upsert(0xc002e944b8?, {0x2158ae0, 0xc002e94480}, {0xc00349e580, 0xa, 0x14ef646?})
	github.com/stackrox/rox/migrator/migrations/n_37_to_n_38_postgres_permission_sets/postgres/postgres_plugin.go:200 +0x125
github.com/stackrox/rox/migrator/migrations/n_37_to_n_38_postgres_permission_sets/postgres.(*storeImpl).UpsertMany.func1()
	github.com/stackrox/rox/migrator/migrations/n_37_to_n_38_postgres_permission_sets/postgres/postgres_plugin.go:236 +0xe9
github.com/stackrox/rox/pkg/postgres/pgutils.Retry.func1()
	github.com/stackrox/rox/pkg/postgres/pgutils/retry.go:22 +0x1b

The migration code in #3725 takes care of converting the data to UUID values.

rhybrillou and others added 4 commits November 18, 2022 10:17
Co-authored-by: Tomasz Janiszewski <tomek@redhat.com>
…sscopes (PermissionSet and SimpleAccessScope identifiers) in postgres mode. (#3725)
@rhybrillou rhybrillou force-pushed the yann/ROX-13326-use_uuids_for_role_internals branch from 4bcd8f0 to 500a3c9 Compare November 18, 2022 09:39
@rhybrillou rhybrillou force-pushed the yann/ROX-13326-use_uuids_for_role_internals branch from 10dfaa2 to 95eb79d Compare November 18, 2022 17:04
@rhybrillou rhybrillou force-pushed the yann/ROX-13326-use_uuids_for_role_internals branch from 95eb79d to a96d60a Compare November 18, 2022 17:25
@rhybrillou rhybrillou changed the title ROX-13326: Use UUID columns for roles, permissionsets and simpleaccessscopes in postgres mode - support code. ROX-13326: Use UUID columns for roles, permissionsets and simpleaccessscopes in postgres mode. Nov 20, 2022
@rhybrillou rhybrillou merged commit b379ed1 into master Nov 20, 2022
@rhybrillou rhybrillou deleted the yann/ROX-13326-use_uuids_for_role_internals branch November 20, 2022 17:28
@github-actions
Copy link
Contributor

Please merge the changes to branch release-3.73.

@github-actions
Copy link
Contributor

Please merge the changes to branch release-3.73.

janisz pushed a commit that referenced this pull request Nov 21, 2022
janisz pushed a commit that referenced this pull request Nov 21, 2022
@github-actions
Copy link
Contributor

Please merge the changes to branch release-3.73.

@janisz janisz removed this from the 3.73.0-rc.1 milestone Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants