Skip to content

fix(api): CreateOrganizationAccessTokenInput.description nullability#8057

Merged
n1ru4l merged 6 commits into
mainfrom
fix-8056
May 27, 2026
Merged

fix(api): CreateOrganizationAccessTokenInput.description nullability#8057
n1ru4l merged 6 commits into
mainfrom
fix-8056

Conversation

@dotansimha

Copy link
Copy Markdown
Member

Fixes #8056

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the organization access token creation logic to default the description to an empty string instead of null. However, feedback indicates this fix is incomplete as it does not address existing null descriptions in the database which cause API crashes, nor does it cover project or personal tokens. It is recommended to move this logic to the data model or provider level to ensure consistency and handle legacy data.

@dotansimha dotansimha requested a review from n1ru4l May 18, 2026 15:20
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 6f630960aeee198c00e737c8d0924de2c47ae1cf

@n1ru4l n1ru4l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On the GraphQL type the description is nullable:

Image

This I think the correct approach is to instead fix the zod model to allow a nullable description property.

Image

Also this fix would not solve existing database records as the AI comment points out. <- Should have read the issue first. We should fix the table definition removing the non null constraint.

@dotansimha dotansimha marked this pull request as draft May 19, 2026 16:38
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/cli 0.59.3-alpha-20260527093326-6f630960aeee198c00e737c8d0924de2c47ae1cf npm ↗︎ unpkg ↗︎
hive 11.1.2-alpha-20260527093326-6f630960aeee198c00e737c8d0924de2c47ae1cf npm ↗︎ unpkg ↗︎

@n1ru4l n1ru4l self-requested a review May 27, 2026 09:30
run: ({ psql }) => psql`
ALTER TABLE IF EXISTS organization_access_tokens
ADD COLUMN IF NOT EXISTS "expires_at" TIMESTAMP WITH TIME ZONE
ADD COLUMN IF NOT EXISTS "expires_at" TIMESTAMP WITH TIME ZONE

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oopsi?

@n1ru4l n1ru4l changed the title fix(api): default CreateOrganizationAccessTokenInput.description to be empty string fix(api): CreateOrganizationAccessTokenInput.description nullability May 27, 2026
@n1ru4l n1ru4l marked this pull request as ready for review May 27, 2026 11:02
@n1ru4l n1ru4l merged commit 5c76de1 into main May 27, 2026
24 checks passed
@n1ru4l n1ru4l deleted the fix-8056 branch May 27, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

CreateOrganizationAccessTokenInput.description marked as nullable String, but it is required in the DB

2 participants