-
Notifications
You must be signed in to change notification settings - Fork 407
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
Easy Deploy on Save #822
Easy Deploy on Save #822
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #822 +/- ##
===========================================
- Coverage 73.26% 73.18% -0.08%
===========================================
Files 168 174 +6
Lines 6815 6997 +182
Branches 1076 1094 +18
===========================================
+ Hits 4993 5121 +128
- Misses 1550 1599 +49
- Partials 272 277 +5
Continue to review full report at Codecov.
|
.vscode/launch.json
Outdated
@@ -38,7 +38,8 @@ | |||
"args": ["--extensionDevelopmentPath=${workspaceRoot}/packages"], | |||
"stopOnEntry": false, | |||
"sourceMaps": true, | |||
"outFiles": ["${workspaceRoot}/packages/*/out/src/**/*.js"] |
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.
Please disregard changes made to this file. I will be reverting all changes.
c727e41
to
c8b8c70
Compare
const WAIT_TIME_IN_MS = 50; | ||
|
||
export async function registerPushOrDeployOnSave() { | ||
if (sfdxCoreSettings.getPushOrDeployOnSaveEnabled()) { |
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.
We only register the file watcher if the push-or-deploy-on-save setting is already set to true on core activation. This means that if a user wants to turn on the feature, they will have to restart VS Code.
Disablement of the feature will be respected immediately due to the checks made in lines 43, 56, and 65, and will not require a restart of the extension.
@@ -1,3 +0,0 @@ | |||
{ |
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.
Why do we need to delete this ?
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.
Thanks for catching this. I did not mean to delete this and will put it back.
|
||
vscode.workspace.onDidChangeTextDocument(e => { | ||
if (ForceSourceDeployExecutor.errorCollection.has(e.document.uri)) { | ||
ForceSourceDeployExecutor.errorCollection.delete(e.document.uri); | ||
} | ||
}); | ||
|
||
export class ForceSourceDeployExecutor extends SfdxCommandletExecutor< | ||
SelectedPath | ||
export abstract class ForceSourceDeployExecutor extends SfdxCommandletExecutor< |
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.
Awesome, this makes every type of deploy command render any deploy errors in the problem view.
const commandBuilder = new SfdxCommandBuilder() | ||
.withDescription(nls.localize('force_source_deploy_text')) | ||
.withArg('force:source:deploy') | ||
.withLogName('force_source_deploy') |
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.
Lets change this to fource_source_deploy_with_manifest
const commandBuilder = new SfdxCommandBuilder() | ||
.withDescription(nls.localize('force_source_deploy_text')) | ||
.withArg('force:source:deploy') | ||
.withLogName('force_source_deploy') |
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.
Lets change this to force_source_deploy_with_sourcepath
to keep consistency with the log ids for the retrieve commands.
if (sourcePathIsInPackageDirectory) { | ||
return inputs; | ||
} | ||
} catch (error) {} |
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.
We should log this error and/or send it to our telemetry service.
|
||
let sourcePathIsInPackageDirectory = false; | ||
for (const packagePath of fullPackagePaths) { | ||
if (sourcePath.startsWith(packagePath)) { |
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.
Wouldn't packagePath
be something like force-app
and sourcePath
be something like Users/myuser/repo_name/force-app
?
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.
Disregard this, I've checked and I was wrong 👍
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.
🚢
Thanks for the contribution! Unfortunately we can't verify the commit author(s): Alli <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request. |
What does this PR do?
When the workspace setting for deploy-on-save is enabled, changes made to files inside of a package directory will trigger an automatic push or deploy, depending on the type of org that is connected to the workspace.
Note: This functionality is not working in Windows due to a problem with the GlobPattern and I have followed the following issue with VS Code: microsoft/vscode#65240
What issues does this PR fix or reference?
W-5552627, #577, #662