$30 off During Our Annual Pro Sale. View Details »

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

    View Slide

  2. Is there any {} in the room ?
    developers

    View Slide

  3. Is there any {} in the room ?
    developers
    administrators

    View Slide

  4. Is there any {} in the room ?
    developers
    administrators
    packages managers

    View Slide

  5. How do you check version change ?
    for the libraries you use in your projects

    View Slide

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

    View Slide

  7. 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

    View Slide

  8. At first
    I wanted to be aware of new kanboard releases

    View Slide

  9. At first
    I wanted to be aware of new kanboard releases
    Everything is hard coded (even the project list to check)

    View Slide

  10. Hard coded things
    Hard coding is nice but. . .

    View Slide

  11. Hard coded things
    Hard coding is nice but. . .
    also hard to maintain

    View Slide

  12. 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

    View Slide

  13. 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

    View Slide

  14. First YAML format
    “Rigid” format with implicit things

    View Slide

  15. 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

    View Slide

  16. Hard coded things II
    Only checking:

    View Slide

  17. Hard coded things II
    Only checking:
    github.com

    View Slide

  18. Hard coded things II
    Only checking:
    github.com
    freshcode.club

    View Slide

  19. Hard coded things II
    Only checking:
    github.com
    freshcode.club
    Checking urls built from site’s name.

    View Slide

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

    View Slide

  21. 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

    View Slide

  22. 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

    View Slide

  23. Encountered someone that said:
    “ Hey what about projects on sourceforge ? ”

    View Slide

  24. Hard coded things. . .
    Where you realize that urls are hardcoded into the project

    View Slide

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

    View Slide

  26. 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

    View Slide

  27. 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

    View Slide

  28. 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
    ...

    View Slide

  29. Virtually any site ??
    Versions has been tested with:

    View Slide

  30. Virtually any site ??
    Versions has been tested with:
    github.com,

    View Slide

  31. Virtually any site ??
    Versions has been tested with:
    github.com,
    sourceforge.net,

    View Slide

  32. Virtually any site ??
    Versions has been tested with:
    github.com,
    sourceforge.net,
    freshcode.club,

    View Slide

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

    View Slide

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

    View Slide

  35. 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),

    View Slide

  36. 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,

    View Slide

  37. 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,

    View Slide

  38. 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:

    View Slide

  39. 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

    View Slide

  40. 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.

    View Slide

  41. Versioning does not go straight forward sometimes. . .
    github.com/angular/angular/releases

    View Slide

  42. Versioning does not go straight forward sometimes. . .
    github.com/angular/angular/releases
    3 May 6.0.0

    View Slide

  43. Versioning does not go straight forward sometimes. . .
    github.com/angular/angular/releases
    3 May 6.0.0
    11 May 6.0.1

    View Slide

  44. 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

    View Slide

  45. 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

    View Slide

  46. 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

    View Slide

  47. 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’

    View Slide

  48. 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

    View Slide

  49. 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

    View Slide

  50. 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

    View Slide

  51. 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

    View Slide

  52. 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

    View Slide

  53. 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\.]+).*

    View Slide

  54. Jens Schleusener (fossies.org) begun to try Version
    discovered a huge number of bugs (now corrected)

    View Slide

  55. 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)

    View Slide

  56. 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)

    View Slide

  57. 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

    View Slide

  58. 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

    View Slide

  59. 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]+)

    View Slide

  60. Thanks for listening
    Versioning is not so easy:
    github.com/dupgit/versions/releases

    View Slide

  61. Thanks for listening
    Versioning is not so easy:
    github.com/dupgit/versions/releases
    5 avril 2018 : v1.5.0

    View Slide

  62. 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

    View Slide

  63. 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

    View Slide

  64. 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

    View Slide

  65. 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/ !

    View Slide