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

Allow empty dependency #1879

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions etl/glean.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,15 @@ def get_metrics(self) -> List[GleanMetric]:
for key, metricdict in data.items()
]
for dependency in self.get_dependencies():
dependency_metrics = _cache.get_json(
GleanApp.METRICS_URL_TEMPLATE.format(dependency["v1_name"])
)
# augment these dependency names with the library_name where they came from
metrics += [
(d[0], {**d[1], "origin": dependency["library_name"]})
for d in dependency_metrics.items()
]
if "v1_name" in dependency:
dependency_metrics = _cache.get_json(
GleanApp.METRICS_URL_TEMPLATE.format(dependency["v1_name"])
)
# augment these dependency names with the library_name where they came from
metrics += [
(d[0], {**d[1], "origin": dependency["library_name"]})
for d in dependency_metrics.items()
]

ping_names = set(self._get_ping_data().keys())
processed = []
Expand Down Expand Up @@ -274,15 +275,16 @@ def _get_ping_data(self) -> dict:
)

for dependency in self.get_dependencies():
dependency_pings = dict(
[
(p[0], {**p[1], "origin": dependency["library_name"]})
for p in _cache.get_json(
GleanApp.PING_URL_TEMPLATE.format(dependency["v1_name"])
).items()
]
)
ping_data.update(dependency_pings)
if "v1_name" in dependency:
dependency_pings = dict(
[
(p[0], {**p[1], "origin": dependency["library_name"]})
for p in _cache.get_json(
GleanApp.PING_URL_TEMPLATE.format(dependency["v1_name"])
).items()
]
)
ping_data.update(dependency_pings)

return ping_data

Expand Down