-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Users/dakale/use ruby #10083
Users/dakale/use ruby #10083
Conversation
Tasks/UseRubyV1/Strings/resources.resjson/de-de/resources.resjson
Outdated
Show resolved
Hide resolved
export async function installRubyVersion(parameters: TaskParameters): Promise<void> { | ||
const toolName: string = "Ruby"; | ||
const installDir: string | null = tool.findLocalTool(toolName, parameters.version, parameters.architecture); | ||
if (!installDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense to me - why are we throwing if the tool isn't found locally? Shouldn't we download if its not found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And cache it once we download it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is what the existing task is doing, it feels like we should be able to do better than that though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checking with @vtbassmatt
I think the idea was to preserve behavior for now and extend later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - if we do decide to download it looks like the dist is pretty well structured - https://cache.ruby-lang.org/pub/ruby/
Can probably basically just do the same thing we do in the UseNode task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell those are not prebuilt binaries and I doubt we can afford the time to build ruby on demand. Ill dig in a little more, but I believe lack of simple multiplat binary distributions is part of why the existing task doesnt have this functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, you're right 😕
I still think its weird that we download other tools when they're not present, but not Ruby. It looks like the plan is to do the same with Python though.
With that said, I don't see a good way around this so I guess I'm ok with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this is "done" Ill check with Matt on timelines. I think the on-demand install is a nice-to-have so we may choose to go for it, and see if its viable to get done within the timeline. I agree with you that being consistent would be ideal, and as far as I'm aware there's no licensing issues or anything blocking this.
I would probably say lets go ahead and get this merged if it looks correct, even if we end up immediately revisiting and extending it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an ideal world, we'd always download any version the customer asked for. In practice that's not always been easy/possible, so we've fallen back to just the tools cache. @dakale is right that we need to at least match parity, making improvements where possible but not blocking on them.
@@ -140,6 +140,7 @@ | |||
"UseDotNetV2", | |||
"UseNodeV1", | |||
"UsePythonVersionV0", | |||
"UseRubyV1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add this to codeowners as well: https://github.com/Microsoft/azure-pipelines-tasks/blob/master/.github/CODEOWNERS
I don't think it will work with you since you're not a maintainer, you can probably add bryan and me though. Alternately you can request to become a maintainer of the vsts-dt-admin group, Bryan would approve that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill add myself as owner for now to catch any basic issues, then reassign to the proper ecosystem owner once they even are aware of its existence / are familiar with the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine - my only concern is will CodeOwners work even though you're not a maintainer? (Genuinely not sure)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not sure. Are you aware of any automation that uses this information? I just assumed it was informational, and would serve as a way to route issues to me. It would be surprising if something tried to write to the repo on my behalf based on that info, since I could just put any name there
Does @stephenmichaelf know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't write to a repo, but it does make the codeowner a required reviewer. For example, in #9716, Ross was added as a reviewer automatically since he's a codeowner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find any docs calling out that this only works for maintainers, I think we can probably assume it works for everyone. Worst case it doesn't and we just change it.
Remove Strings/ Use task.getPlatform instead of local variation Add package.json to Tests/ Always set task.setResourcePath even if no version
Working on build failures. Will update |
One build was timing out with 1000ms with no other apparent failure mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple comments, but overall this seems good.
assert(tr.stdout.includes('##vso[task.prependpath]' + '/Ruby/2.4.4/bin'), 'ruby tool location was not added to PATH as expected'); | ||
}); | ||
|
||
it('sets PATH correctly on Windows', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test to verify proxy behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, ive added a test in 6410e52
Also add preview: true to task.json
…ines-tasks into users/dakale/use-ruby
Looks like a random timeout caused macos to fail, maybe increase the timeout a little bit more? |
Yea, it looks like the mock-test runner downloads a node10 on the first run: https://github.com/Microsoft/azure-pipelines-task-lib/blob/master/node/mock-test.ts#L160 I only skimmed this code but seems to download node based on the node specified in the task. The test says it is testing against node 6, so I would like to verify that it is actually doing that, or if its using node10 per the task.json. Not going to invest that time right now though That makes sense as to why the first test is the one thats always failing. For now, I think the easiest workaround is just to increase the timeout as mentioned. We could potentially add a |
For clarity, from the failing logs:
The test suite header is printed, then a line about downloading, then the result of the test. Its easy to |
Its definitely testing against node 10, I'll think more about this timeout issue though. Regardless, that shouldn't be the responsibility of this task, we should probably handle it earlier in the build. |
I think this is good to go, I'll go ahead and merge |
Adds task for use: ruby
Task has two inputs per design: version, architecture. Both optional.
Version input has no behavior change from existing Use Ruby Version task, will fail if tool is not found in cache
(@damccorm since I cant add reviewer without write access)