Skip to content

feat(backend): allow tenant id to be specified during tenant creation #3457

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

Merged
merged 4 commits into from
Jun 10, 2025

Conversation

njlie
Copy link
Contributor

@njlie njlie commented Jun 10, 2025

Changes proposed in this pull request

  • Allows id to be specified during the createTenant mutation. If not provided, the id will be generated automatically.
  • Adds a specified id to the tenant seed for the Tenanted Mock ASE.

Context

Fixes #3456 or #RAF-1070.

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@njlie njlie requested a review from mkurapov June 10, 2025 18:52
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. type: source Changes business logic pkg: mock-ase pkg: mock-account-service-lib labels Jun 10, 2025
Copy link

github-actions bot commented Jun 10, 2025

🚀 Performance Test Results

Performance test summary not found.

📜 Logs

> [email protected] run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set


  █ TOTAL RESULTS 

    HTTP
    http_req_duration....................: avg=1.18ms min=1.18ms med=1.18ms max=1.18ms p(90)=1.18ms p(95)=1.18ms
    http_req_failed......................: 100.00% 1 out of 1
    http_reqs............................: 1       354.669166/s

    NETWORK
    data_received........................: 232 B   82 kB/s
    data_sent............................: 492 B   175 kB/s



/home/runner/work/rafiki/rafiki/test/performance:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  [email protected] run-tests:testenv: `./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"`
Exit status 107

Comment on lines 1622 to 1623
"Unique identifier of the tenant. Will be generated automatically if not provided."
id: ID
Copy link
Contributor

Choose a reason for hiding this comment

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

I think good to specify uuid4 here

const tenant = await Tenant.query(trx).insertAndFetch({
id,
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a quick uuidv4 validation here so we can specify a good error message to the client

@njlie njlie merged commit b529ae5 into 2893/multi-tenancy-v1 Jun 10, 2025
38 checks passed
@njlie njlie deleted the nl/3456/specify-tenant-id branch June 10, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. pkg: mock-account-service-lib pkg: mock-ase type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants