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

Upgrade versions in .tool-versions #4051

Closed
aaronjensen opened this issue Jul 11, 2019 · 21 comments
Closed

Upgrade versions in .tool-versions #4051

aaronjensen opened this issue Jul 11, 2019 · 21 comments
Labels
help wanted Help is needed or welcomed on this issue new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality)

Comments

@aaronjensen
Copy link

aaronjensen commented Jul 11, 2019

What would you like Renovate to be able to do?
When upgrading node, ruby or the like, it should also change the version in .tool-versions, used by asdf.

Describe the solution you'd like
See above.

Describe alternatives you've considered
Doing it manually.

Additional context
I'd imagine other version managers have similar files. Maybe renovate already supports them, but if not, it'd be great if it did as well.

@rarkins rarkins added type:feature Feature (new functionality) help wanted Help is needed or welcomed on this issue new package manager New package manager support priority-4-low Low priority, unlikely to be done unless it becomes important to more people ready labels Jul 11, 2019
@renovatebot renovatebot deleted a comment from nihalwasheretoo Nov 16, 2019
@rarkins
Copy link
Collaborator

rarkins commented Mar 6, 2020

As a workaround it should be possible to add a custom rule using our new regex-based manager: https://docs.renovatebot.com/modules/manager/regex/

However I don't see any .tool-versions file in that repo today

@aaronjensen
Copy link
Author

@rarkins interesting. Which repo are you referring to? asdf is the tool that makes use of .tool-versions, not the repo I was writing in about. The repo is private.

@rarkins
Copy link
Collaborator

rarkins commented Mar 6, 2020

Ok but in that case there’s no reference repositories for us to look at?

@aaronjensen
Copy link
Author

Here's an example .tool-versions:

nodejs 12.15.0
ruby 2.7.0

Is that good or do you need an actual repo with that in it?

@rarkins
Copy link
Collaborator

rarkins commented Mar 7, 2020

If you want to try it, I suggest doing it in a public repo so that it's easiest to troubleshoot

@rarkins rarkins removed the ready label Jun 18, 2020
@rarkins
Copy link
Collaborator

rarkins commented Jun 24, 2020

I realized there are two different parts to implement for asdf:

  1. Updating variables in asdf itself. Because it's plugin-based, it's hard to know exactly what's supported, but it can start with the simple ones like ruby and nodejs
  2. Using values in .tool-versions when we decide which version of ruby or node to run to update npm or bundler packages

@rarkins rarkins added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed priority-4-low Low priority, unlikely to be done unless it becomes important to more people labels Jun 24, 2020
@benlangfeld
Copy link
Contributor

@rarkins Are there any plans to implement this, or any guidance on how it should be implemented?

@viceice
Copy link
Member

viceice commented Mar 18, 2021

This would be a new manager and require a community contribution.

@benlangfeld
Copy link
Contributor

@viceice I can take a shot at it. Do you have any pointers on how to achieve @rarkins' second point? An example from another manager, perhaps?

@viceice
Copy link
Member

viceice commented Mar 18, 2021

checkout

const rubyVersionFile = getSiblingFileName(
packageFileName,
'.ruby-version'
);
const rubyVersionFileContent = await readLocalFile(rubyVersionFile, 'utf8');
if (rubyVersionFileContent) {
logger.debug('Using ruby version specified in .ruby-version');
rubyConstraint = rubyVersionFileContent
.replace(/^ruby-/, '')
.replace(/\n/g, '')
.trim();
}

@olegkrivtsov

This comment was marked as outdated.

@olegkrivtsov
Copy link
Contributor

olegkrivtsov commented Jan 13, 2022

The asdf tool seems to keep its config in .tool-versions file and use single versions of dependencies, not ranges: http://asdf-vm.com/manage/configuration.html#tool-versions

So my plan for implementing this feature:

  1. Implement a new manager in lib/manager/asdf. Take some existing manager as a base. I would take lib/manager/pip_requirements as a base since its config file format is similar. But asdf seems to not have any artifacts, so it's even simpler.

  2. In the manager's extract.ts, split the .tool-versions file into lines, and parse each line.

Each line has format:

depName version

where version may be one of the following:

  • 10.15.0 - an actual version.
  • ref:v1.0.2-a or ref:39cb398vb39 - tag/commit/branch to download from github and compile
  • path:/src/elixir - a path to custom compiled version of a tool to use. Ignore such dep since it can't be updated well.
  • system - this keyword causes asdf to passthrough to the version of the tool on the system that is not managed by asdf. Ignore this dep since it can't be updated.

Depending on the depName, use different datasource. Maybe have a map of supported dep names and corresponding datasources. For example, for node deps use the npm datasource; for ruby use ruby-version.

@viceice
Copy link
Member

viceice commented Jan 13, 2022

I like to name the new manager tool-versions, as the file may be used by other tools later and the file is not specific to asdf

@rarkins
Copy link
Collaborator

rarkins commented Feb 28, 2022

Work was started in #14092 but is not able to continue. Anyone who needs/wants this is welcome to pick up from where that PR left off.

@bodinsamuel

This comment was marked as off-topic.

@viceice
Copy link
Member

viceice commented Mar 2, 2022

@bodinsamuel Please Don't flood issue with "me too" comments, this will cause a lot of noise for subscribers.

Use the 👍 emoji on issue description for voting.

@ganta
Copy link

ganta commented Sep 20, 2022

With #17166, it appears that .tool-version is supported for Node.js only.
This change is released in version 32.199.0.

@multani
Copy link
Contributor

multani commented Sep 20, 2022

There are a bunch of rules defined in https://github.com/kachick/renovate-config-asdf/, would it be something that could be merged in Renovate itself?

@rarkins
Copy link
Collaborator

rarkins commented Sep 20, 2022

This issue now is unfortunately a bit "wide", ideally we'd have an issue per tool so that each PR can close one issue. Unless someone is happy to submit a PR covering the remaining tools soon, we should close this as done and then create/link to separate feature requests per tool.

@sawilde
Copy link
Contributor

sawilde commented Sep 20, 2022

My plan was always to add tools as I need them or for others to contribute for their needs - I just wanted to get one supported tool (and probably the most popular one) just so I could validate the flow without the additional complication of all the additional tools.

@secustor
Copy link
Collaborator

Closing this issue as suggested #4051 (comment).
For further tools please open a separate feature requests.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Help is needed or welcomed on this issue new package manager New package manager support priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.