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

ci: fix get latest grafana versions python script #354

Merged
merged 8 commits into from
Apr 18, 2024

Conversation

Nemental
Copy link
Collaborator

@Nemental Nemental commented Apr 5, 2024

SUMMARY
  • increase number of returned releases by api to ensure the newest 3 majors are included
  • refactor comparation of version numbers
    • work with multi digits major versions
    • compare versions as tulpe not as int
      • before: 10.0.13 (as_int: 10013) > 10.2.6 (as_int: 1026) (older version is higher)
      • after: 10.0.13 (as_tulpe: (10, 0, 13)) < 10.2.6 (as_tulpe: (10, 2, 6)) (newer version is higher)
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

before:

["9.5.18", "10.0.13"]

after:

["8.5.27", "9.5.18", "10.4.1"]

@Nemental Nemental requested a review from rndmh3ro April 5, 2024 09:31
@Nemental Nemental requested review from rrey and seuf as code owners April 5, 2024 09:31
Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.46%. Comparing base (a3056e9) to head (451cc3c).
Report is 5 commits behind head on main.

❗ Current head 451cc3c differs from pull request most recent head cff474c. Consider uploading reports for the commit cff474c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   71.18%   74.46%   +3.28%     
==========================================
  Files          18       14       -4     
  Lines        1898     1719     -179     
  Branches      332      312      -20     
==========================================
- Hits         1351     1280      -71     
+ Misses        402      293     -109     
- Partials      145      146       +1     
Flag Coverage Δ
integration 70.04% <ø> (ø)
sanity ?
units 65.08% <ø> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Nemental Nemental changed the title fix: get latest grafana versions ci: get latest grafana versions Apr 11, 2024
@Nemental Nemental changed the title ci: get latest grafana versions ci: fix get latest grafana versions python script Apr 11, 2024
rrey
rrey previously requested changes Apr 12, 2024
Copy link
Collaborator

@rrey rrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried to run the script and got an error:

Traceback (most recent call last):
  File "/Users/remirey/dev/ansible_collections/community/grafana/hacking/find_grafana_versions.py", line 30, in <module>
    major, version, as_tuple = get_by_major(release.get("tag_name"))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/remirey/dev/ansible_collections/community/grafana/hacking/find_grafana_versions.py", line 10, in get_by_major
    return int(version.split(".")[0]), version, tuple(map(int, version.split(".")))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '0-preview'

@Nemental
Copy link
Collaborator Author

They released a preview right after my changes to the python script :D Now all pre-release (-) and build-release tags (+) are skipped according to the semantic version

@Nemental Nemental requested a review from rrey April 12, 2024 15:22
@Nemental
Copy link
Collaborator Author

failed sanity workflow is fixed in #355

@Nemental Nemental mentioned this pull request Apr 16, 2024
@rndmh3ro
Copy link
Collaborator

lgtm

@Nemental Nemental merged commit b64db9d into main Apr 18, 2024
29 checks passed
@Nemental Nemental deleted the fix/update-grafana-versions branch April 18, 2024 07:54
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

Successfully merging this pull request may close these issues.

3 participants