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

do not merge - additional resources support #189

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Commits on Aug 23, 2023

  1. Configuration menu
    Copy the full SHA
    61e2c1c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a133155 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4cbdf21 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dd37f78 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2023

  1. gitignore emacs

    thomas-riccardi committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    a7e5867 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    455eb93 View commit details
    Browse the repository at this point in the history
  3. add cookie dogweb auth mode

    needed for hack web frontend api usage (e.g. logs_facets)
    
    when defining config cookie_dogweb value, the client *switches* to
    cookie *only*: the api doesn't support both api/app key & cookie auth.
    => when setting cookie_dogweb config, it will break all standard
    resources types.
    
    also need csrf_token for destination as _authentication_token key in
    request payload for write actions.
    thomas-riccardi committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    5e01b18 View commit details
    Browse the repository at this point in the history
  4. additional resource: logs_facets

    - hardcoded source & target scopeid for now (seem to be internal index id, but
      which ones?)
    - use x-csrf-token as _authentication_token key in request payload for
      write actions
    thomas-riccardi committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    0af262b View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. additional resource: logs_views

    - use dogweb cookie auth
    - use x-csrf-token as _authentication_token key in request payload for
      write actions
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    8226ca5 View commit details
    Browse the repository at this point in the history
  2. additional resource: metric_metadatas

    - get all metric metadata with standard v2 api, but it returns only ids
    - hack import_resource standard pattern to populate the dict that
      contains just 'id'; it's called during import just after
      get_resources()
    - get & update metric metadata uses v1 api, which doesn't have 'id' in
      its dict, hack adding it everywhere for consistency with v2/standard
      pattern
    - create metric metadata is *not* supported by datadog api, just
      update it on already existing metric: raise error explaining that:
      first push data-points on metric, then rerun the script
      - use standard pattern to get the destination resources (just ids
        here), and call update_resource() instead if it already exists
      - initial diff won't be the actual diff: it says it will create everything
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    62293f4 View commit details
    Browse the repository at this point in the history
  3. Fix crash on resource_connection when hitting None instead of object …

    …just when len(keys_list) == 1
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    9469688 View commit details
    Browse the repository at this point in the history
  4. additional resource: incidents

    Only the base incident data is supported, related
    resources (integrations(slack), todos(remediations), attachments) may
    be done later with dedicated resources.
    
    The import is lossy: for example the creation date is on sync,
    timeline is lost, etc.
    
    - the datadog api documentation says only a subset of accepted fields
      for creation; in practice it does handles only a subset, and ignores
      the others
      => auto update just after create to sync more data
    - attributes.notification_handles ignored: too hard to reproduce
      properly, spams people during sync (or dates are all wrong); we
      don't really care about that piece of information => skip it
    - avoid forever diff on old incidents without `attributes.visibility`:
      hardcode `organization` value, it's what will be created on the
      destination organization anyway
    - incidents list api initially skipped old incidents without
      `visibility` field, exchange with datadog support resulted in a
      production fix
    - after full import: it seems users not yet active on the destination
      organization are in fact *not* notified (active incidents commanders
      are notified, and mandatory according to api documentation)
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    276d2e0 View commit details
    Browse the repository at this point in the history
  5. Add deepomatic-specific incident fields migration: Namespace=>kube_na…

    …mespace
    
    if kube_namespace is not null, don't overwrite: the data is better.
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    9518f0d View commit details
    Browse the repository at this point in the history
  6. Fix crash in remove_excluded_attr() and remove_non_nullable_attribute…

    …s() when last level is an array of non-nested objects
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    395916d View commit details
    Browse the repository at this point in the history
  7. additional resource: incident_org_settings

    - undocumented api, but standard v2 api used by web frontend, works
      with API/APP key
    - just one resource per org, forcing update, ignoring ids, etc.
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    6e922d7 View commit details
    Browse the repository at this point in the history
  8. additional resource: incidents_config_fields

    - unique by attributes.names
    - perpetual diff: on 'metadata' for ootb service & team:
      - PATCH ok (maybe ignores metadata?)
      - but PATCH response contains `metadata: null`
      => `diffs` always shows it; it's ok, we can ignore those
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    6f8723c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f753f56 View commit details
    Browse the repository at this point in the history
  10. additional resource: incidents_config_integrations_workflows

    Covers General>Integrations & Notifications>Rules
    
    - api inconsistency: `attributes.triggers.variables.severity_values`
      and `attributes.triggers.variables.status_values` are `null` in read
      calls, and require an array in write calls
      => skipping them with non_nullable_attr (fixed to support lists too)
    - errors (probably because some workflows are hardcoded, not duplicable, but no obvious attribute to distingish them)
      - Error: 400 Bad Request - {"errors":["a workflow like that already exists"]}
      - Error: 400 Bad Request - {"errors":["Invalid payload: 'name' is invalid"]}
      => ignoring those errors for now, and manually fixed `Send all incident updates to a global channel` via web frontend.
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    c46370a View commit details
    Browse the repository at this point in the history
  11. additional resource: incidents_todos

    - iterate on all incidents, then for each incident, iterate on
      relationships 'todo'
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    4daf218 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8d8fd9c View commit details
    Browse the repository at this point in the history
  13. additional resource: integrations_slack_channels

    - api doesn't support `display.muting` option, cf https://help.datadoghq.com/hc/en-us/requests/1380152
    thomas-riccardi committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    2f48fa8 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a8adbb8 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. Configuration menu
    Copy the full SHA
    1d25d5d View commit details
    Browse the repository at this point in the history