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

GQL: datasets.byOwnerAndName should not return account prefixed alias in a single-tenant workspace #1019

Open
andriidemus opened this issue Dec 27, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@andriidemus
Copy link
Contributor

Describe the bug

We parse prefixed alias, as an alias from multi-tenant workspace.
For the consistency, it makes sense to make datasets.byOwnerAndName return unprefixed alias in case of singe-tenant workspace.

Here are several API calls examples in both single- and multi-tenant workspaces

Steps To Reproduce

  1. Create single tenant workspace
kamu init
  1. Start server
kamu system api-server --http-port 55667 --get-token
export KAMU_AUTH_TOKEN="<token>"
  1. Create empty dataset
curl -s 'http://127.0.0.1:55667/graphql' \
  --header "Authorization: Bearer $KAMU_AUTH_TOKEN" \
  --data-raw '{"query": "mutation { datasets { createEmpty(datasetKind: ROOT, datasetAlias: \"empty-root-dataset\") { message ... on CreateDatasetResultSuccess { dataset { alias } } } } }"}'
  1. Get dataset alias
curl -s 'http://127.0.0.1:55667/graphql' \
  --header "Authorization: Bearer $KAMU_AUTH_TOKEN" \
  --data-raw '{"query": "{ datasets { byOwnerAndName (accountName: \"kamu\", datasetName: \"empty-root-dataset\") {alias owner {accountName}} } }"}' \
  | jq .data.datasets.byOwnerAndName.alias

Current Behavior

Dataset alias prefixed with account name: "<account_name>/"

{
  "data": {
    "datasets": {
      "byOwnerAndName": {
        "alias": "kamu/empty-root-dataset",
      }
    }
  },
  "extensions": {}
}

Expected Behavior

Dataset alias format without account name prefix

{
  "data": {
    "datasets": {
      "byOwnerAndName": {
        "alias": "empty-root-dataset",
      }
    }
  },
  "extensions": {}
}

kamu system info

build:
  appVersion: 0.215.0

Logs

No response

Anything else?

No response

@andriidemus andriidemus added the bug Something isn't working label Dec 27, 2024
@andriidemus andriidemus self-assigned this Dec 27, 2024
@s373r
Copy link
Member

s373r commented Dec 27, 2024

Offtop: @demusdev , you can run a GQL query using the following command:

kamu system api-server gql-query '{ apiVersion }'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants