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

Optimize issue and pr recollection #2835

Merged
merged 10 commits into from
Jun 28, 2024
Merged

Optimize issue and pr recollection #2835

merged 10 commits into from
Jun 28, 2024

Conversation

ABrain7710
Copy link
Contributor

@ABrain7710 ABrain7710 commented Jun 25, 2024

Description

  • Optimize the recollection of issues and prs
  • Migrate issues task to use github_data_access since I was already changing the task

Signed commits

  • Yes, I signed my commits.

@ABrain7710 ABrain7710 changed the title Optimize core recollection Optimize issue and pr recollection Jun 25, 2024
if full_collection:
core_data_last_collected = None
else:
core_data_last_collected = get_core_data_last_collected().date()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E1120: No value for argument 'repo_id' in function call (no-value-for-parameter)

key_auth = GithubRandomKeyAuth(logger)

logger.info(f'this is the manifest.key_auth value: {str(key_auth)}')

try:
issue_data = retrieve_all_issue_data(repo_git, logger, key_auth)
issue_data = retrieve_all_issue_data(repo_git, logger, key_auth, core_data_last_collected)

if issue_data:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)

@@ -61,13 +67,13 @@ def collect_pull_requests(repo_git: str) -> int:

# TODO: Rename pull_request_reviewers table to pull_request_requested_reviewers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0511: TODO: Rename pull_request_reviewers table to pull_request_requested_reviewers (fixme)

@@ -61,13 +67,13 @@ def collect_pull_requests(repo_git: str) -> int:

# TODO: Rename pull_request_reviewers table to pull_request_requested_reviewers
# TODO: Fix column names in pull request labels table

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0511: TODO: Fix column names in pull request labels table (fixme)

@@ -1,4 +1,5 @@
import logging

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)

if full_collection:
core_data_last_collected = None
else:
core_data_last_collected = get_core_data_last_collected().date()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E1120: No value for argument 'repo_id' in function call (no-value-for-parameter)

yield data

# return if last pr on the page was updated before the since date
if since and datetime.fromisoformat(data["updated_at"].replace("Z", "+00:00")) < since:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
E1136: Value 'data' is unsubscriptable (unsubscriptable-object)

@@ -61,13 +67,13 @@ def collect_pull_requests(repo_git: str) -> int:

# TODO: Rename pull_request_reviewers table to pull_request_requested_reviewers
# TODO: Fix column names in pull request labels table
def retrieve_all_pr_data(repo_git: str, logger, key_auth): #-> Generator[List[Dict]]:
def retrieve_all_pr_data(repo_git: str, logger, key_auth, since): #-> Generator[List[Dict]]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R1711: Useless return at end of function or method (useless-return)


# return if last pr on the page was updated before the since date
if since and datetime.fromisoformat(data["updated_at"].replace("Z", "+00:00")) < since:
return

def process_pull_requests(pull_requests, task_name, repo_id, logger, augur_db):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R0914: Too many local variables (32/30) (too-many-locals)

@@ -63,8 +63,8 @@ def primary_repo_collect_phase(repo_git, full_collection):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0612: Unused variable 'logger' (unused-variable)

Signed-off-by: Andrew Brain <[email protected]>
Signed-off-by: Andrew Brain <[email protected]>
@ABrain7710 ABrain7710 marked this pull request as ready for review June 26, 2024 00:58
@@ -7,81 +7,72 @@
from augur.tasks.init.celery_app import celery_app as celery
from augur.tasks.init.celery_app import AugurCoreRepoCollectionTask
from augur.application.db.data_parse import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0401: Wildcard import augur.application.db.data_parse (wildcard-import)


return all_data
return list(issues_paginator)

def process_issues(issues, task_name, repo_id, logger) -> None:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
R0914: Too many local variables (32/30) (too-many-locals)

@@ -1,87 +1,80 @@
import logging

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)

Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sgoggins sgoggins merged commit ec84836 into dev Jun 28, 2024
9 checks passed
@ABrain7710 ABrain7710 deleted the optimize-core-recollection-2 branch June 29, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants