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

Add metrics_metadata to manifest #7617

Merged
merged 1 commit into from
Sep 17, 2020
Merged

Conversation

nmuesch
Copy link
Collaborator

@nmuesch nmuesch commented Sep 17, 2020

What does this PR do?

Adds the path to the metadata.csv file to the integration's manifest.json file
This is to further standardize how we look for integration assets (and is currently what we do for service_checks.json files)

Additional Notes

Mostly a re-use of the script I used for this PR - #3768

from datadog_checks.dev.tooling.utils import get_valid_integrations, load_manifest, get_manifest_file
from datadog_checks.dev.tooling.constants import set_root

import json
import os

ROOT = '/Users/nicholasmuesch/git/integrations-core/'


def get_updated_manifest(manifest_data):
    manifest_data['assets']['metrics_metadata'] = 'metadata.csv'
    return manifest_data


if __name__ == "__main__":
    set_root(ROOT)
    checks = get_valid_integrations()
    for check in checks:
        print(f'Modifying {check}')
        current_dir = f'{ROOT}{check}'
        manifest_file = get_manifest_file(check)
        manifest = load_manifest(check)

        # Update the manifest file to include this new locations
        if os.path.exists(os.path.join(ROOT, check, 'metadata.csv')):
            manifest = get_updated_manifest(manifest)

            with open(manifest_file, 'w+') as f:
                f.write(f'{json.dumps(manifest, indent=2)}\n')

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@nmuesch nmuesch requested review from anshumgargdd and a team as code owners September 17, 2020 16:28
@nmuesch nmuesch changed the title Add metadata to manifest Add metrics_metadata to manifest Sep 17, 2020
Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@nmuesch nmuesch merged commit 1436bdc into master Sep 17, 2020
@nmuesch nmuesch deleted the nick/add_metadata_to_manifest branch September 17, 2020 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants