puppetlabs / puppetlabs-vcsrepo

Support for source control repositories
http://forge.puppetlabs.com/puppetlabs/vcsrepo
GNU General Public License v2.0
223 stars 285 forks source link

Svn provider does not correctly compare revision to latest #547

Closed jdwhited closed 2 years ago

jdwhited commented 2 years ago

Describe the Bug

Svn provider performs a string comparison against integer revisions resulting in incorrectly saying it is as the latest revision when it is not. eg. revision 99 > 100

Expected Behavior

Version 100 should be > 99 resulting in an update to latest.

Steps to Reproduce

  vcsrepo { 'my svn repo':
    ensure              => latest,
    path                => '/opt/mysvnrepo',
    provider            => svn,
    source              => 'https://subversion.domain.com/svn/myrepo',
    basic_auth_username => 'myuser',
    basic_auth_password => Sensitive('mypass'),
  }

svn info | grep '^Revision' Revision: 99

Latest revision in svn repo is >= 100

Run puppet - no change.

Environment

Additional Context

https://github.com/puppetlabs/puppetlabs-vcsrepo/blob/main/lib/puppet/provider/vcsrepo/svn.rb#L81 should simply use the to_i (revision.to_i >= latest.to_i) && (@resource.value(:source) == source)

chelnak commented 2 years ago

Hey @jdwhited , SVN isn't an officially supported provider so this is something that wont be picked up by our team.

PRs are welcome though 😄

github-actions[bot] commented 2 years ago

Hello! 👋

This issue has been open for a while and has had no recent activity. We've labelled it with attention-needed so that we can get a clear view of which issues need our attention.

If you are waiting on a response from us we will try and address your comments on a future Community Day.

Alternatively, if it is no longer relevant to you please close the issue with a comment.