Skip to content

Conversation

@designcode
Copy link
Collaborator

@designcode designcode commented Dec 23, 2025

Note

Introduces a new IAM SDK and centralizes shared HTTP/config utilities while refactoring packages and CI.

  • Adds @tigrisdata/iam with listOrganizations and createOrganization, plus IAM-specific config, http-client, and types
  • Extracts shared modules: @shared/{config,headers,http-client,types} and adopts them across packages
  • Refactors Storage to use shared headers/client and its own config/types; removes organization APIs from Storage exports
  • Simplifies Keyv adapter: new KeyvTigrisOptions, streamlined config usage, updated exports
  • Unifies testing/build via vitest.config.base.ts and tsconfig.base.json; merges per-package Vitest configs
  • CI: GitHub Actions now runs workspace-wide build and test; consolidate release configs at repo root

Written by Cursor Bugbot for commit 9fda58a. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link

greptile-apps bot commented Dec 23, 2025

Greptile Summary

Creates new @tigrisdata/iam package by extracting organization management functionality from storage package. Refactors shared code (HTTP client, headers, config utilities, types) into a shared/ directory accessible to all packages.

Key Changes:

  • Extracted HTTP client with caching to shared/http-client.ts for reuse across packages
  • Moved TigrisHeaders enum and TigrisResponse type to shared location
  • Created new IAM package with listOrganizations and createOrganization functions
  • Removed organization functionality and HTTP client from storage package
  • Consolidated build/test commands in CI workflow
  • Added base configs (tsconfig.base.json, vitest.config.base.ts) for consistent tooling

Issues Found:

  • createOrganization blocks users with no orgs from creating orgs via API (line 28-34), contradicting the error message
  • Session token validation happens after client creation in listOrganizations (inefficient ordering)
  • HTTP client error responses lose detail from response body

Confidence Score: 3/5

  • PR has solid refactoring but contains a logical error in createOrganization that blocks intended functionality
  • The refactoring is well-structured with proper code extraction and shared utilities. However, the createOrganization function has a critical logic flaw preventing users without existing orgs from creating orgs via the API, which appears to contradict its intended purpose. The error message suggests going to the console, but this defeats the purpose of having an API function.
  • packages/iam/src/lib/organization/create.ts requires attention for the org creation logic

Important Files Changed

Filename Overview
shared/http-client.ts extracted shared HTTP client from storage package with caching
shared/headers.ts extracted Tigris headers enum to shared location
shared/config.ts extracted shared config utilities for reuse across packages
packages/iam/src/lib/organization/create.ts creates organization after listing existing ones to get org ID
packages/iam/src/lib/organization/list.ts lists organizations via IAM endpoint with session token auth
packages/storage/src/lib/tigris-client.ts removed HTTP client code, now imports TigrisHeaders from shared

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. packages/iam/src/lib/organization/create.ts, line 28-34 (link)

    logic: function prevents creating org when user has no existing orgs, which contradicts error message suggesting first org should be created via console

    is this check intentional to require at least one org exists before creating additional orgs via API?

41 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

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