Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
331 stars 100 forks source link

bug: Backport 4.27: Update function directory in load request to use /home/site/wwwroot #1481

Closed gavin-aguiar closed 2 months ago

gavin-aguiar commented 2 months ago

Description

This fixes a bug introduced in https://github.com/Azure/azure-functions-python-worker/pull/1446.

For function apps using FWPC > 1 and using blueprints, the second worker does not get the metadata request. In the load request, the worker uses the function directory sent from the host. This works for functions apps without blueprints since the func dir is always /home/site/wwwroot. For blueprints, the function dir is /home/site/wwwroot/. So in the load request, the worker tries to find function_app.py in /home/site/wwwroot/ and it fails indexing. Fix is to always use /home/site/wwwroot for v2 programming model

Fixes #


PR information

Quality of Code and Contribution Guidelines

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 31.57%. Comparing base (6a50c07) to head (6c668dd).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/4.27.1 #1481 +/- ## =================================================== - Coverage 85.23% 31.57% -53.67% =================================================== Files 35 35 Lines 1998 1986 -12 Branches 378 293 -85 =================================================== - Hits 1703 627 -1076 - Misses 219 1358 +1139 + Partials 76 1 -75 ``` | [Flag](https://app.codecov.io/gh/Azure/azure-functions-python-worker/pull/1481/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/Azure/azure-functions-python-worker/pull/1481/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure) | `31.57% <100.00%> (-53.62%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Azure#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.