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

NuGetCommandV2 fails gracefully when used on ubuntu 24 without mono #20801

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

Conversation

amp-powell
Copy link
Contributor

Task name: NuGetCommandV2

Description: NuGetCommandV2 fails gracefully when used on ubuntu 24 without mono

Documentation changes required: (Y/N) Y - Documentation explaining ubuntu 24 is incompatible without mono and different options users can do instead

Added unit tests: (Y/N) N

Attached related issue: (Y/N) Y - Work Item #2244271

Checklist:

  • Task version was bumped - please check instruction how to do it
  • Checked that applied changes work as expected

@amp-powell amp-powell requested a review from a team as a code owner January 22, 2025 15:50
"loc.messages.Warning_UnsupportedServiceConnectionAuth": "The service connection does not use a supported authentication method. Please use a service connection with personal access token based auth."
"loc.messages.Warning_UnsupportedServiceConnectionAuth": "The service connection does not use a supported authentication method. Please use a service connection with personal access token based auth.",
"loc.messages.LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"loc.messages.Error_IncompatibleUbuntuVersion": "Detected using an Ubuntu24 or newer agent without mono. This is incompatible with NuGetCommand@2. Please follow the directions here [link] for how to pin your agent to an older version of Ubuntu or install mono on your agent."
Copy link
Contributor

Choose a reason for hiding this comment

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

The first version to break is 22.04, not 24

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this!

"loc.messages.Warning_UnsupportedServiceConnectionAuth": "The service connection does not use a supported authentication method. Please use a service connection with personal access token based auth."
"loc.messages.Warning_UnsupportedServiceConnectionAuth": "The service connection does not use a supported authentication method. Please use a service connection with personal access token based auth.",
"loc.messages.LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"loc.messages.Error_IncompatibleUbuntuVersion": "Detected using an Ubuntu24 or newer agent without mono. This is incompatible with NuGetCommand@2. Please follow the directions here [link] for how to pin your agent to an older version of Ubuntu or install mono on your agent."
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the benefits of using a kb link is we can change it to say whatever we want, so don't refer to the contents of the document in the message. Just say something like "See [link] for more information"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this!

Tasks/NuGetCommandV2/UbuntuDetectionHelper.ts Show resolved Hide resolved
Copy link
Contributor

@magleaso magleaso left a comment

Choose a reason for hiding this comment

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

A couple minor suggestions still

"loc.messages.Warning_UnsupportedServiceConnectionAuth": "The service connection does not use a supported authentication method. Please use a service connection with personal access token based auth."
"loc.messages.Warning_UnsupportedServiceConnectionAuth": "The service connection does not use a supported authentication method. Please use a service connection with personal access token based auth.",
"loc.messages.LIB_WhichNotFound_Linux": "Unable to locate executable file: '%s'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.",
"loc.messages.Error_IncompatibleUbuntuVersion": "Detected agent uses Ubuntu 22.04 or newer and could not find mono. See [link] for more information."
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could be a little more direct that not only did we detect the condition, but that it is causing a failure. Consider "The task has failed because you are using Ubuntu 22.04 without mono. See [link] for more information."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this!

Tasks/NuGetCommandV2/UbuntuDetectionHelper.ts Show resolved Hide resolved
const distribution = _parseLinuxDistribution(lbsContents);
if (distribution === 'Ubuntu') {
const version = parseFloat(_parseUbuntuVersion(lbsContents));
if (version >= 22.04) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was mistaken I apologize. I'm not sure where I got 22.04 from. 24.04 should be the proper cutoff (though as long as we check for mono as well, it shouldn't be a big deal)

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.

2 participants