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

OCPERT-56 OAR Fix wrong data types in docstring #462

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ltroiano-rh
Copy link
Contributor

OAR Fix wrong data types in docstring in https://github.com/openshift/release-tests repository.

Details:
OAR tool docstring use wrong data types in docstring. For example [] instead of list.

Update all docstrings in OAR tool to use correct OAR types.

Scope:
OAR tool only.
It is not a goal to provide new docstrings, or add types to actual code.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 11, 2025
@openshift-ci openshift-ci bot requested review from LuboTerifaj and rioliu-rh March 11, 2025 20:26
Copy link

openshift-ci bot commented Mar 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tomasdavidorg for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

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

Hello @ltroiano-rh ,

There is redundant "." in your commit message.

Please rebase your pull-request with master.

Thank you!

@@ -31,7 +31,7 @@ def get_advisories(self):
Get all advisories

Returns:
[]Advisory: all advisory wrappers
List[Advisory] : all advisory wrappers
Copy link
Contributor

Choose a reason for hiding this comment

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

The method returns a different type.

Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify it a little bit. It's not necessary wrong and it is only a documentation, so we potentially could use also the one you used. However, it's better to align the changes with the rest of the file and use standard built-in type.

@@ -51,7 +51,7 @@ def get_jira_issues(self):
Get all jira issues from advisories in a release

Returns:
[]: all jira issues from advisories
List: all jira issues from advisories
Copy link
Contributor

Choose a reason for hiding this comment

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

The method returns a different type.

Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify it a little bit. It's not necessary wrong and it is only a documentation, so we potentially could use also the one you used. However, it's better to align the changes with the rest of the file and use standard built-in type.

@@ -199,7 +199,7 @@ def drop_bugs(self):
AdvisoryException: error when dropping bugs from advisory

Returns:
[]: bugs cannot be dropped
Tuple [list, list]: bugst to be dropped, bugs cannot be dropped
Copy link
Contributor

@LuboTerifaj LuboTerifaj Mar 12, 2025

Choose a reason for hiding this comment

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

The syntax is valid, but we should keep the types consistent across files. It's a good practice to use standard types.
The method returns a different type.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is also a typo at this line.

@@ -252,7 +252,7 @@ def check_cve_tracker_bug(self):
AdvisoryException: error when invoke elliott cmd

Returns:
json: missed CVE tracker bugs
List[str]: missed CVE tracker bugs
Copy link
Contributor

Choose a reason for hiding this comment

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

The method returns a different type.

Copy link
Contributor

Choose a reason for hiding this comment

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

To clarify it a little bit. It's not necessary wrong and it is only a documentation, so we potentially could use also the one you used. However, it's better to align the changes with the rest of the file and use standard built-in type.

oar/core/jira.py Outdated

Returns:
[]JiraIssue: jira subtask list
List [JiraIssue]: jira subtask list
Copy link
Contributor

@LuboTerifaj LuboTerifaj Mar 12, 2025

Choose a reason for hiding this comment

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

The syntax is valid, but we should keep the types consistent across files. It's a good practice to use standard types.
The method returns a different type.

@LuboTerifaj
Copy link
Contributor

@ltroiano-rh one more note, to avoid having the same commit message in git history, use a different commit message. Please keep the jira id in it.

@LuboTerifaj
Copy link
Contributor

This PR follows up #454

@ltroiano-rh ltroiano-rh force-pushed the ltroiano-release-test-changes branch from dbbcd70 to 0600f60 Compare March 14, 2025 07:26
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 14, 2025
Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

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

Hello @ltroiano-rh ,

There are still a few lines that need to be fixed.

The commit messages need to be adjusted. Don't use "Resolving conflicts" in the initial commit message.

Could you please also update pull-request name according to updated commit message?

Thanks!

@@ -31,7 +31,7 @@ def get_advisories(self):
Get all advisories

Returns:
Advisory (list): all advisory wrappers
list: all advisory wrappers
Copy link
Contributor

Choose a reason for hiding this comment

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

Part of the type is missing here.

oar/core/jira.py Outdated
@@ -43,7 +43,7 @@ def get_issue(self, key):
key (str): JIRA issue key

Returns:
JiraIssue: object of JiraIssue
list: object of JiraIssue
Copy link
Contributor

Choose a reason for hiding this comment

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

The method returns a different type.

oar/core/jira.py Outdated

Returns:
JiraIssue (list): jira subtask list
list: jira subtask list
Copy link
Contributor

Choose a reason for hiding this comment

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

Part of the type is missing here.

@ltroiano-rh ltroiano-rh changed the title OCPERT-56. OAR Fix wrong data types in docstring OCPERT-56 OAR Fix wrong data types in docstring Mar 14, 2025
@ltroiano-rh ltroiano-rh force-pushed the ltroiano-release-test-changes branch from 0600f60 to a499cd5 Compare March 14, 2025 16:47
Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

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

Hello @ltroiano-rh ,

please update your commit message. It's a docstring, not a dockstring. Also include more descriptive message that this is actually a followup pull-request. For example: OCPERT-56 OAR Correct wrong data types in docstring

You are also missing the changes you previously made.

Thanks!

@@ -169,13 +169,11 @@ def change_advisory_status(self, target_status=AD_STATUS_REL_PREP):
Change advisories status, e.g. REL_PREP

Args:
status (str, optional): status used to update. Defaults to REL_PREP.
target_status (str, optional): status used to update. Defaults to REL_PREP.

Raises:
AdvisoryException: error when update advisory status

Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant new line here

@LuboTerifaj LuboTerifaj marked this pull request as draft March 14, 2025 17:07
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants