Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: migration - use unique id for Collections This migration abandons the composite primary key (id, visibility) approach for the project / Collections table and enforces a unique id. Going forward, revisions will be identified by their unique id rather than by the id of their public-facing Collection coupled with visibility=PRIVATE. At the time of this commit, there are no revisions in progress in the corpora_prod database. * fix: prefix revision id comment with seq num Co-authored-by: Kuni Katsuya <kkatsuya@chanzuckerberg.com> * fix: update visibility to PRIVATE when downgrading * feat: add 'revision' relationship to DbCollection This commit also refactors foreign keys to inline * refactor: improve foreign key ref column notations Referencing `id` within DbCollection for `revision_of` by using `project.id` means that `id` doesn't have to be redefined (already in Base class but interpreter otherwise sees the builtin id method) Co-authored-by: Trent Smith <1429913+Bento007@users.noreply.github.com> * fix: add unique constraint to project.revision_of There should only ever be a single revision open at one time for a given public Collection * feat!: backend changes for Collection primary key migration BREAKING_CHANGE: This commit is a temporary stopping point and represents the migration of all backend service code from using the composite key for Collections (`id`, `visibility`) in the `project` table to using a unique `id` as the primary key for every Collection. * fix: move a commit operation plus refactoring Move the commit for Collection revision creation to after the creation of individual Dataset revisions. Remove unnecessary comments and add Session type hint to function definitions. * refactor: revert format for wmg example in corpora-api spec * fix: update unit tests and work in migration * Return revison_of when listing collections * fix tests.unit.processing_container.test_process.TestDatasetProcessing * feat: remove visibility from url's and api requests (#2197) * add revision_off attribute * alter queries and mutations * change query/mutation callsites * revert to passing only attributes and not whole obj * 7 Levels of prop drilling 💀 * retype new file mutation * fix: rename migration * fix: add a cognitive-complexity lint skip * fix: 'collections' path for legacy links * remove private redirects * fix cognitive complexity * handle new revision creation flow * handle collections with new `revision_of` * fix typo in collection link * fix: remove window location manipulation * fix: DatasetUploadStatus import bug fix * properly assign key id * debugging logs * one more log * redirect properly on revision publish * remove non-existant attr * first past of revision/published id links * first past of revision/published id links * remove unneeded revision_of checks * fix diffing * don't redirect if private publish * handle private collection publish * add handled success state * invalidate collection on private publish * refresh on publish * one more ignored collection field for diff * possibly fix edit collection issue * fix: add `id` to ignored fields (#2240) * add logs * do not check collection id for diffs * Revert "add logs" This reverts commit d177ef1. Co-authored-by: Daniel Hegeman <daniel.hegeman@chanzuckerberg.com> Co-authored-by: Trent Smith <1429913+Bento007@users.noreply.github.com> * fix call to test snapshot module in setup_dev_data.sh * incorporate removal of DatasetArtifactType * pkey migration changes in wmg tests * lint cleanup * clean up migration * incorporate cloudfront invalidation test * more cleanup * cleanup, docstring * fix import scheme to prevent circular import error * chore: attempt to fix circular import Unit tests are passing locally but not in Github Actions * fix module access typo * another import fix attempt * Revert "another import fix attempt" This reverts commit ff55991. * Revert "fix module access typo" This reverts commit 70ae87d. * Revert "chore: attempt to fix circular import" This reverts commit 01e712a. * Revert "fix import scheme to prevent circular import error" This reverts commit 70fbcd0. * Move CollectionLink to own file * fix: black version bump to be compatible with click * fix accidental blank lines Co-authored-by: Kuni Katsuya <kkatsuya@chanzuckerberg.com> Co-authored-by: Trent Smith <1429913+Bento007@users.noreply.github.com> Co-authored-by: Trent Smith <trent.smith@chanzuckerberg.com> Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
- Loading branch information