Repository: pulp/pulpcore

Issue:
Telemetry of dev installs submitted to production site (https://anaytics.pulpproject.org/)
**Version**
3.20.z and 3.21.z

**Describe the bug**
Telemetry of a non-GA component is being submitted to analytics.pulpproject.org. This is unexpected and causes summarization to stop working with this exception:

```
Traceback (most recent call last):
  File "/srv/app/./manage.py", line 22, in <module>
    main()
  File "/srv/app/./manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/management/base.py", line 414, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/management/base.py", line 460, in execute
    output = self.handle(*args, **options)
  File "/srv/app/pulpanalytics/management/commands/summarize.py", line 112, in handle
    self._handle_components(systems, summary)
  File "/srv/app/pulpanalytics/management/commands/summarize.py", line 74, in _handle_components
    semver_version = semver.parse(component.version)
  File "/opt/app-root/lib64/python3.9/site-packages/semver.py", line 159, in wrapper
    return func(*args, **kwargs)
  File "/opt/app-root/lib64/python3.9/site-packages/semver.py", line 190, in parse
    return VersionInfo.parse(version).to_dict()
  File "/opt/app-root/lib64/python3.9/site-packages/semver.py", line 726, in parse
    raise ValueError("%s is not valid SemVer string" % version)
ValueError: 2.0.0a6 is not valid SemVer string
```


Discussion:
@pulp/core I added prio-list to this for two reasons. Please let me know if you'd like me to do something differently.

* The production telemetry site is incorrectly receiving data from developer installations, which is a significant data quality problem.
* There are no other unassigned issues with prio-list.

Resolving patch:
diff --git a/pulpcore/app/tasks/telemetry.py b/pulpcore/app/tasks/telemetry.py
--- a/pulpcore/app/tasks/telemetry.py
+++ b/pulpcore/app/tasks/telemetry.py
@@ -23,10 +23,24 @@
 
 
 def get_telemetry_posting_url():
+    """
+    Return either the dev or production telemetry FQDN url.
+
+    Production version string examples:  ["3.21.1", "1.11.0"]
+    Developer version string example: ["3.20.3.dev", "2.0.0a6"]
+
+    Returns:
+        The FQDN string of either the dev or production telemetry site.
+    """
     for app in pulp_plugin_configs():
-        if ".dev" in app.version:
+        if not app.version.count(".") == 2:  # Only two periods allowed in prod version strings
             return DEV_URL
 
+        x, y, z = app.version.split(".")
+        for item in [x, y, z]:
+            if not item.isdigit():  # Only numbers should be in the prod version string components
+                return DEV_URL
+
     return PRODUCTION_URL
 
 


Test patch: