-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Use REST API to get comments #467
base: master
Are you sure you want to change the base?
Conversation
python/publish/publisher.py
Outdated
from copy import deepcopy | ||
|
||
from github import Github, GithubException, UnknownObjectException | ||
from github.CheckRun import CheckRun | ||
from github.CheckRunAnnotation import CheckRunAnnotation | ||
from github.PullRequest import PullRequest | ||
from github.PullRequestComment import PullRequestComment | ||
from github.IssueComment import IssueComment |
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.
F401: 'github.IssueComment.IssueComment' imported but unused
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
python/publish/publisher.py
Outdated
@@ -654,7 +655,7 @@ def do_stats_require_comment(earlier_stats_require: Optional[bool], stats_requir | |||
|
|||
return False | |||
|
|||
def get_latest_comment(self, pull: PullRequest) -> Optional[IssueComment]: | |||
def get_latest_comment(self, pull: PullRequest) -> Optional[PullRequestComment]: |
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.
E501: line too long (84 > 79 characters)
❗❗ 2 similar findings have been found in this PR
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
python/publish/publisher.py | 706 |
python/publish/publisher.py | 718 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
python/publish/publisher.py
Outdated
from copy import deepcopy | ||
|
||
from github import Github, GithubException, UnknownObjectException | ||
from github.CheckRun import CheckRun | ||
from github.CheckRunAnnotation import CheckRunAnnotation | ||
from github.PullRequest import PullRequest | ||
from github.PullRequestComment import PullRequestComment |
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.
E0401: Unable to import 'github.PullRequestComment'
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
python/publish/publisher.py
Outdated
from copy import deepcopy | ||
|
||
from github import Github, GithubException, UnknownObjectException | ||
from github.CheckRun import CheckRun | ||
from github.CheckRunAnnotation import CheckRunAnnotation | ||
from github.PullRequest import PullRequest | ||
from github.PullRequestComment import PullRequestComment |
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.
reportMissingImports: Import "github.PullRequestComment" could not be resolved
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
python/publish/publisher.py
Outdated
from copy import deepcopy | ||
|
||
from github import Github, GithubException, UnknownObjectException | ||
from github.CheckRun import CheckRun | ||
from github.CheckRunAnnotation import CheckRunAnnotation | ||
from github.PullRequest import PullRequest | ||
from github.PullRequestComment import PullRequestComment | ||
from github.IssueComment import IssueComment |
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.
vulture-90: unused import 'IssueComment'
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
f57f7cd
to
0bd569b
Compare
Test Results (reference) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
♻️ This comment has been updated with latest results. |
0bd569b
to
d7d5f87
Compare
Test Results (macOS python 3.8) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Linux python 3.8) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (macOS python installed) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (macOS 11 python installed) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Linux python installed) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Linux 20.04 python installed) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Windows python installed) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Windows 2019 python installed) 87 files ± 0 87 suites ±0 35m 30s ⏱️ +29s Results for commit d7d5f87. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
d7d5f87
to
dca99f4
Compare
Blocked on next release of PyGithub, remove link to master branch from |
Dockerfile
Outdated
@@ -12,10 +12,10 @@ LABEL com.github.actions.color="green" | |||
RUN apk add --no-cache --upgrade expat libuuid | |||
|
|||
COPY python/requirements.txt /action/ | |||
RUN apk add --no-cache build-base libffi-dev; \ | |||
RUN apk add --no-cache build-base libffi-dev git; \ |
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.
DL3013: Pin versions in pip. Instead of pip install <package>
use pip install <package>==<version>
or pip install --requirement <requirements file>
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Dockerfile
Outdated
@@ -12,10 +12,10 @@ LABEL com.github.actions.color="green" | |||
RUN apk add --no-cache --upgrade expat libuuid | |||
|
|||
COPY python/requirements.txt /action/ | |||
RUN apk add --no-cache build-base libffi-dev; \ | |||
RUN apk add --no-cache build-base libffi-dev git; \ |
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.
DL3018: Pin versions in apk add. Instead of apk add <package>
use apk add <package>=<version>
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Test Results (macOS python 3.8) 87 files ± 0 87 suites ±0 35m 37s ⏱️ +36s Results for commit dca99f4. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (macOS python installed) 87 files ± 0 87 suites ±0 35m 37s ⏱️ +36s Results for commit dca99f4. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (macOS 11 python installed) 87 files ± 0 87 suites ±0 35m 37s ⏱️ +36s Results for commit dca99f4. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Test Files) 145 files ±0 13 errors 735 suites ±0 2h 12m 37s ⏱️ ±0s For more details on these parsing errors, failures and errors, see this check. Results for commit dca99f4. ± Comparison against base commit afcff83. |
comments = list(pull.get_comments(sort="updated_at", direction="asc")) | ||
else: | ||
comments = list(pull.get_comments()) | ||
logger.debug(f'Found {len(comments)} comments for pull request {pull.number}') |
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.
E501: line too long (86 > 79 characters)
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Test Results (macOS python installed) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (macOS 11 python installed) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Test Files) 145 files ±0 13 errors 735 suites ±0 2h 12m 37s ⏱️ ±0s For more details on these parsing errors, failures and errors, see this check. Results for commit d480e2a. ± Comparison against base commit afcff83. |
Test Results (Dockerfile) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (macOS python 3.8) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Linux python installed) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Docker Image) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Linux python 3.8) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Windows 2019 python installed) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Linux 20.04 python installed) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Test Results (Windows python installed) 87 files ± 0 87 suites ±0 34m 37s ⏱️ -24s Results for commit d480e2a. ± Comparison against base commit afcff83. This pull request removes 1 test.
|
Note: fetches all comments as it cannot sort by updated, requires adding test for |
comment_id = comments[-1].get("databaseId") | ||
return pull.get_issue_comment(comment_id) | ||
# return latest action comment | ||
return sorted(comments, key=lambda comment: comment.updated_at, reverse=True)[-1] |
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.
E501: line too long (89 > 79 characters)
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
.get('pullRequest', {}) \ | ||
.get('comments', {}) \ | ||
.get('nodes') | ||
def get_pull_request_comments(self, pull: PullRequest) -> List[IssueComment]: |
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.
E501: line too long (81 > 79 characters)
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Test Results (macOS python 3.8) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (macOS 11 python installed) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (macOS python installed) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Test Files) 145 files ±0 13 errors 735 suites ±0 2h 12m 37s ⏱️ ±0s For more details on these parsing errors, failures and errors, see this check. Results for commit 1549e51. ± Comparison against base commit afcff83. |
Test Results (Dockerfile) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Docker Image) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Linux python 3.8) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Linux 20.04 python installed) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Linux python installed) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Windows python installed) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
Test Results (Windows 2019 python installed) 87 files ± 0 87 suites ±0 36m 40s ⏱️ + 1m 39s Results for commit 1549e51. ± Comparison against base commit afcff83. This pull request removes 2 tests.
|
This removes the use of the GraphQL API to get comments. Minimized information are not used any more.