forked from chaoss/grimoirelab-elk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[elk] Handle private repos in git studies
This code prevents to store the credentials of the git private repos in the studies indexes (aoc and git branches). This change requires to improve also the way the project attribute is assigned to a repository. In the case of a private repo, the corresponding data source in the projects.json is accessed, each repo is anonymized and the output is compared with current repo (which value is stored in the indexes). Tests have been updated accordingly. Signed-off-by: Valerio Cosentino <[email protected]>
- Loading branch information
1 parent
b15814e
commit 8ce8c34
Showing
8 changed files
with
208 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
# Nishchith Shetty <[email protected]> | ||
# | ||
|
||
from grimoirelab_toolkit.datetime import str_to_datetime | ||
from grimoirelab_toolkit.datetime import str_to_datetime, unixtime_to_datetime | ||
|
||
|
||
def get_unique_repository(): | ||
|
@@ -178,9 +178,15 @@ def get_to_date(es_in, in_index, out_index, repository_url, interval): | |
index=out_index, | ||
body=get_last_study_date(repository_url, interval))["aggregations"]["1"] | ||
|
||
if last_study_date["value"] is not None: | ||
if "value_as_string" in last_study_date and last_study_date["value_as_string"]: | ||
study_data_available = True | ||
to_date = str_to_datetime(last_study_date["value_as_string"]) | ||
elif "value" in last_study_date and last_study_date["value"]: | ||
study_data_available = True | ||
try: | ||
to_date = unixtime_to_datetime(last_study_date["value"]) | ||
except Exception: | ||
to_date = unixtime_to_datetime(last_study_date["value"] / 1000) | ||
|
||
if not study_data_available: | ||
first_item_date = es_in.search( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Support for Git private repos | ||
category: added | ||
author: Valerio Cosentino <[email protected]> | ||
issue: 873 | ||
notes: > Git private repos can now be handled by | ||
ELK, which allows to deal with the credentials that | ||
appear in the repo URLs passed via the projects.json. | ||
These URLs are processed when storing/retrieving the | ||
data in the raw, enriched and studies indexes to make | ||
sure that the credentials are not included in the | ||
indexes nor visible on the dashboards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,7 +438,7 @@ | |
} | ||
] | ||
} | ||
},{ | ||
},{ | ||
"backend_name": "Git", | ||
"backend_version": "0.12.0", | ||
"perceval_version": "0.14.0", | ||
|
Oops, something went wrong.