-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: Jira v1 to v2 migration #399
base: main
Are you sure you want to change the base?
Conversation
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.
initial round of review.
Will take a closer look if PR is not merged yet tomorrow.
|
||
def precheck(self) -> None: | ||
try: | ||
client: "Jira" |
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.
just curious what's the purpose of the type hinting here?
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.
Only for developing purposes. The linter doesn't properly recognize the type of the client, thus not giving the hints for methods etc. Do you think it's better to remove it?
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.
if only for developing purposes, I think we should remove them. the type hinting usually exists in function or class declaration.
raise KeyError(f'Response object is missing "{results_key}" key.') | ||
all_results += response[results_key] | ||
else: | ||
raise TypeError( |
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.
just thought for food here, I'm interested to hear others' opinion:
even if 1 out of 10 responses has wrong type, the job would fail. Is it better to still complete the job, and log that 1 invalid response instead of raising exception?
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.
I think a hard fail is fine. We usually build the connectors the best that we can. If the response is something other than a list or dict then we need to understand why and accommodate it.
raise SourceConnectionError(f"Failed to connect to Jira: {e}") | ||
if not permitted: | ||
raise ValueError( | ||
"""The user with the provided *user_email* and the *api_token* |
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.
the error message only mentions api_token, is it possible due to wrong password?
I've completed my review. left a few more comments. |
@@ -64,8 +70,8 @@ PYTHONPATH=${PYTHONPATH:-.} "$RUN_SCRIPT" \ | |||
--output-dir "$OUTPUT_DIR" \ | |||
--verbose \ | |||
--url https://unstructured-jira-connector-test.atlassian.net \ | |||
--user-email "$JIRA_INGEST_USER_EMAIL" \ | |||
--api-token "$JIRA_INGEST_API_TOKEN" \ | |||
--username "$JIRA_INGEST_USER_EMAIL" \ |
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.
switching user_email and api-token to username and password are breaking changes for users. (luckily not for platform since we don't have the connector yet)
What was the reasoning for this? Not that it is a big deal.
Note
Because of failing google-drive e2e test, jira e2e test is not executed. Here's the result of successful Jira e2e test (when google-drive e2e test is disabled): https://github.com/Unstructured-IO/unstructured-ingest/actions/runs/13518362476/job/37771837198?pr=399#step:6:3892