diff --git a/.github/actions/setup-python/action.yml b/.github/actions/setup-python/action.yml index 6d46a6bd..c93eed25 100644 --- a/.github/actions/setup-python/action.yml +++ b/.github/actions/setup-python/action.yml @@ -16,7 +16,7 @@ runs: id: setup-python uses: actions/setup-python@v5.1.0 with: - python-version: "3.12.3" + python-version: "3.12.10" cache: "pip" cache-dependency-path: ${{ inputs.python-requirements-paths }} - name: Install Python dependencies diff --git a/engine/Dockerfile b/engine/Dockerfile index 70035d5c..c89ea8a7 100644 --- a/engine/Dockerfile +++ b/engine/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12.6-alpine3.20 AS base +FROM python:3.12.10-alpine3.21 AS base ARG TARGETPLATFORM # Create a group and user to run an app diff --git a/grafana-plugin/go.mod b/grafana-plugin/go.mod index 83b5cb71..2ee73937 100644 --- a/grafana-plugin/go.mod +++ b/grafana-plugin/go.mod @@ -79,10 +79,10 @@ require ( go.opentelemetry.io/proto/otlp v1.5.0 // indirect golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.36.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/net v0.38.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect diff --git a/grafana-plugin/go.sum b/grafana-plugin/go.sum index 40e9777d..27d8a0ad 100644 --- a/grafana-plugin/go.sum +++ b/grafana-plugin/go.sum @@ -249,13 +249,13 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191020152052-9984515f0562/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -268,12 +268,12 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/tools/migrators/Dockerfile b/tools/migrators/Dockerfile index 1a76dfa6..975becad 100644 --- a/tools/migrators/Dockerfile +++ b/tools/migrators/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12.3-alpine3.18 +FROM python:3.12.10-alpine3.21 ENV PYTHONUNBUFFERED=1 WORKDIR /app diff --git a/tools/migrators/README.md b/tools/migrators/README.md index 6ec85fd2..0232431c 100644 --- a/tools/migrators/README.md +++ b/tools/migrators/README.md @@ -6,7 +6,7 @@ Currently the migration tool supports migrating from: - PagerDuty - Splunk OnCall (VictorOps) -- OpsGenie +- Opsgenie ## Getting Started @@ -16,7 +16,7 @@ Currently the migration tool supports migrating from: 4. Depending on which tool you are migrating from, see more specific instructions there: - [PagerDuty](#prerequisites) - [Splunk OnCall](#prerequisites-1) - - [OpsGenie](#prerequisites-2) + - [Opsgenie](#prerequisites-2) 5. Run a [migration plan](#migration-plan) 6. If you are pleased with the results of the migration plan, run the tool in [migrate mode](#migration) @@ -49,7 +49,7 @@ docker run --rm \ oncall-migrator ``` -#### OpsGenie +#### Opsgenie ```shell docker run --rm \ @@ -118,7 +118,7 @@ docker run --rm \ oncall-migrator ``` -#### OpsGenie +#### Opsgenie ```shell docker run --rm \ @@ -583,7 +583,7 @@ See [Migrating Users](#migrating-users) for some more information on how users a - Note that delays between escalation steps may be slightly different in Grafana OnCall, see [Limitations](#limitations-1) for more info. -## OpsGenie +## Opsgenie ### Overview @@ -598,12 +598,12 @@ Resources that can be migrated using this tool: - Not all integration types are supported - Not all Escalation Policy rule types are supported -- OpsGenie schedules with time restrictions (time-of-day or weekday-and-time-of-day) are not supported +- Opsgenie schedules with time restrictions (time-of-day or weekday-and-time-of-day) are not supported - Delays between migrated notification/escalation rules could be slightly different from original ### Prerequisites -- Obtain an OpsGenie API key: +- Obtain an Opsgenie API key: ### Configuration @@ -612,15 +612,15 @@ Configuration is done via environment variables passed to the docker container. | Name | Description | Type | Default | | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ------- | | `MIGRATING_FROM` | Set to `opsgenie` | String | N/A | -| `OPSGENIE_API_KEY` | OpsGenie API key. To create a key, refer to [OpsGenie docs](https://docs.opsgenie.com/docs/api-key-management). | String | N/A | -| `OPSGENIE_API_URL` | OpsGenie API URL. Use `https://api.eu.opsgenie.com/v2` for EU instances. | String | `https://api.opsgenie.com/v2` | +| `OPSGENIE_API_KEY` | Opsgenie API key. To create a key, refer to [Opsgenie docs](https://docs.opsgenie.com/docs/api-key-management). | String | N/A | +| `OPSGENIE_API_URL` | Opsgenie API URL. Use `https://api.eu.opsgenie.com/v2` for EU instances. | String | `https://api.opsgenie.com/v2` | | `ONCALL_API_URL` | Grafana OnCall API URL. This can be found on the "Settings" page of your Grafana OnCall instance. | String | N/A | | `ONCALL_API_TOKEN` | Grafana OnCall API Token. To create a token, navigate to the "Settings" page of your Grafana OnCall instance. | String | N/A | | `MODE` | Migration mode (plan vs actual migration). | String (choices: `plan`, `migrate`) | `plan` | | `UNSUPPORTED_INTEGRATION_TO_WEBHOOKS` | When set to `true`, integrations with unsupported type will be migrated to Grafana OnCall integrations with type "webhook". When set to `false`, integrations with unsupported type won't be migrated. | Boolean | `false` | | `MIGRATE_USERS` | If `false`, will allow you to import all objects while ignoring user references in schedules and escalation policies. In addition, if `false`, will also skip importing User notification rules. | Boolean | `true` | | `OPSGENIE_FILTER_TEAM` | Filter resources by team name. Only resources associated with this team will be migrated. | String | N/A | -| `OPSGENIE_FILTER_USERS` | Filter resources by OpsGenie user IDs (comma-separated). Only resources associated with these users will be migrated. | String | N/A | +| `OPSGENIE_FILTER_USERS` | Filter resources by Opsgenie user IDs (comma-separated). Only resources associated with these users will be migrated. | String | N/A | | `OPSGENIE_FILTER_SCHEDULE_REGEX` | Filter schedules by name using a regex pattern. Only schedules whose names match this pattern will be migrated. | String | N/A | | `OPSGENIE_FILTER_ESCALATION_POLICY_REGEX` | Filter escalation policies by name using a regex pattern. Only policies whose names match this pattern will be migrated. | String | N/A | | `OPSGENIE_FILTER_INTEGRATION_REGEX` | Filter integrations by name using a regex pattern. Only integrations whose names match this pattern will be migrated. | String | N/A | @@ -630,41 +630,41 @@ Configuration is done via environment variables passed to the docker container. #### User notification rules -The tool is capable of migrating user notification rules from OpsGenie to Grafana OnCall. -Notification rules from OpsGenie will be migrated to both default and important notification rules in Grafana OnCall +The tool is capable of migrating user notification rules from Opsgenie to Grafana OnCall. +Notification rules from Opsgenie will be migrated to both default and important notification rules in Grafana OnCall for each user. Note that delays between notification rules may be slightly different in Grafana OnCall. By default (when `PRESERVE_EXISTING_USER_NOTIFICATION_RULES` is `true`), existing notification rules in Grafana OnCall will -be preserved and OpsGenie rules won't be imported for users who already have notification rules configured in Grafana OnCall. +be preserved and Opsgenie rules won't be imported for users who already have notification rules configured in Grafana OnCall. -If you want to replace existing notification rules with ones from OpsGenie, set `PRESERVE_EXISTING_USER_NOTIFICATION_RULES` +If you want to replace existing notification rules with ones from Opsgenie, set `PRESERVE_EXISTING_USER_NOTIFICATION_RULES` to `false`. See [Migrating Users](#migrating-users) for some more information on how users are migrated. #### On-call schedules -The tool is capable of migrating on-call schedules from OpsGenie to Grafana OnCall. +The tool is capable of migrating on-call schedules from Opsgenie to Grafana OnCall. Schedules are migrated with their rotations. The following features are supported: - Daily, weekly, and hourly rotations - Multiple rotations per schedule - Schedule overrides -On-call schedules will be migrated to new Grafana OnCall schedules with the same name as in OpsGenie. +On-call schedules will be migrated to new Grafana OnCall schedules with the same name as in Opsgenie. Any existing schedules with the same name will be deleted before migration. -Any on-call schedules that reference unmatched users won't be migrated. Any OpsGenie schedule which +Any on-call schedules that reference unmatched users won't be migrated. Any Opsgenie schedule which uses time restrictions will not be migrated as migrating these is not supported. #### Escalation policies -The tool is capable of migrating escalation policies from OpsGenie to Grafana OnCall. +The tool is capable of migrating escalation policies from Opsgenie to Grafana OnCall. Every escalation policy will be migrated to a new Grafana OnCall escalation chain with name convention of `{team name} - {escalation policy name}`. Caveats: -- Only the "Notify user" and "Notify on-call user(s) in schedule" rule types are supported. If an OpsGenie Escalation +- Only the "Notify user" and "Notify on-call user(s) in schedule" rule types are supported. If an Opsgenie Escalation Policy references a rule other than these, those rule steps are simply ignored in the migration - Any existing escalation chains with the same name will be deleted, in Grafana OnCall, before migration. Note that delays between escalation steps may be slightly different in Grafana OnCall @@ -673,8 +673,8 @@ be done manually #### Integrations -The tool is capable of migrating integrations from OpsGenie to Grafana OnCall. -For every integration in OpsGenie, the tool will migrate it to a Grafana OnCall integration. +The tool is capable of migrating integrations from Opsgenie to Grafana OnCall. +For every integration in Opsgenie, the tool will migrate it to a Grafana OnCall integration. Any integrations with unsupported type won't be migrated unless `UNSUPPORTED_INTEGRATION_TO_WEBHOOKS` is set to `true`. @@ -701,7 +701,7 @@ The following integration types are supported: - Connect integrations (press the "How to connect" button on the integration page) - Make sure users connect their phone numbers, Slack accounts, etc. in their user settings -- Review and adjust any webhook integrations that were migrated from unsupported OpsGenie integration types +- Review and adjust any webhook integrations that were migrated from unsupported Opsgenie integration types ## Migrating Users @@ -755,7 +755,7 @@ docker run --rm \ oncall-migrator python /app/add_users_to_grafana.py ``` -### OpsGenie +### Opsgenie ```bash docker run --rm \ @@ -768,7 +768,7 @@ docker run --rm \ oncall-migrator python /app/add_users_to_grafana.py ``` -You can also filter which OpsGenie users are added to Grafana by using the `OPSGENIE_FILTER_USERS` environment variable: +You can also filter which Opsgenie users are added to Grafana by using the `OPSGENIE_FILTER_USERS` environment variable: ```bash docker run --rm \ @@ -783,5 +783,5 @@ oncall-migrator python /app/add_users_to_grafana.py ``` This is useful when you want to selectively add users to Grafana, such as when testing the migration process -or when you only need to add specific users from a large OpsGenie organization. -The `OPSGENIE_FILTER_USERS` variable should contain a comma-separated list of OpsGenie user IDs. +or when you only need to add specific users from a large Opsgenie organization. +The `OPSGENIE_FILTER_USERS` variable should contain a comma-separated list of Opsgenie user IDs.