Skip to content

Publish warning message changes - 4241 #4324

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

umangsriv
Copy link
Contributor

Showing warning message for runtimes reaching end-of-life during publish for Node and Python

resolves #4241

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@umangsriv umangsriv requested a review from a team as a code owner March 24, 2025 20:23
@umangsriv umangsriv requested review from kshyju and aishwaryabh March 25, 2025 13:53
@@ -199,6 +199,43 @@ public override async Task RunAsync()
// We do not change the default targetFramework if no .csproj file is found
}

// Show warning message for other worker runtimes (Node, Pyrhon)
if (workerRuntime == WorkerRuntime.node || workerRuntime == WorkerRuntime.python)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want this logic specifically for node or python? should we have this logic for all function stacks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made it generic, can used for other stacks as well.

}
}

private void ShowEolMessageForPython(FunctionsStacks stacks, LinuxRuntimeSettings currentRuntimeSettings, string workerRuntime, string runtimeVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic is very similar for python and node. Can we combine these methods and pass in a parameter for determining if we call GetNextRuntimeVersionForPython, GetNextRuntimeVersionForNode, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Combined and make generic method.

return minorVersion?.StackSettings?.LinuxRuntimeSettings;
}

public static WindowsRuntimeSettings GetRuntimeSettingsForNode(this FunctionsStacks stacks, string workerRuntime, string runtimeVersion, out bool isLTS)
Copy link
Contributor

Choose a reason for hiding this comment

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

again this logic is very similar for python and node. can we combine the methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Combined and make generic method.

@umangsriv
Copy link
Contributor Author

Hi @aishwaryabh, I have implemented the changes you mentioned in your comment, please review them when you have a moment.

@@ -199,6 +199,41 @@ public override async Task RunAsync()
// We do not change the default targetFramework if no .csproj file is found
}

// Show warning message for other worker runtimes (Node, Python, Powershell, Java)
if (workerRuntime == WorkerRuntime.node || workerRuntime == WorkerRuntime.python || workerRuntime == WorkerRuntime.powershell || workerRuntime == WorkerRuntime.java)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this all runtimes except dotnet? if so we can say the following:

if (workerRuntime != WorkerRuntime.dotnet && workerRuntime != WorkerRuntime.dotnetIsolated)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it implies to all runtimes except dotnet, I have fixed it.

DateTime currentDate = DateTime.Now;
if (workerRuntime == WorkerRuntime.python)
{
var linuxRuntimeSettings = stacks.GetOtherRuntimeSettings(workerRuntimeStr, runtimeVersion, out bool isPythonLTS, s => s.LinuxRuntimeSettings);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the point of IsPythonLTS and isNodeLTS being output variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the output variable name, yes, you are right, “IsPythonLTS” and “IsNodeLTS” do not accurately represent the type of setting they return, instead, the new name reflects the actual setting type- such as Linux for Python and Windows for Node.

@umangsriv
Copy link
Contributor Author

Hi @aishwaryabh , I have incorporated the changes you suggested, please review it again at your convenience.

@umangsriv umangsriv requested a review from aishwaryabh April 8, 2025 14:17
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.

Show warning message for runtimes reaching end-of-life during publish
2 participants