-
Notifications
You must be signed in to change notification settings - Fork 352
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
fix(ci): whitenoise lint failed when pull request #1904
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1904 +/- ##
==========================================
- Coverage 64.59% 64.35% -0.24%
==========================================
Files 112 109 -3
Lines 16072 15302 -770
==========================================
- Hits 10382 9848 -534
+ Misses 5038 4845 -193
+ Partials 652 609 -43 ☔ View full report in Codecov by Sentry. |
Hi, @Xunzhuo. I've identified the issue. In the github pull request CI environment, there is no branch information available, causing the git diff command to fail. Therefore, I added a git fetch command to retrieve the remote branch information and prefixed the branch names with "origin" to match them. Here is my debug info for reference. https://github.com/zaunist/gateway/actions/runs/6262614026/job/17005194717 |
/retest |
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions! |
@zaunist DCO is failing, can you squash, sign and push again ? |
Done |
DCO is still failing, you might need to squash commits and then resign and push |
@@ -1,7 +1,8 @@ | |||
#!/bin/bash | |||
TRAILING_WHITESPACE=0 | |||
# only check changed docs in pr | |||
for file in $(git diff --cached --name-only --diff-filter=ACRMTU $GITHUB_BASE_REF | grep "\.md"); do | |||
git fetch | |||
for file in $(git diff --cached --name-only --diff-filter=ACRMTU origin/$GITHUB_BASE_REF| grep "\.md"); do |
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.
thinking out loud, why isn't git diff --name-only
good enough 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 issue here is that the GitHub Actions environment does not have the branch information for Git, which causes an error when using git diff
to compare the differences. To resolve this, I simply added a git fetch
command to retrieve the branch information from the remote repository. For further debugging information, you can refer to this link: https://github.com/zaunist/gateway/actions/runs/6262614026/job/17005194717.
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.
@zaunist im suggesting removing the older command and replacing with something simpler git diff --name-only
which doesnt require branch info, do you see any issue with this approach ?
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.
@arkodg If we don't provide branch information, how can we compare the differences between the fork and main branches? I'm not quite understanding this point. Could you provide an example, please?
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 am OK with current approach, thanks for working on it @zaunist.
Actually I think this one is not that high priority, if you would like to help, we can try to pick some important issues for you : )
Willing to make more contributions |
What type of PR is this?
Fix whitenoise lint error
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes 523