-
Notifications
You must be signed in to change notification settings - Fork 13
Add Collector name and version to Analytics API payload #13
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # constants.py | ||
|
|
||
| """This module defines collector-level constants.""" | ||
|
|
||
| COLLECTOR_NAME='buildkite-test-collector' | ||
| VERSION='0.1.4' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,8 @@ | |
| from dataclasses import dataclass | ||
| from typing import Dict, Optional | ||
| from uuid import uuid4 | ||
|
|
||
| import os | ||
| from .constants import COLLECTOR_NAME, VERSION # pylint: disable=W0611 | ||
|
|
||
| # pylint: disable=C0103 disable=R0902 | ||
|
|
||
|
|
@@ -115,7 +115,9 @@ def as_json(self) -> Dict[str, str]: | |
| "branch": self.branch, | ||
| "commit_sha": self.commit_sha, | ||
| "message": self.message, | ||
| "url": self.url | ||
| "url": self.url, | ||
| "collector": 'python-{COLLECTOR_NAME}', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I should be changing gem/package/library name in the setup.py, so I have instead added collector type clarity here by interpolating the language before the generic name (buildkite-test-collector is the same as the exlir and ruby collector names. The JS collector follows this pattern of interpolation the package name with the language). |
||
| "version": VERSION | ||
| } | ||
|
|
||
| return {k: v for k, v in attrs.items() if v is not None} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python linter doesn't recognise that imports that are interpolated are actually used, so disabling for this line
https://pylint.pycqa.org/en/latest/user_guide/messages/warning/unused-import.html