influxdata / influxdata/influx-cli

Support diff printing of complicated entities in `template apply`

Open
#359 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
75
Forks
22
PR merge metrics
No merged PRs in 30d

Description

If we re-apply a template, it is difficult to know whether existing objects in the template are changing or not.

This is especially difficult for e.g.:

* `check` entities that have a `last updated` field: should changing the last update time count as an update? Currently the database does change the last update time even if nothing else is changing, will that remain the same in the future?
* anything that contains a flux script (tasks, checks, dashboards) - normalizing the flux script to match what is stored in the database is somewhat difficult and would ned to account for database versions.

The goal of this issue is to properly inform the user whether these complicated objects will change during template application, or whether template application is a no-op for that entity. Currently for complicated entities the CLI assumes that applying them is never a no-op (see also https://github.com/influxdata/influx-cli/pull/358) .

I think this would require an API change for the database to be more clear during the dry run apply which entities are actually changing vs which entities are remaining unchanged, possibly with a `StateStatus = "unchanged"` on the returned diff. The CLI would also have to be updated to properly recognise the new StateStatus.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the `template apply` dry-run flow and the API change described in this issue; review influxdata/influx-cli#358 for related context. Determine how complicated entities are represented in the returned diff and define how unchanged entities should be reported, then verify that the CLI prints changed versus unchanged entities correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.