-
Notifications
You must be signed in to change notification settings - Fork 143
feat: Add Option to Suppress Pre- and Post-Retrieve Events #854
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
Changes from all commits
0c3d98f
1106b7a
64f6127
b7c7a34
e0a323e
67434eb
ab80078
4c35b7a
ccb0c25
ecd6c06
c1ec2f5
0c8e8c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -326,6 +326,10 @@ export interface RetrieveOptions { | |
| * Specifies whether to unzip the retrieved zip file. Only applies when `format: metadata`. | ||
| */ | ||
| unzip?: boolean; | ||
| /** | ||
| * Specifies whether to suppress the <Pre|Post><Retrieve> events | ||
| */ | ||
| suppressEvents?: boolean; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only suppressing Pre and Post retrieve events. Other events are still fired (like apiVersionRetrieve). |
||
| } | ||
|
|
||
| export interface MetadataApiDeployOptions { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,6 +208,20 @@ describe('ComponentSet', () => { | |
| unpackaged: { types: [{ members: ['Test'], name: 'ApexClass' }], version: manifestVersion }, | ||
| }); | ||
| }); | ||
|
|
||
| it('should not emit pre- or post-retrieve events with the suppressEvents setting set to true', async () => { | ||
| componentSet = await ComponentSetBuilder.build({ sourcepath: [sourcepath] }); | ||
| await stubConnection(); | ||
| await componentSet.retrieve({ output: '', usernameOrConnection: connection, suppressEvents: true }); | ||
|
|
||
| let preAndPostRetrieveEventCount = 0; | ||
| lifecycleEmitStub.args.forEach((event) => { | ||
| if (event[0] === ('scopedPreRetrieve' || 'scopedPostRetrieve')) { | ||
| preAndPostRetrieveEventCount = preAndPostRetrieveEventCount + 1; | ||
| } | ||
| }); | ||
| expect(preAndPostRetrieveEventCount).to.equal(0); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only checking for the absence of Pre and Post retrieve events. |
||
| }); | ||
| }); | ||
|
|
||
| describe('deploy', () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "componentSetCreate", | ||
| "duration": 314.8237599999993 | ||
| "duration": 344.26991400000406 | ||
| }, | ||
| { | ||
| "name": "sourceToMdapi", | ||
| "duration": 7607.062248000002 | ||
| "duration": 8409.486489000003 | ||
| }, | ||
| { | ||
| "name": "sourceToZip", | ||
| "duration": 6249.7481109999935 | ||
| "duration": 6911.691437000001 | ||
| }, | ||
| { | ||
| "name": "mdapiToSource", | ||
| "duration": 5729.999462999986 | ||
| "duration": 5980.411838 | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "componentSetCreate", | ||
| "duration": 677.3227829999814 | ||
| "duration": 666.2776299999969 | ||
| }, | ||
| { | ||
| "name": "sourceToMdapi", | ||
| "duration": 11628.18376700001 | ||
| "duration": 11784.642793000006 | ||
| }, | ||
| { | ||
| "name": "sourceToZip", | ||
| "duration": 9789.493870999984 | ||
| "duration": 9004.190682999993 | ||
| }, | ||
| { | ||
| "name": "mdapiToSource", | ||
| "duration": 8767.531892999978 | ||
| "duration": 8077.6561640000145 | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "componentSetCreate", | ||
| "duration": 1097.0085559999861 | ||
| "duration": 1166.675390999997 | ||
| }, | ||
| { | ||
| "name": "sourceToMdapi", | ||
| "duration": 16553.773215000023 | ||
| "duration": 18113.351571000007 | ||
| }, | ||
| { | ||
| "name": "sourceToZip", | ||
| "duration": 14349.35624600001 | ||
| "duration": 14997.718697000004 | ||
| }, | ||
| { | ||
| "name": "mdapiToSource", | ||
| "duration": 14337.243206000014 | ||
| "duration": 13485.154669999989 | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "componentSetCreate", | ||
| "duration": 199.62190299999202 | ||
| }, | ||
| { | ||
| "name": "sourceToMdapi", | ||
| "duration": 5130.159515000007 | ||
| }, | ||
| { | ||
| "name": "sourceToZip", | ||
| "duration": 4675.235429000022 | ||
| }, | ||
| { | ||
| "name": "mdapiToSource", | ||
| "duration": 3208.6088720000116 | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "componentSetCreate", | ||
| "duration": 410.4985020000022 | ||
| }, | ||
| { | ||
| "name": "sourceToMdapi", | ||
| "duration": 7788.398672999989 | ||
| }, | ||
| { | ||
| "name": "sourceToZip", | ||
| "duration": 8867.863911000022 | ||
| }, | ||
| { | ||
| "name": "mdapiToSource", | ||
| "duration": 4871.89470200002 | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "componentSetCreate", | ||
| "duration": 656.9274350000196 | ||
| }, | ||
| { | ||
| "name": "sourceToMdapi", | ||
| "duration": 11477.084537999996 | ||
| }, | ||
| { | ||
| "name": "sourceToZip", | ||
| "duration": 11235.755581000005 | ||
| }, | ||
| { | ||
| "name": "mdapiToSource", | ||
| "duration": 8346.796450999973 | ||
| } | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file auto-updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, from git hooks.