fix: validate organization group project associations#4082
Open
officialasishkumar wants to merge 1 commit into
Open
fix: validate organization group project associations#4082officialasishkumar wants to merge 1 commit into
officialasishkumar wants to merge 1 commit into
Conversation
Reject adding or checking an existing group for an organization when the group already references projects outside the target organization, including the empty-organization case. Add resolver coverage for empty, mismatched, and matching project associations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General Checklist
Database Migrations
Description
checkOrgProjectGrouponly compared a group's project IDs against the target organization's project IDs when the organization already had at least one project. That made the empty-organization error branch unreachable and allowedgetGroupProjectOrganizationAssociation/addExistingGroupToOrganizationto accept a group that already referenced projects outside the requested organization.This updates the validation to run whenever the group has project associations. Groups are now rejected when any associated project is not part of the target organization, including the case where the target organization has no projects. A focused resolver test covers the empty organization rejection, the non-empty organization mismatch, and the matching-project success case.
Validation performed:
yarn --cwd node-packages/commons buildyarn --cwd services/api jest --forceExit --detectOpenHandles organization.test.tsyarn --cwd services/api build./node_modules/.bin/prettier --check services/api/src/resources/organization/organization.test.tsgit diff --checkI also ran
yarn --cwd services/api jest --forceExit --detectOpenHandles; the new organization test passes, but the broader local suite still fails on unrelated existing issues: stale SQL snapshots in notification/environment tests, missingsrc/resources/sshKey/index, and anode-fetchESM parse failure throughadvancedtasktoolbox.Closing issues
Closes #4081