Skip to content

Add type hints to Jira plugin - #441

Merged
sandrobonazzola merged 1 commit into
psss:mainfrom
sandrobonazzola:jira_types
Nov 19, 2025
Merged

Add type hints to Jira plugin#441
sandrobonazzola merged 1 commit into
psss:mainfrom
sandrobonazzola:jira_types

Conversation

@sandrobonazzola

Copy link
Copy Markdown
Collaborator

This commit adds comprehensive type annotations to the Jira plugin to improve code maintainability and enable better static type checking.

Key changes:

  • Add type hints to all methods, parameters, and return types
  • Rename JiraStats class to JiraStatsGroup to avoid naming conflict
  • Introduce new JiraStats base class for all Jira stat classes
  • Change TIMEOUT constant from int to float (60.0)
  • Improve error handling:
    • Add connection aborted retry logic with 10s sleep
    • Handle 401 errors with session renewal
    • Change rate limit log messages from warning to debug level
  • Add type annotations to all test functions
  • Update test imports to use JiraStatsGroup

This refactoring maintains backward compatibility while improving code quality and type safety.

@sandrobonazzola
sandrobonazzola requested review from kwk and psss and removed request for kwk November 18, 2025 10:23
@sandrobonazzola sandrobonazzola self-assigned this Nov 18, 2025
Comment thread did/plugins/jira.py
Comment thread did/plugins/jira.py Outdated
Comment thread did/plugins/jira.py
This commit adds comprehensive type annotations to the Jira plugin
to improve code maintainability and enable better static type checking.

Key changes:
- Add type hints to all methods, parameters, and return types
- Rename JiraStats class to JiraStatsGroup to avoid naming conflict
- Introduce new JiraStats base class for all Jira stat classes
- Change TIMEOUT constant from int to float (60.0)
- Improve error handling:
  - Add connection aborted retry logic with 10s sleep
  - Handle 401 errors with session renewal
  - Change rate limit log messages from warning to debug level
- Add type annotations to all test functions
- Update test imports to use JiraStatsGroup

This refactoring maintains backward compatibility while improving
code quality and type safety.
Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
@sandrobonazzola
sandrobonazzola merged commit c5e7a3e into psss:main Nov 19, 2025
15 checks passed
@sandrobonazzola
sandrobonazzola deleted the jira_types branch November 19, 2025 15:40
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.

2 participants