Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/hacking/requests-2.32.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental authored Jul 9, 2024
2 parents 8060272 + 0f3ed37 commit cdcff94
Show file tree
Hide file tree
Showing 67 changed files with 3,784 additions and 286 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python_version: ["3.10"]
python_version: ["3.11"]
ansible_version: ["stable-2.15", "stable-2.16", "devel"]
steps:
- name: Perform testing
Expand All @@ -29,7 +29,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python_version: ["3.10"]
python_version: ["3.11"]
ansible_version: ["stable-2.15", "stable-2.16", "devel"]
steps:
- name: Perform testing
Expand All @@ -47,7 +47,7 @@ jobs:
matrix:
grafana_version: ["8.5.27", "9.5.19", "10.4.3"]
ansible_version: ["stable-2.15", "stable-2.16", "devel"]
python_version: ["3.10"]
python_version: ["3.11"]
services:
grafana:
image: grafana/grafana:${{ matrix.grafana_version }}
Expand All @@ -69,7 +69,7 @@ jobs:
matrix:
grafana_version: ["8.5.27", "9.5.19", "10.4.3"]
ansible_version: ["stable-2.15", "stable-2.16", "devel"]
python_version: ["3.10"]
python_version: ["3.11"]
services:
grafana:
image: grafana/grafana:${{ matrix.grafana_version }}
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ Grafana Collection Release Notes

.. contents:: Topics

v2.0.0
======

Minor Changes
-------------

- Add `grafana_contact_point` module
- Add support of `grafana_contact_point` in grafana role
- add org switch by `org_id` and `org_name` in `grafana_silence`

Removed Features (previously deprecated)
----------------------------------------

- removed check and handling of mangled api key in `grafana_dashboard` lookup
- removed deprecated `message` argument in `grafana_dashboard`

New Modules
-----------

- community.grafana.grafana_contact_point - Manage Grafana Contact Points

v1.9.1
======

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Click on the name of a plugin or module to view that content's documentation:
- [grafana_datasource](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_datasource_module.html)
- [grafana_folder](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_folder_module.html)
- [grafana_notification_channel](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_notification_channel_module.html)
- [grafana_contact_point](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_contact_point_module.html)
- [grafana_organization](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_organization_module.html)
- [grafana_organization_user](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_organization_user_module.html)
- [grafana_plugin](https://docs.ansible.com/ansible/latest/collections/community/grafana/grafana_plugin_module.html)
Expand Down
21 changes: 21 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,24 @@ releases:
- 367-dashboard-undo-breaing-change-message.yml
- 368-molecule-pin-requests.yml
release_date: '2024-05-21'
2.0.0:
changes:
minor_changes:
- Add `grafana_contact_point` module
- Add support of `grafana_contact_point` in grafana role
- add org switch by `org_id` and `org_name` in `grafana_silence`
removed_features:
- removed check and handling of mangled api key in `grafana_dashboard` lookup
- removed deprecated `message` argument in `grafana_dashboard`
fragments:
- 352-module-contact-point.yml
- 371-silence-org-switch.yml
- 372-rm-dashboard-message-argument.yml
- 373-cleanup-and-update-sanity.yml
- 374-ansible-required-version.yml
- 376-dashboard-lookup-api-key-deprecation.yml
modules:
- description: Manage Grafana Contact Points
name: grafana_contact_point
namespace: ''
release_date: '2024-05-31'
5 changes: 5 additions & 0 deletions changelogs/fragments/352-module-contact-point.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minor_changes:
- Add `grafana_contact_point` module
- Add support of `grafana_contact_point` in grafana role
trivial:
- Add tests for `grafana_contact_point` module
3 changes: 3 additions & 0 deletions changelogs/fragments/371-silence-org-switch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- add org switch by `org_id` and `org_name` in `grafana_silence`
3 changes: 3 additions & 0 deletions changelogs/fragments/372-rm-dashboard-message-argument.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
removed_features:
- removed deprecated `message` argument in `grafana_dashboard`
4 changes: 4 additions & 0 deletions changelogs/fragments/373-cleanup-and-update-sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
trivial:
- bump python to 3.11 in ansible tests
- remove sanity ignore files
3 changes: 3 additions & 0 deletions changelogs/fragments/374-ansible-required-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- bump required ansible version to 2.15.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
removed_features:
- removed check and handling of mangled api key in `grafana_dashboard` lookup
3 changes: 3 additions & 0 deletions changelogs/fragments/378-grafana-version-sorting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Fix grafana version sorting
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Add missing function argument in `grafana_contact_point` for org handling
3 changes: 3 additions & 0 deletions changelogs/fragments/381-sub-folders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- Manage subfolders for `grafana_folder` and specify uid
5 changes: 5 additions & 0 deletions changelogs/fragments/382-notification-channel-deprecation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
deprecated_features:
- Deprecate `grafana_notification_channel` with removal in version 3.0.0
trivial:
- Check Grafana version for `grafana_notification_channel` integration tests
2 changes: 2 additions & 0 deletions changelogs/fragments/patch-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Fix var prefixes in silence-task in role
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: community
name: grafana
version: 1.9.1
version: 2.0.0
readme: README.md
authors:
- Rémi REY (@rrey)
Expand Down
2 changes: 1 addition & 1 deletion hacking/find_grafana_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_grafana_releases():
if major not in by_major.keys() or by_major[major]["as_tuple"] < as_tuple:
by_major[major] = {"version": version, "as_tuple": as_tuple}

latest_3_majors = sorted(list(by_major.keys()))[:3]
latest_3_majors = sorted(list(by_major.keys()), reverse=True)[:3]
latest_releases = [by_major[idx]["version"] for idx in latest_3_majors]

print(json.dumps(latest_releases))
9 changes: 8 additions & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
---
requires_ansible: ">=2.14.0"
requires_ansible: ">=2.15.0"
action_groups:
grafana:
- grafana_dashboard
- grafana_datasource
- grafana_folder
- grafana_notification_channel
- grafana_contact_point
- grafana_organization
- grafana_organization_user
- grafana_plugin
- grafana_team
- grafana_user
- grafana_silence
plugin_routing:
modules:
grafana_notification_channel:
deprecation:
removal_version: 3.0.0
warning_text: Legacy alerting is removed in Grafana version 11, use community.grafana.grafana_contact_point instead.
12 changes: 2 additions & 10 deletions plugins/lookup/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,8 @@ def grafana_switch_organisation(self, headers):

def grafana_headers(self):
headers = {"content-type": "application/json; charset=utf8"}
if self.grafana_api_key:
api_key = self.grafana_api_key
if len(api_key) % 4 == 2:
display.deprecated(
"Passing a mangled version of the API key to the grafana_dashboard lookup is no longer necessary and should not be done.",
"2.0.0",
collection_name="community.grafana",
)
api_key += "=="
headers["Authorization"] = "Bearer %s" % api_key
if self.grafana_api_key.get("grafana_api_key", None):
headers["Authorization"] = "Bearer %s" % self.grafana_api_key
else:
headers["Authorization"] = basic_auth_header(
self.grafana_user, self.grafana_password
Expand Down
Loading

0 comments on commit cdcff94

Please sign in to comment.