Skip to content
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

DEVPROD-12399: Introduce Repo GQL query #8717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SupaJoon
Copy link
Contributor

DEVPROD-12399

Description

These code changes add a repo query to satisfy the use case where project info must be fetched for resources that are associated with a repoId but not a projectIdentifier. The query is very similar to the project query and will unblock fetching Parsley filters in Parsley.

return nil, InternalServerError.Send(ctx, fmt.Sprintf("looking in repo collection: %s", err.Error()))
}
if repoRef == nil {
return nil, ResourceNotFound.Send(ctx, "repo doesn't exist")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. we could add the repoID here for more information

@@ -56,6 +56,7 @@ type Query {
before: Time
): ProjectEvents!
projectSettings(projectIdentifier: String! @requireProjectAccess(permission: SETTINGS, access:VIEW)): ProjectSettings!
repo(repoId: String! @requireProjectAccess(permission: TASKS, access: VIEW)): RepoRef!
Copy link
Contributor

@minnakt minnakt Feb 18, 2025

Choose a reason for hiding this comment

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

okay now that I'm thinking about it, I feel like we don't have any built-in support for the condition "If user has task permission for a project, they should also have task permission for the repo" and we would have to write code to support it.

it is kind of a weird condition but I think we need to have the permission restriction to block access to restricted projects

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to add a test for no_permissions? There is a new field, "test_user_id", that can be used in the results file. It specifies which user the test should run with.

There are three users you can pick from: admin_user, privileged_user, and regular_user. You can see their permissions in integration_atomic_test_util.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants