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

Fix the error caused by passing unused context in JiraSensor.poke #23352

Merged
merged 3 commits into from
Jun 20, 2022

Conversation

kianelbo
Copy link
Contributor


This tiny PR attempts to fix the error caused by #23046

(original issue: #22810 )

@@ -60,7 +60,7 @@ def poke(self, context: 'Context') -> Any:
jira_result = getattr(resource, self.method_name)(**self.method_params)
if self.result_processor is None:
return jira_result
return self.result_processor(context, jira_result)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we're not removing context from the poke method signature?

Copy link
Member

Choose a reason for hiding this comment

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

poke on other sensors take context, so this probably should as well.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 17, 2022
@ashb
Copy link
Member

ashb commented Jun 17, 2022

Could you add a test case to prevent future regressions?

@ashb ashb removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 17, 2022
@kianelbo kianelbo force-pushed the fix-jira-sensor-bug branch 2 times, most recently from 188f2a1 to 5c733a8 Compare June 17, 2022 20:10
@kianelbo
Copy link
Contributor Author

Could you add a test case to prevent future regressions?

Good idea! However I couldn't find a neat way to add a new case to the test. Instead, I thought it would be worthwhile to use the original field_checker_func of JiraTicketSensor and have a more realistically mocked ticket object.

@potiuk
Copy link
Member

potiuk commented Jun 19, 2022

Rebased to rebuild. @kianelbo - please ping us if you see it's green or when you fix it, if it is red :).

The sample ticket object used in the test is mocked more realistically and the original field_checker_func is used.
@potiuk potiuk merged commit bbbaad0 into apache:main Jun 20, 2022
@potiuk
Copy link
Member

potiuk commented Jun 20, 2022

Thanks @kianelbo !

@kianelbo kianelbo deleted the fix-jira-sensor-bug branch June 20, 2022 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants