grimoirelab-elk icon indicating copy to clipboard operation
grimoirelab-elk copied to clipboard

[metadata] Remove metadata from empty enriched items

Open animeshk08 opened this issue 4 years ago • 5 comments

Fixes: #846 This commit updates the enricher for github and gitlab to prevent addition of metadata fields to empty enriched items

Signed-off-by: Animesh Kumar [email protected]

animeshk08 avatar Apr 15 '20 17:04 animeshk08

Hi @valeriocos. I have checked the enrichers for all the backends. Even though most of the backend override the enrich_items method, they do not require this fix as there no category based checks. In other words, in all the other backends except GitHub and GitLab the enrich items are never empty.

Please have a look at this PR :)

Also, I will update the tests and separate the commits tomorrow :)

animeshk08 avatar Apr 15 '20 17:04 animeshk08

Pull Request Test Coverage Report for Build 2135

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 219 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.06%) to 79.573%

Files with Coverage Reduction New Missed Lines %
/home/travis/build/chaoss/grimoirelab-elk/grimoire_elk/enriched/github2.py 16 94.19%
/home/travis/build/chaoss/grimoirelab-elk/grimoire_elk/enriched/gitlab.py 20 87.8%
/home/travis/build/chaoss/grimoirelab-elk/grimoire_elk/enriched/github.py 38 75.93%
/home/travis/build/chaoss/grimoirelab-elk/grimoire_elk/enriched/enrich.py 145 73.6%
<!-- Total: 219
Totals Coverage Status
Change from base Build 2133: 0.06%
Covered Lines: 7904
Relevant Lines: 9933

💛 - Coveralls

coveralls avatar Apr 15 '20 17:04 coveralls

Hi, @valeriocos. Please have a look at this PR :) SInce only GitHub and GitLab had such a category check of items the PR covers only these backends. Do you think we should extend this check to other backends as well? This will serve two main purposes:

  • In case a raw item is not to be enriched at all.
  • In case fetching of a new category of item is integrated and work is being done on creating its enricher. WDYT?

animeshk08 avatar Apr 24 '20 12:04 animeshk08

Hi @animeshk08 , sorry for the late reply! ^^

We are testing it in the pre-production environment, and the initial tests are good. It will be probably go into the release 0.2.41 (not the upcoming one, but the next one).

valeriocos avatar Apr 24 '20 12:04 valeriocos

Thank you for the quick reply @valeriocos. Let me know when there are any updates. We can extend the discussion on https://github.com/chaoss/grimoirelab-elk/pull/848#issuecomment-618975697 then :)

animeshk08 avatar Apr 24 '20 12:04 animeshk08