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

Update graal.py to make it compatible with non-public repos #1114

Merged
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions grimoire_elk/raw/graal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

from .elastic import ElasticOcean
from ..elastic_mapping import Mapping as BaseMapping
from ..identities.git import GitIdentities
from ..enriched.utils import anonymize_url


class Mapping(BaseMapping):
Expand Down Expand Up @@ -62,6 +64,11 @@ class GraalOcean(ElasticOcean):
"""Graal Ocean feeder"""

mapping = Mapping
identities = GitIdentities
GrayStranger marked this conversation as resolved.
Show resolved Hide resolved

def _fix_item(self, item):
item['origin'] = anonymize_url(item['origin'])
item['tag'] = anonymize_url(item['tag'])

@classmethod
def get_perceval_params_from_url(cls, url):
Expand Down
10 changes: 10 additions & 0 deletions releases/unreleased/graal-anonymize-repository-urls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Anonymize repository URLs in graal backend
category: added
author: GrayStranger <[email protected]>
issue: null
notes: >
The raw data generated by the graal backend had
non-anonymized URLs on the meta fields 'origin'
and 'tag'. This was necessary to generate enriched
data for non-public repositories.