-
Notifications
You must be signed in to change notification settings - Fork 219
Add erroring for when variables are given for a BulkOps query #6622
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
Add erroring for when variables are given for a BulkOps query #6622
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3368 tests passing in 1380 suites. Report generated by 🧪jest coverage report action from f788315 |
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
c8489d4 to
8585482
Compare
3f5f064 to
c58309a
Compare
8585482 to
c9000b4
Compare
c58309a to
7482fe1
Compare
c9000b4 to
4061ac4
Compare
7482fe1 to
c58309a
Compare
c58309a to
d354318
Compare
92ecc87 to
068586a
Compare
d354318 to
4cb5dbf
Compare
068586a to
ae921e6
Compare
127aa7e to
649d394
Compare
4151ee6 to
930b237
Compare
273b5f0 to
ec07863
Compare
930b237 to
7a9ed81
Compare
ec07863 to
9ef34e2
Compare
7a9ed81 to
f94d737
Compare
9ef34e2 to
cb801fe
Compare
3a4833e to
3040057
Compare
742d51c to
1e7de33
Compare
3040057 to
0cc8214
Compare
1e7de33 to
5b0a797
Compare
0cc8214 to
9cfc66c
Compare
fc9f640 to
af1941b
Compare
9cfc66c to
b07001c
Compare
8582fa3 to
e9edae7
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/ui.d.ts@@ -1,5 +1,4 @@
import { FatalError as Fatal } from './error.js';
-import { TokenizedString } from './output.js';
import { ConcurrentOutputProps } from '../../private/node/ui/components/ConcurrentOutput.js';
import { handleCtrlC, render } from '../../private/node/ui.js';
import { AlertOptions } from '../../private/node/ui/alert.js';
@@ -332,23 +331,21 @@ interface RenderTasksOptions {
* Installing dependencies ...
*/
export declare function renderTasks<TContext>(tasks: Task<TContext>[], { renderOptions, noProgressBar }?: RenderTasksOptions): Promise<TContext>;
-export interface RenderSingleTaskOptions<T> {
- title: TokenizedString;
- task: (updateStatus: (status: TokenizedString) => void) => Promise<T>;
- renderOptions?: RenderOptions;
-}
/**
- * Awaits a single task and displays a loading bar while it's in progress. The task's result is returned.
+ * Awaits a single promise and displays a loading bar while it's in progress. The promise's result is returned.
* @param options - Configuration object
- * @param options.title - The initial title to display with the loading bar
- * @param options.task - The async task to execute. Receives an updateStatus callback to change the displayed title.
- * @param options.renderOptions - Optional render configuration
- * @returns The result of the task
+ * @param options.title - The title to display with the loading bar
+ * @param options.taskPromise - The promise to track
+ * @param renderOptions - Optional render configuration
+ * @returns The result of the promise
* @example
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
* Loading app ...
*/
-export declare function renderSingleTask<T>({ title, task, renderOptions }: RenderSingleTaskOptions<T>): Promise<T>;
+export declare function renderSingleTask<T>({ title, taskPromise }: {
+ title: string;
+ taskPromise: Promise<T> | (() => Promise<T>);
+}, { renderOptions }?: RenderTasksOptions): Promise<T>;
export interface RenderTextPromptOptions extends Omit<TextPromptProps, 'onSubmit'> {
renderOptions?: RenderOptions;
}
packages/cli-kit/dist/private/node/ui/components/SingleTask.d.ts@@ -1,9 +1,8 @@
-import { TokenizedString } from '../../../../public/node/output.js';
-interface SingleTaskProps<T> {
- title: TokenizedString;
- task: (updateStatus: (status: TokenizedString) => void) => Promise<T>;
- onComplete?: (result: T) => void;
+import React from 'react';
+interface SingleTaskProps {
+ title: string;
+ taskPromise: Promise<unknown>;
noColor?: boolean;
}
-declare const SingleTask: <T>({ task, title, onComplete, noColor }: SingleTaskProps<T>) => JSX.Element | null;
+declare const SingleTask: ({ taskPromise, title, noColor }: React.PropsWithChildren<SingleTaskProps>) => JSX.Element | null;
export { SingleTask };
\ No newline at end of file
|
e9edae7 to
5e6055a
Compare
Merge activity
|
5e6055a to
f788315
Compare

Resolves: https://github.com/shop/issues-api-foundations/issues/1047?issue=shop%7Cissues-api-foundations%7C1097
Background
Variables are only supported for bulkOperationRunMutation, not bulkOperationRunQuery.
The workflow of the CLI command is shown here. This PR is represented by the leftmost side of this diagram.
Testing
Try running
This should error because queries do not support variables.
While,
should return a successful BulkOps Query.