Skip to content

Conversation

binoy14
Copy link
Contributor

@binoy14 binoy14 commented Sep 11, 2025

TL;DR

Added support for importing releases with a new ImportReleaseAction type. Please correct me if I am wrong

What changed?

  • Added a new ImportReleaseAction interface to the types system
  • Added the new action type to the ReleaseAction union type
  • The new action type includes properties for document attributes, the document itself, the release ID, and a conflict resolution strategy (ifExists)

How to test?

  1. Import the new ImportReleaseAction type in your code
  2. Create an action with actionType: 'sanity.action.release.import'
  3. Verify the action works with different ifExists strategies ('fail', 'ignore', 'replace')
  4. Confirm the action properly handles the document and its attributes

Why make this change?

This change enables importing existing documents into releases, providing flexibility in how content is managed across environments. The ifExists parameter gives users control over conflict resolution when importing documents that may already exist in a release.

Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
tsdocs-client Ignored Ignored Sep 15, 2025 3:07pm

Copy link
Contributor Author

binoy14 commented Sep 11, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

github-actions bot commented Sep 11, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.43% 3784 / 4279
🔵 Statements 88.43% 3784 / 4279
🔵 Functions 88.15% 305 / 346
🔵 Branches 90.27% 1132 / 1254
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/types.ts 100% 100% 100% 100%
Generated in workflow #3737 for commit ce50ea4 by the Vitest Coverage Report Action

@binoy14 binoy14 marked this pull request as ready for review September 11, 2025 15:17
@binoy14 binoy14 requested review from rexxars and rdyv September 11, 2025 15:17
@rexxars rexxars removed their request for review September 11, 2025 18:20
@rexxars
Copy link
Member

rexxars commented Sep 11, 2025

Don't know these actions well enough to review, will leave it to @rdyv

@tzhelyazkova tzhelyazkova self-requested a review September 15, 2025 08:31
Copy link
Member

@tzhelyazkova tzhelyazkova left a comment

Choose a reason for hiding this comment

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

release.import is used by dataset import to create a new release system document and populate it with the provided attributes based on the state of the release.
Do you plan on using it for something else besides the cli import command? Or is this just a typescript change?

@binoy14
Copy link
Contributor Author

binoy14 commented Sep 15, 2025

release.import is used by dataset import to create a new release system document and populate it with the provided attributes based on the state of the release. Do you plan on using it for something else besides the cli import command? Or is this just a typescript change?

Just adding the types for the import CLI. See context sanity-io/import#20 (comment)

@binoy14 binoy14 force-pushed the 09-11-fix_types_add_import_release_action_type branch from b485c5b to ce50ea4 Compare September 15, 2025 15:07
Copy link
Contributor

@rdyv rdyv left a comment

Choose a reason for hiding this comment

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

LGTM

@binoy14 binoy14 added this pull request to the merge queue Sep 15, 2025
Merged via the queue into main with commit d7aeae7 Sep 15, 2025
21 checks passed
@binoy14 binoy14 deleted the 09-11-fix_types_add_import_release_action_type branch September 15, 2025 23:20
@squiggler squiggler bot mentioned this pull request Sep 15, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants