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

Change installation instructions to be bounded to minor version, not patch #1341

Open
joellabes opened this issue Feb 11, 2022 · 0 comments
Open

Comments

@joellabes
Copy link
Contributor

Now that we're actively encouraging people to install the latest patch version instead of a specific one, we should be showing

packages:
  - package: dbt-labs/dbt_utils
    version: [">=0.8.0", "<0.9.0"]

instead of what we currently have:

image

My gut feeling is that I can make a new function to calculate the range in the same way as we strip leading vs

hub.getdbt.com/config.rb

Lines 24 to 30 in 8786986

def strip_leading_v(version)
if version.start_with?("v")
version[1..-1]
else
version
end
end

Add the new version_bounds into the version_data object here

hub.getdbt.com/config.rb

Lines 32 to 41 in 8786986

def _build_package(package, org, name)
entry = package['index'].clone
versions = package['versions']
new_versions = {}
versions.each do |version_num, version_data|
version_num = strip_leading_v(version_num)
version_data['version'] = strip_leading_v(version_data['version'])
new_versions[version_num] = version_data

and reference version.version_bounds here instead of version.version

<p>Include the following in your <code>packages.yml</code> file:
<pre id='install'>
packages:
- package: <%= package.namespace %>/<%= package.name %>
version: <%= version.version %></pre>
<p> Run <code>dbt deps</code> to install the package.

but I haven't written any Ruby before so I don't know what traps await me (or how to test this)

@annafil as the resident Ruby fanatic you seem like my best bet for some pointers 🙏

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

No branches or pull requests

1 participant