Skip to content
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

Plumb [File] on SDK's new BindToInput rule. #314

Closed
wants to merge 1 commit into from
Closed

Conversation

MikeStall
Copy link
Contributor

FileTrigger is not changed.
The key difference here is remove the file binding provider classses and using the rules. See FilesExtensionConfig.Initialize

This relies on Azure/azure-webjobs-sdk#1387 from SDK.

FileTrigger is not changed.
The key difference here is remove the file binding provider classses and using the rules. See FilesExtensionConfig.Initialize
var fileInfo = GetFileInfo(attribute);
if ((attribute.Access == FileAccess.Read) && !fileInfo.Exists)
{
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Letting the FileInfo.Open() call below call an exception below may provide a more clear error message than returning a null value for the Stream.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at your unit tests on the other PR, it appears we want to return null here since there isn't a reliable exception for the file not existing. Adding a comment here would help make that more clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, null is the contract for "does not exist"

context.Config.RegisterBindingExtensions(
new FileTriggerAttributeBindingProvider(_filesConfig, context.Trace),
new FileAttributeBindingProvider(_filesConfig, context.Config.NameResolver));
new FileTriggerAttributeBindingProvider(_filesConfig, context.Trace)
Copy link
Member

@mathewc mathewc Oct 24, 2017

Choose a reason for hiding this comment

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

Does this binding provider now handle trigger as well as non-trigger bindings (e.g. the input/output file bindings). If so, then it might make sense to remove "trigger" from its name. All the e2e tests are passing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No change to triggers yet. So we still need the TriggerBindingProviders. I had a separate idea that may improve this, but will tackle later.

@MikeStall
Copy link
Contributor Author

Superseded by #331

@MikeStall MikeStall closed this Nov 29, 2017
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.

4 participants