-
Notifications
You must be signed in to change notification settings - Fork 121
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
[utils] Add micro-mordred #190
Conversation
@valeriocos I tried this with the
The steps Step1 and Step2 cannot be run simultaneously because currently, we can supply only one backend to the For studies related to the And to generate the enriched pull_requests only index too, we will need both the indices, thus we will need two backend sections. Can you please modify the code so that we are able to run multiple backends simultaneously? def micro_mordred(cfg_path, backend_sections, raw, arthur, enrich):
config = Config(cfg_path)
if raw:
for backend in backend_sections:
get_raw(config, backend, arthur)
if enrich:
for backend in backend_sections:
get_enrich(config, backend)
def get_params_parser():
"""Parse command line arguments"""
...
parser.add_argument("--backend", dest='backend_sections', default=[],
nargs='*', help="Backend section to execute") Please comment if this makes sense? |
Thank you @aswanipranjal for the suggestions! I have just modified the PR, which now includes the changes you proposed (the example has been modified accordingly as well). Let me know if you have any other suggestion or feedback. |
Thank you @valeriocos. This works perfectly for me. @sduenas please review? |
This code adds the `enrich_pull_requests` study to the enriched/github.py file. This study aims at adding additional fields that are related to pull request items but are not fetched by perceval directly for items of the pull_requests category. This study should be used using the functionality added by the PR: chaoss/grimoirelab-sirmordred#190. This study takes in an input param: `raw_issues_index` which should contain the data fetched from the same repository from which the pull requests data is fetched. Using this `raw_issues_index`, the additional data is extracted from related issue and that data is enriched and added to the relevant pull request and updated in the enriched pull request index.
This code adds `enrich_pull_requests` as one of the studies that can be run, in the studies tuple in the `get_study_section` method. This code helps add the functionality to to enrich pull requests only index with additional fields. PRs related to this code are: - chaoss#190 - chaoss/grimoirelab-elk#419
This code adds the `enrich_pull_requests` study to the enriched/github.py file. This study aims at adding additional fields that are related to pull request items but are not fetched by perceval directly for items of the pull_requests category. This study should be used using the functionality added by the PR: chaoss/grimoirelab-sirmordred#190. This study takes in an input param: `raw_issues_index` which should contain the data fetched from the same repository from which the pull requests data is fetched. Using this `raw_issues_index`, the additional data is extracted from related issue and that data is enriched and added to the relevant pull request and updated in the enriched pull request index. This code also: - uses `str_to_datetime` function to convert date in string format to datetime where ever time difference between two dates is being calculated - corrects typo in enriched/git.py
This code adds the `enrich_pull_requests` study to the enriched/github.py file. This study aims at adding additional fields that are related to pull request items but are not fetched by perceval directly for items of the pull_requests category. This study should be used using the functionality added by the PR: chaoss/grimoirelab-sirmordred#190. This study takes in an input param: `raw_issues_index` which should contain the data fetched from the same repository from which the pull requests data is fetched. Using this `raw_issues_index`, the additional data is extracted from related issue and that data is enriched and added to the relevant pull request and updated in the enriched pull request index. This code also: - uses `str_to_datetime` function to convert date in string format to datetime where ever time difference between two dates is being calculated - corrects typo in enriched/git.py
This code adds `enrich_pull_requests` as one of the studies that can be run, in the studies tuple in the `get_study_section` method. This code helps add the functionality to to enrich pull requests only index with additional fields. PRs related to this code are: - #190 - chaoss/grimoirelab-elk#419
@aswanipranjal @valeriocos could you please explain the rationale for why we need this, instead of just using sirmordred (maybe with some new option)? |
That's a good idea and probably the correct evolution of micro-morded. However, for the moment I would keep the micro-modred and sirmordred separated (since I don't know how much work is needed to modify sirmordred to include the micro-mordred option). |
@valeriocos @sduenas @jgbarah is there any progress on merging this PR? |
ccada95
to
6650fd1
Compare
This PR needs #198 before merging |
a940a13
to
690502b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This code proposes a tiny version of mordred to execute just once raw, merge identities, enrich, panels tasks of mordred on a given set of backends (declared in a cfg file passed as input). The micro-mordred overcomes the current limitations of the p2o script in ELK, which is not able to execute multiple studies for the input backend and requires constant changes to align its logic with the ELK one. The micro-mordred isn't supposed to require constant changes, since there is not gap between its logic and the mordred one. In order to execute the micro-mordred on git and github, an example of the command is shown below: `micro --raw --identities --enrich --panels --cfg ./setup.cfg --backends git github:issue github:pull`.
This code includes examples of the setup.cfg, projects.json and menu.yaml to execute micro-mordred.
1066a02
to
60e635e
Compare
This code proposes a tiny version of mordred to execute just once raw, merge identities, enrich, panels tasks of mordred on a given set of backends (declared in a cfg file passed as input). The micro-mordred overcomes the current limitations of the p2o script in ELK, which is not able to execute multiple studies for the input backend and requires constant changes to align its logic with the ELK one. The micro-mordred isn't supposed to require constant changes, since there is not gap between its logic and the mordred one.
In order to execute the micro-mordred on git and github, an example of the command is shown below:
micro --raw --identities --enrich --panels --cfg ./setup.cfg --backends git github:issue github:pull
.