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

feat: Jira v1 to v2 migration #399

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

mpolomdeepsense
Copy link
Contributor

@mpolomdeepsense mpolomdeepsense commented Feb 25, 2025

  • Migrates Jira source from v1 to v2
  • Adds Jira source integration tests
  • Adds Jira source unit tests

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

Copy link
Contributor

@bryan-unstructured bryan-unstructured left a 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"
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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(
Copy link
Contributor

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?

Copy link
Contributor

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*
Copy link
Contributor

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?

@bryan-unstructured
Copy link
Contributor

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" \
Copy link
Contributor

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.

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.

3 participants