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

Syncing resources multiple times creates duplicates. #203

Open
vin-appdirect opened this issue Jan 12, 2024 · 8 comments
Open

Syncing resources multiple times creates duplicates. #203

vin-appdirect opened this issue Jan 12, 2024 · 8 comments

Comments

@vin-appdirect
Copy link

Overview of issue:

Steps to reproduce the issue:

  1. Create dashboard in source org.
  2. Use datadog-sync-cli to import diff and sync dashboard to destination org
  3. dashboard is created in destination org.
  4. Rerun the import diff and sync command and a duplicate dashboard is created in destination org.

Describe the results you received:
Dashboard was duplicated in destination org when the sync command is rerun.

Describe the results you expected:
Dashboard should not be duplicated in destination org when the sync command is rerun

Additional information you deem important (e.g. issue happens only occasionally):

@therve
Copy link
Contributor

therve commented Jan 13, 2024

Hi,

Can you describe how you run the tool? State is supposed to be saved locally, this is what should prevent duplicates. What's the version you're using?

Thanks.

@vin-appdirect
Copy link
Author

Hi,

I am using a config file to store the source and destination app and api keys. and mentioning resources and filter in the same config file. Thats how the config file looks like (didnt mention keys here though).

resources="dashboards"
filter=["Type=Dashboards;Name=title;Value=hello-world"]

Then we run the below commands.

datadog-sync import --config config.properties
datadog-sync diffs --config config.properties
datadog-sync sync --config config.properties

@therve
Copy link
Contributor

therve commented Jan 14, 2024

Can you verify what's present in the resources directory? Do you keep its content between runs?

@vin-appdirect
Copy link
Author

I tihnk that was the reason. The resources directory was removed and as a result it created the resources with a new ID and synced those. This can be closed. thanks

@chino
Copy link

chino commented Jan 16, 2024

I had something similar happen where they got duplicated. Are we saying here we have to store the resources folder forever? Does it not simply check the target list before adding it again? Is there no unique ID such as the title which can be the key?

@therve
Copy link
Contributor

therve commented Jan 16, 2024

Yes you have to keep the resources folder around. Things like titles are not unique identifier, so we need to keep a mapping of IDs between the 2 orgs.

@chino
Copy link

chino commented Jan 16, 2024

In any case is there no way that refreshing the resources can pull a unique id from the server side? Having to keep a cache folder around isn't practical.

If you send to multiple sources\destinations does the single resources folder remember them all?

@therve
Copy link
Contributor

therve commented Jan 16, 2024

In any case is there no way that refreshing the resources can pull a unique id from the server side? Having to keep a cache folder around isn't practical.

As of today there is no such mechanism no.

If you send to multiple sources\destinations does the single resources folder remember them all?

No if you have multiple source and destination organizations you should keep different resources folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants