-
Notifications
You must be signed in to change notification settings - Fork 731
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
Enhance Linter Github Actions Reporting #4864
Conversation
Ktlint Results👍 ✅ 👍 |
b39e9b0
to
6b85110
Compare
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.
Nice work, thanks! A few little remarks
.github/workflows/quality.yml
Outdated
else | ||
body="\`👎 ❌ 👎 ${results}\`" | ||
fi | ||
body="${body//'%'/'%25'}" |
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 would apply all the treatment you are doing on the else
block above and on the results
var, before affecting the value prefixed with emojis to body
.
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.
Yes I agree, it's really sensitive, if it can support multiple commands inside the else block I will change it
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 see, thanks
.github/workflows/quality.yml
Outdated
if [ -z "$results" ]; then | ||
body="👍 ✅ 👍" | ||
else | ||
body="\`👎 ❌ 👎 ${results}\`" |
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.
Small remark, the Emojis could be outside of the "`", no?
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.
Sure it would, however if you observe commenting with that lib do not support \n
so I had to manually create the new lines by replacing via bash the aggregated results with <br>
. But then I realised that code blocks do not support
new lines! 😵💫 So to support newlines along with code blocks I added multiple code blocks
around <br>
. So there should be an init left_code_block
in order to work.
It was the tricky to support newlines with codeblocks without the lib supporting it
The best I can do is (that seems pretty nice):
👎 ❌ 👎Failed
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.
Ah, thanks for the explaination.
Maybe do not add Emoji there but use the reactions
, different depending on the result?
Anyway this is fine like this.
comment-author: 'github-actions[bot]' | ||
body-includes: Ktlint Results | ||
- name: Publish ktlint results to PR | ||
if: always() |
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.
OOI, is there a necessity to add this line?
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.
Yes it is an important line, while when ktlint
fails thats when we should publish the results, also that was the fix for the artifacts. The problem was that the jobs was killed so nothing happened after that
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.
Ok, understood, thanks!
.github/workflows/quality.yml
Outdated
|
||
# Lint for main module and all the other modules | ||
${{ steps.get-comment-body.outputs.body }} | ||
reactions: rocket |
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 do not see the added value to automatically add a reaction to the generated comment (except that it is nice to know that it is possible to do so)
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.
haha yes I just wanted to test it, I will remove it
- Publish results on PR via commenting - Support for all modules along with tests - Code format & emoticons
aad7dff
to
33a4eac
Compare
awesome change! 💯 would love to see a v2 that has url clickthroughs for the failing lines 🤩 |
@@ -74,7 +118,6 @@ jobs: | |||
run: ./gradlew clean lint${{ matrix.target }}Release --stacktrace | |||
- name: Upload ${{ matrix.target }} linting report | |||
uses: actions/upload-artifact@v2 | |||
if: always() |
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.
Just a last remark, will the lint report be uplodoad if the command fails (so if there are lint issue) if you remove this line?
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.
(related to your comment https://github.com/vector-im/element-android/pull/4864/files#r779175980)
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.
Edit:
Here is a different case than before because the way command ./gradlew clean lint
run needs to be succeed in order to generate the report! So there is no need to upload an artifact without the report. In comparison to ktlint
that the report is generated when the build fails. Is it clear now?
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.
Yes, thanks!
Improve Github Actions Linter reports: