sensein / etelemetry-client

Etelemetry client
Other
3 stars 9 forks source link

autodetect CI #1

Closed mgxd closed 4 years ago

mgxd commented 5 years ago

something similar to https://github.com/watson/is-ci, in order to avoid excessive entries

yarikoptic commented 5 years ago

Fwiw it might still be useful to get those registered, just annotated properly.

effigies commented 5 years ago

I didn't find a Python package to do the equivalent, but I did a quick search for predefined environment variables for different CIs that should cover 99%+ of the cases:

CI_VARS = {
    'AppVeyor': ('APPVEYOR', 'CI'),
    'Azure': ('AGENT_OS', 'BUILD_BUILDID'),  # This one needs testing...
    'CircleCI': ('CIRCLECI', 'CI'),
    'Jenkins': ('EXECUTOR_NUMBER', 'BUILD_TAG'),
    'Travis': ('TRAVIS', 'CI'),
    'Unknown': 'CI',  # Fallback
    }

Did it as a dict in case you're interested in keeping track of which CIs are being used.

mgxd commented 5 years ago

thanks @effigies - I was looking into how the package in my op gathers it and it looks to be similar

@yarikoptic we haven't properly stress tested the etelemetry suite yet, and few packages have been et'ed that logging these should be fine. But we'll have to come back to the question of whether having excessive logging affects performance once we have integrated more projects

mgxd commented 5 years ago

we can leverage mgxd/ci-info on requests