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

Minor clean-ups #283

Merged
merged 3 commits into from
Dec 7, 2023
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test-html-coverage-report: test ## Run tests and show coverage report in browser
open htmlcov/index.html

pylint: ## Run pylint
-pylint --rcfile=pylintrc openedx_webhooks tests bin setup.py
-pylint --rcfile=pylintrc openedx_webhooks tests setup.py

TYPEABLE = openedx_webhooks tests
mypy: ## Run mypy to check type annotations
Expand Down
46 changes: 0 additions & 46 deletions bin/get_task_result_errors.py

This file was deleted.

11 changes: 1 addition & 10 deletions openedx_webhooks/tasks/pr_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,12 @@

bot_comments: Set[BotComment] = field(default_factory=set)
bot_comments_to_remove: Set[BotComment] = field(default_factory=set)
jira_project: Optional[str] = None
jira_title: Optional[str] = None
jira_description: Optional[str] = None

# The Jira instances we want to have issues on.
jira_nicks: Set[str] = field(default_factory=set)

# The Jira status we want to set on an existing issue. Can be None if we
# don't need to force a new status, but can leave the existing status.
jira_status: Optional[str] = None

# The bot-controlled labels we want to on the pull request.
# See labels.py:CATEGORY_LABELS
github_labels: Set[str] = field(default_factory=set)
Expand Down Expand Up @@ -286,11 +281,7 @@
if not has_signed_agreement:
desired.bot_comments.add(BotComment.NEED_CLA)

if state == "closed":
desired.jira_status = "Rejected"
elif state == "merged":
desired.jira_status = "Merged"
elif state == "reopened":
if state == "reopened":
desired.bot_comments_to_remove.add(BotComment.SURVEY)

if state in ["closed", "merged"]:
Expand Down Expand Up @@ -343,7 +334,7 @@
"""
try:
yield
except Exception as exc: # pylint: disable=broad-exception-caught

Check warning on line 337 in openedx_webhooks/tasks/pr_tracking.py

View check run for this annotation

Codecov / codecov/patch

openedx_webhooks/tasks/pr_tracking.py#L337

Added line #L337 was not covered by tests
self.exceptions.append(exc)

def fix(self) -> None:
Expand Down
1 change: 0 additions & 1 deletion tests/test_pull_request_opened.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
)
from openedx_webhooks import settings
from openedx_webhooks.gh_projects import pull_request_projects
from openedx_webhooks.info import get_jira_server_info
from openedx_webhooks.tasks.github import pull_request_changed

from .helpers import check_issue_link_in_markdown
Expand Down
Loading