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

Configurable file name #1323

Merged
merged 55 commits into from
Jan 11, 2024
Merged

Configurable file name #1323

merged 55 commits into from
Jan 11, 2024

Conversation

hallvictoria
Copy link
Contributor

@hallvictoria hallvictoria commented Oct 11, 2023

Description

The Python worker reads the function app entry point from an app setting called PYTHON_SCRIPT_FILE_NAME. The default value for this setting will still be "function_app.py". Customers can signal to the worker to read from a file not called "function_app.py" by setting this variable to the new name of their file.

Added unit and e2e tests for this app setting by creating a function app file not called "function_app.py" and testing it.

Also added unit tests for 2 invalid V2 app scenarios: no top level function app instances and no inputs

Fixes #https://github.com/Azure/azure-functions-pyfx-planning/issues/72


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (16c109a) 85.11% compared to head (9347e42) 85.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1323      +/-   ##
==========================================
+ Coverage   85.11%   85.84%   +0.72%     
==========================================
  Files          35       35              
  Lines        1955     1971      +16     
  Branches      370      371       +1     
==========================================
+ Hits         1664     1692      +28     
+ Misses        217      210       -7     
+ Partials       74       69       -5     
Flag Coverage Δ
unittests 85.79% <100.00%> (+0.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

azure_functions_worker/loader.py Show resolved Hide resolved
tests/unittests/test_dispatcher.py Outdated Show resolved Hide resolved
azure_functions_worker/constants.py Show resolved Hide resolved
azure_functions_worker/constants.py Outdated Show resolved Hide resolved
azure_functions_worker/loader.py Outdated Show resolved Hide resolved
azure_functions_worker/dispatcher.py Outdated Show resolved Hide resolved
azure_functions_worker/loader.py Show resolved Hide resolved
tests/endtoend/test_file_name_functions.py Show resolved Hide resolved
azure_functions_worker/dispatcher.py Show resolved Hide resolved
azure_functions_worker/dispatcher.py Show resolved Hide resolved
azure_functions_worker/dispatcher.py Outdated Show resolved Hide resolved
@hallvictoria hallvictoria merged commit 0b21dc0 into dev Jan 11, 2024
53 checks passed
@hallvictoria hallvictoria deleted the hallvictoria/configurable_file_name branch January 11, 2024 18:58

if not os.path.exists(function_path):
# Fallback to legacy model
logger.info("%s does not exist. "
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary to log in general? If this log can be merged in the earlier log itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants