-
Notifications
You must be signed in to change notification settings - Fork 109
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
Catlin: Report logs back to the PR after execution #758
Catlin: Report logs back to the PR after execution #758
Conversation
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.
also please do tell where to document that github-add-comment task is being used from tektoncd/catalog 😅
- name: GITHUB_TOKEN_SECRET_NAME | ||
value: bot-token-github | ||
- name: GITHUB_TOKEN_SECRET_KEY | ||
value: bot-token |
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.
is there a secret setup which contains the base64
personal access token? If yes, then please help me with the correct values that I can substitute over here 🙂
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.
The values you have in there are already ok
69a03bd
to
4fa3e57
Compare
/hold |
acbc533
to
2cd0cf3
Compare
/hold cancel |
@afrittoli since tektoncd/catalog#664 is now merged, can you please tell where to document that I need this task from upstream catalog and how to move forward with this PR? |
/test .* |
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.
Thank you!
It looks mostly ok, but I think there may be a problem in the script logic.
- name: GITHUB_TOKEN_SECRET_NAME | ||
value: bot-token-github | ||
- name: GITHUB_TOKEN_SECRET_KEY | ||
value: bot-token |
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.
The values you have in there are already ok
# if there is any ERROR or WARN then post the comment else skip | ||
[[ $isWarning -eq 0 ]] && [[ $isError -eq 1 ]] && \ | ||
echo -n "" > $(workspaces.store-changed-files.path)/catlin.txt |
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.
I don't really understand the logic here, perhaps it should be $isError -eq 0
?
BTW, it looks like the post-comment
will be executed regardless, only with an empty comment?
Hopefully the github API is smart enough to not post an empty comment?
A nice solution would be to have a result and use when
to skip the comment if not needed. Unfortunately when
expressions are not available in finally
yet (tektoncd/community#240).
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.
I don't really understand the logic here, perhaps it should be
$isError -eq 0
?
oh yes 😅, it should be $isError -eq 0
. Will fix this 😅
BTW, it looks like the
post-comment
will be executed regardless, only with an empty comment?
Hopefully the github API is smart enough to not post an empty comment?
yeah when there is an empty comment then no comment would be posted on PR
A nice solution would be to have a result and use
when
to skip the comment if not needed. Unfortunatelywhen
expressions are not available infinally
yet (tektoncd/community#240).
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.
btw the following script will produce the output as
Catlin Output
FILE: task/black/0.1/black.yaml
WARN : Step "format-python-code" uses image "$(params.image)" that contains variables; skipping validation
FILE: task/yaml-lint/0.1/yaml-lint.yaml
2cd0cf3
to
92a0609
Compare
As of now catlin is running on PRs of catalog and validate them as per TEP-0003 but there are some warnings which are produced by catlin which maybe left un-noticed by the PR author as catlin check doesn't fails. This PR adds a script which will search whether catlin has produced any warning or error and if found will post the output as comment on the PR. Signed-off-by: vinamra28 <vinjain@redhat.com>
92a0609
to
24e5a21
Compare
/cc @afrittoli |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Changes
As of now catlin is running on PRs of catalog and validate them as per
TEP-0003 but there are some warnings which are produced by catlin which
maybe left un-noticed by the PR author as catlin check doesn't fails.
This PR adds a script which will search whether catlin has produced any
warning or error and if found will post the output as comment on the PR.
/kind feature
Signed-off-by: vinamra28 vinjain@redhat.com
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.