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

Hotfix/v0.7 jira fix #2722

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Hotfix/v0.7 jira fix #2722

merged 1 commit into from
Oct 8, 2024

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Oct 8, 2024

^

Copy link

vercel bot commented Oct 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 6:20pm

@Weves Weves changed the base branch from main to release/v0.7 October 8, 2024 18:20
@Weves Weves merged commit 0e6524d into release/v0.7 Oct 8, 2024
1 of 2 checks passed
@Weves Weves deleted the hotfix/v0.7-jira-fix branch October 8, 2024 18:20
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR implements a hotfix for version 0.7, focusing on the Jira connector and related improvements. Key changes include:

  • Modified Jira connector to handle reserved words in project names by quoting the project name in JQL queries
  • Added a new test file test_jira_basic.py to verify basic Jira connector functionality
  • Introduced delete_single method in VespaIndex class for more efficient single document deletion
  • Updated Redis and Celery configurations to enhance connection reliability and performance
  • Improved log management in supervisord.conf, consolidating logs and introducing environment variable-based configuration
  • Added CELERY_BROKER_POOL_LIMIT environment variable to Docker Compose files for better Celery broker pool control

13 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings

start_ind = 0
while True:
doc_batch, fetched_batch_size = fetch_jira_issues_batch(
jql=f"project = {self.jira_project}",
jql=f"project = {quoted_project}",
Copy link

Choose a reason for hiding this comment

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

style: Use an f-string for consistency with other string formatting in the file

@@ -276,8 +278,10 @@ def poll_source(
"%Y-%m-%d %H:%M"
)

# Quote the project name to handle reserved words
quoted_project = f'"{self.jira_project}"'
Copy link

Choose a reason for hiding this comment

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

style: Duplicate code from line 249. Consider creating a method to quote project names

Comment on lines +284 to 286
f"project = {quoted_project} AND "
f"updated >= '{start_date_str}' AND "
f"updated <= '{end_date_str}'"
Copy link

Choose a reason for hiding this comment

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

style: Use triple quotes for multi-line strings to improve readability



def test_jira_connector_basic(jira_connector: JiraConnector) -> None:
doc_batch_generator = jira_connector.poll_source(0, time.time())
Copy link

Choose a reason for hiding this comment

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

style: Using 0 as the start time may not be ideal. Consider using a more recent timestamp to ensure relevant data is fetched.

with pytest.raises(StopIteration):
next(doc_batch_generator)

assert len(doc_batch) == 1
Copy link

Choose a reason for hiding this comment

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

style: Asserting exactly one document may be too rigid. Consider allowing a range of documents or parameterizing this test.

Comment on lines +36 to +39
assert doc.id == "https://danswerai.atlassian.net/browse/AS-2"
assert doc.semantic_identifier == "test123small"
assert doc.source == DocumentSource.JIRA
assert doc.metadata == {"priority": "Medium", "status": "Backlog"}
Copy link

Choose a reason for hiding this comment

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

style: These assertions are tightly coupled to specific Jira issue data. Consider making these checks more flexible or use mock data.


assert len(doc.sections) == 1
section = doc.sections[0]
assert section.text == "example_text\n"
Copy link

Choose a reason for hiding this comment

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

style: The expected text 'example_text\n' is very specific. Consider using a more general assertion or regex pattern.

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