~afreiberger/charm-grafana:lint-20.10

Last commit made on 2020-10-16
Get this branch:
git clone -b lint-20.10 https://git.launchpad.net/~afreiberger/charm-grafana
Only Drew Freiberger can upload to this branch. If you are Drew Freiberger please log in for upload directions.

Branch merges

Branch information

Name:
lint-20.10
Repository:
lp:~afreiberger/charm-grafana

Recent commits

5cf11c5... by Drew Freiberger

minor doc strings linting

8cb42f5... by Drew Freiberger

blacken for 20.10 release

534c1f1... by Matthew Ruffell

Enable support for custom ports for dashboard backup

Currently dashboard backup uses a hardcoded base_url of localhost:3000,
which breaks the backup script if the user changes the port to anything
else.

Add some logic to fetch the port config and pass it into the dashboard
backup script. Also make sure dashboard backups are kept in sync with
any port changes.

LP: #1894011

Reviewed-on: https://code.launchpad.net/~mruffell/charm-grafana/+git/charm-grafana/+merge/390215
Reviewed-by: James Hebden <email address hidden>
Reviewed-by: Chris Johnston <email address hidden>
Reviewed-by: Drew Freiberger <email address hidden>

c632b1f... by Joe Guo

add dashboards-joined hook

when relate an operator based charm, e.g.: cloudstats, to grafana, this hook won't trigger:

    @when("grafana.started", "endpoint.dashboards.has_requests")
    @when_not("grafana.change-block")
    def import_dashboards(dashboards):
        ...

So dashboard will not be imported and there is no error.

Add a normal `joined` hook, query relation data directly with key, so operator based
charm can relate to grafana and import dashboard.

Reviewed-on: https://code.launchpad.net/~llama-charmers/charm-grafana/+git/charm-grafana/+merge/391854
Reviewed-by: James Hebden <email address hidden>
Reviewed-by: Xav Paice <email address hidden>

6ab6bed... by Joe Guo

add dashboards-relation-joined hook

when relate an operator based charm, e.g.: cloudstats, to grafana, this hook won't trigger:

 @when("grafana.started", "endpoint.dashboards.has_requests")
 @when_not("grafana.change-block")
 def import_dashboards(dashboards):
     ...

So dashboard will not be imported and there is no error.

Add a normal `dashboards-relation-joined` hook, query relation data directly with key,
so operator based charm can relate to grafana and import dashboard.

Signed-off-by: Joe Guo <email address hidden>

664d960... by Adam Dyess

Reinstate service check on grafana charm

Reviewed-on: https://code.launchpad.net/~llama-charmers/charm-grafana/+git/charm-grafana/+merge/391695
Reviewed-by: James Hebden <email address hidden>

de15271... by Adam Dyess

Merge branch 'master' of git+ssh://git.launchpad.net/charm-grafana into LP1891719

239f891... by Joe Guo

Fix LP1897843: support non-wrapped JSON data and keep backward compatibility

Currently this charm requires dashboard JSON data be wrapped like this:

    {
        "dashbaord": {<real dashboard JSON data>},
        "overwrite": true,
        "folderId": 1
    }

Actually this is a misuse of the grafana rest api structure.
Dashboard JSON data should include the real data directly.
Refer to LP1897843 for details.

This patch make the code support both formats.
Since most of our dashboard JSON file followed the wrong pattern, we
have to keep backward compatibility until grafana charm upgraded in all clouds.

LP: #1897843

Reviewed-on: https://code.launchpad.net/~llama-charmers/charm-grafana/+git/charm-grafana/+merge/391653
Reviewed-by: Adam Dyess <email address hidden>
Reviewed-by: James Hebden <email address hidden>

5c5a449... by Joe Guo

Fix LP1897843: support non-wrapped JSON data and keep backward compatibility

Currently this charm requires dashboard JSON data be wrapped like this:

    {
        "dashbaord": {<real dashboard JSON data>},
        "overwrite": true,
        "folderId": 1
    }

Actually this is a misuse of the grafana rest api structure.
Dashboard JSON data should include the real data directly.
Refer to LP1897843 for details.

This patch make the code support both formats.
Since most of our dashboard JSON file followed the wrong pattern, we
have to keep backward compatibility until grafana charm upgraded in all clouds.

LP: #1897843

Signed-off-by: Joe Guo <email address hidden>

c34eb36... by Joe Guo

add setuptools to wheelhouse.txt

`make build` failed on focal with:

    ModuleNotFoundError: No module named 'setuptools._distutils'

add setuptools fixed this.

Signed-off-by: Joe Guo <email address hidden>