Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Versions (par Olivier Delhomme)

Versions (par Olivier Delhomme)

Presented by Olivier Delhomme at SysadminDays #8 (https://sysadmindays.fr)

Renaud Chaput

October 19, 2018
Tweet

More Decks by Renaud Chaput

Other Decks in Programming

Transcript

  1. Versions a project to check versions. . . or version

    change tracking by Olivier Delhomme 2018 10 19
  2. How do you check version change ? for the libraries

    you use in your projects for the puppet modules you use to manage your infrastructure
  3. How do you check version change ? for the libraries

    you use in your projects for the puppet modules you use to manage your infrastructure to integrate newest upstream versions in your repositories
  4. At first I wanted to be aware of new kanboard

    releases Everything is hard coded (even the project list to check)
  5. Hard coded things Hard coding is nice but. . .

    also hard to maintain not beautiful : program = fguillot/kanboard version = get_latest_github_release(program) if version != : print( Latest version of %s is %s % (program, versi
  6. Hard coded things Hard coding is nice but. . .

    also hard to maintain not beautiful : program = fguillot/kanboard version = get_latest_github_release(program) if version != : print( Latest version of %s is %s % (program, versi => use of a YAML file
  7. First YAML format “Rigid” format with implicit things github.com: is

    the name you must use to add github projects as a list below the name: github.com: - InfotelGLPI/manufacturersimports - fguillot/kanboard - curl/curl - akheron/jansson - Deltafire/MilkyTracker - terryyin/lizard - vmware/pyvmomi - tmux/tmux - tmuxinator/tmuxinator
  8. Hard coded things II Only checking: github.com freshcode.club Checking urls

    built from site’s name. Two categories are needed:
  9. Hard coded things II Only checking: github.com freshcode.club Checking urls

    built from site’s name. Two categories are needed: Github is checked project by project
  10. Hard coded things II Only checking: github.com freshcode.club Checking urls

    built from site’s name. Two categories are needed: Github is checked project by project freshcode is a complete list of projects
  11. Hard coded things. . . Where you realize that urls

    are hardcoded into the project => put project url in the YAML file. . .
  12. Hard coded things. . . Where you realize that urls

    are hardcoded into the project => put project url in the YAML file. . . => needs a refactoring of the YAML file
  13. Hard coded things. . . Where you realize that urls

    are hardcoded into the project => put project url in the YAML file. . . => needs a refactoring of the YAML file Add a “projects” list
  14. Hard coded things. . . Where you realize that urls

    are hardcoded into the project => put project url in the YAML file. . . => needs a refactoring of the YAML file Add a “projects” list Then add an url with a {} where the project name should take place: github: url: "https://github.com/{}/releases.atom" projects: - InfotelGLPI/manufacturersimports - fguillot/kanboard ...
  15. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org,
  16. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org,
  17. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org, www.freshports.org (FreeBSD packages),
  18. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org, www.freshports.org (FreeBSD packages), fossies.org,
  19. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org, www.freshports.org (FreeBSD packages), fossies.org, repo.continuum.io,
  20. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org, www.freshports.org (FreeBSD packages), fossies.org, repo.continuum.io, Still to be tested with:
  21. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org, www.freshports.org (FreeBSD packages), fossies.org, repo.continuum.io, Still to be tested with: libraries.io
  22. Virtually any site ?? Versions has been tested with: github.com,

    sourceforge.net, freshcode.club, pypi.python.org, savanah.gnu.org, www.freshports.org (FreeBSD packages), fossies.org, repo.continuum.io, Still to be tested with: libraries.io Where you realize that some version control tools does not provide any convenient way to get releases.
  23. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3
  24. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’
  25. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’ GLPI 9.1 : Version 1.9.1 disponible / available
  26. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’ GLPI 9.1 : Version 1.9.1 disponible / available GLPI 9.2 : Version 2.0.0 disponible / available
  27. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’ GLPI 9.1 : Version 1.9.1 disponible / available GLPI 9.2 : Version 2.0.0 disponible / available GLPI 9.3 : Version 2.1.0 disponible / available
  28. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’ GLPI 9.1 : Version 1.9.1 disponible / available GLPI 9.2 : Version 2.0.0 disponible / available GLPI 9.3 : Version 2.1.0 disponible / available GLPI 9.3 : Version 2.1.1 disponible / available
  29. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’ GLPI 9.1 : Version 1.9.1 disponible / available GLPI 9.2 : Version 2.0.0 disponible / available GLPI 9.3 : Version 2.1.0 disponible / available GLPI 9.3 : Version 2.1.1 disponible / available GLPI 9.3 : Version 2.1.2 disponible / available
  30. Versioning does not go straight forward sometimes. . . github.com/angular/angular/releases

    3 May 6.0.0 11 May 6.0.1 15 May 6.0.2 16 May 5.2.11 23 May 6.0.3 github.com/InfotelGLPI/manufacturersimports/releases’ GLPI 9.1 : Version 1.9.1 disponible / available GLPI 9.2 : Version 2.0.0 disponible / available GLPI 9.3 : Version 2.1.0 disponible / available GLPI 9.3 : Version 2.1.1 disponible / available GLPI 9.3 : Version 2.1.2 disponible / available => regex to filter out version to be printed such as: regex: \w+ [\d\.]+ : \w+ ([\d\.]+).*
  31. Jens Schleusener (fossies.org) begun to try Version discovered a huge

    number of bugs (now corrected) suggested new features and new behaviors (still some to work on)
  32. Jens Schleusener (fossies.org) begun to try Version discovered a huge

    number of bugs (now corrected) suggested new features and new behaviors (still some to work on) => entry: latest or entry: last checked (it may be a global parameter)
  33. Jens Schleusener (fossies.org) begun to try Version discovered a huge

    number of bugs (now corrected) suggested new features and new behaviors (still some to work on) => entry: latest or entry: last checked (it may be a global parameter) => ported regex to “list” type sites
  34. YAML list type site continuum.io: url: "https://repo.continuum.io/pkgs/rss.xml" type: list regex:

    [ad\s]*([\.\w\s-]+)\s([\d\.-]+\w*).* multiproject: ,|; projects: - pytorch - holoviews - pyopenssl
  35. YAML project type site github: url: "https://github.com/{}/releases.atom" type: byproject projects:

    - name: torvalds/linux regex: v([\d\.\-rRcC]+) - name: kanboard/kanboard regex: Kanboard Version\s([\d\.]+) - ovh/cds - glpi-project/glpi - name: nextcloud/server regex: v([\d\.\-rRcCbBeEtTaAlLpPhH]+)
  36. Thanks for listening Versioning is not so easy: github.com/dupgit/versions/releases 5

    avril 2018 : v1.5.0 22 mai 2018 : v1.5.1: Version 1.5.1
  37. Thanks for listening Versioning is not so easy: github.com/dupgit/versions/releases 5

    avril 2018 : v1.5.0 22 mai 2018 : v1.5.1: Version 1.5.1 11 Juin 2018 : v1.5.2
  38. Thanks for listening Versioning is not so easy: github.com/dupgit/versions/releases 5

    avril 2018 : v1.5.0 22 mai 2018 : v1.5.1: Version 1.5.1 11 Juin 2018 : v1.5.2 https://github.com/dupgit/versions
  39. Thanks for listening Versioning is not so easy: github.com/dupgit/versions/releases 5

    avril 2018 : v1.5.0 22 mai 2018 : v1.5.1: Version 1.5.1 11 Juin 2018 : v1.5.2 https://github.com/dupgit/versions Have a look at https://semver.org/ !