Skip to content

Conversation

@AnatoliB
Copy link
Contributor

Resolves issue #521

@AnatoliB AnatoliB marked this pull request as ready for review August 14, 2020 03:17
@AnatoliB
Copy link
Contributor Author

/cc @pragnagopa


var setCurrentDirMessage = string.Format(PowerShellWorkerStrings.SettingCurrentDirectory, environmentReloadRequest.FunctionAppDirectory);
rpcLogger.Log(isUserOnlyLog: false, LogLevel.Trace, setCurrentDirMessage);
Directory.SetCurrentDirectory(environmentReloadRequest.FunctionAppDirectory);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check that the directory exists before setting it? I remember that in the past for proxy call the working directory could be null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking for null: yes, thank you, done.
Checking that the directory exists: I don't know if we have a better way of handling the situation when it does not exist. Perhaps the best we can do is trust the host and fail if it does not exist - this is what NodeJs and Python workers also do.

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Trusting the host is OK. Any error handling should be done in the host for this.

Copy link
Contributor

@Francisco-Gamino Francisco-Gamino left a comment

Choose a reason for hiding this comment

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

One minor comment.
Also, I don't remember if for updating protobuff files the we need a separate PR just for that, so please follow-up with @pragnagopa. Other than that, LGTM.

Copy link
Member

@pragnagopa pragnagopa left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM. Added a minor comment on tests.

@AnatoliB AnatoliB merged commit 9fecf1d into Azure:dev Aug 17, 2020
@AnatoliB AnatoliB deleted the change-app-directory branch August 17, 2020 21:19
AnatoliB added a commit to AnatoliB/azure-functions-powershell-worker that referenced this pull request Aug 18, 2020
* Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.3.8-protofile. Commit: 8db40c8

* Set current directory on environment reload request
AnatoliB added a commit to AnatoliB/azure-functions-powershell-worker that referenced this pull request Aug 18, 2020
* Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.3.8-protofile. Commit: 8db40c8

* Set current directory on environment reload request
AnatoliB added a commit to AnatoliB/azure-functions-powershell-worker that referenced this pull request Aug 18, 2020
* Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.3.8-protofile. Commit: 8db40c8

* Set current directory on environment reload request
AnatoliB added a commit that referenced this pull request Aug 18, 2020
* Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.3.8-protofile. Commit: 8db40c8

* Set current directory on environment reload request
AnatoliB added a commit that referenced this pull request Aug 18, 2020
* Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.3.8-protofile. Commit: 8db40c8

* Set current directory on environment reload request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants