Skip to content

Conversation

@soninaren
Copy link
Member

@soninaren soninaren commented Mar 6, 2020

resolves #1828

@soninaren soninaren changed the title Nasoni/dev Check if bundle config exists, hostJson exists Mar 6, 2020
@soninaren soninaren requested a review from pragnagopa March 6, 2020 03:19
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.

added few comments

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.

Assuming 3.x changes are similar. Please ping when both PRs are updated

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.

Added minor comments. Please do look at the PR build failures.

private void ValidateHostJsonConfiguration()
{
bool IsPreCompiledApp = IsPreCompiledFunctionApp();
var hostJsonPath = Path.Combine(Environment.CurrentDirectory, Constants.HostJsonFileName);
Copy link
Member

Choose a reason for hiding this comment

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

hostJsonPath is being calculated at multiple places. Move this to constant?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the logic to calculate the hostJsonPath only once. I cannot make it a constant because the value of the Environment.CurrentDirectory changes based on the context. If i make hostJson path constant the Environment.CurrentDirectory it would may end up using incorrect path.


if (IsPreCompiledApp && BundleConfigurationExists(hostJsonPath))
{
throw new CliException($"Extension bundle configuration should not be present for the function app with pre-compiled functions. Please remove extension bundle configuration from host.json: {Path.Combine(Environment.CurrentDirectory, "host.json")}");
Copy link
Member

Choose a reason for hiding this comment

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

move hostJson path to constant and reuse

@soninaren
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@soninaren soninaren merged commit d8d237f into dev Mar 8, 2020
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.

Throw an error if the customers with pre compiled function app have bundles configured

3 participants