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

deployment: fix trailing whitespace errors. #169

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

klihub
Copy link
Collaborator

@klihub klihub commented Oct 23, 2023

  • fix trailing WS errors that slipped through in Helm Chart READMEs

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Copy link
Collaborator

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

It looks good to me but I have a question. I'm totally new to githooks so it might sound stupid what I ask. What's the benefit of having git hook way of running checks to catch trailing whitespaces over having a workflow step that would run a script for that?

Comment on lines 30 to 38
- name: Git-check PR for conflict markers and trailing whitespace errors.
if: ${{ github.event_name == 'pull_request' }}
run: |
git fetch -q origin ${{ github.base_ref }}
if ! git diff-index --check origin/${{ github.base_ref }} --; then
echo "This PR would introduce the above errors."
echo "Please fix them and update the PR."
exit 1
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was first to comment out if we really need L31 (if operator) assuming we run checks only on pull requests. But in the next steps below, I see that we are using this workflow to build the site. Maybe later on we need to seperate site building steps from verification/tests against pull requests.

Copy link
Collaborator Author

@klihub klihub Oct 24, 2023

Choose a reason for hiding this comment

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

I was first to comment out if we really need L31 (if operator) assuming we run checks only on pull requests. But in the next steps below, I see that we are using this workflow to build the site. Maybe later on we need to seperate site building steps from verification/tests against pull requests.

We can do that, but some consideration should be given whether to go with a large number of small workflows, which again tend to waste common shared resources, or larger blocks which can be customized... and ideally are decomposed into smaller reusable 'sub-workflows' as demonstrated by how @marquiz rewrote the CRI Resource Manager workflows using on/workflow_call/inputs and uses tags together with locally maintained common sub-workflows.

@fmuyassarov
Copy link
Collaborator

Also, it would be good to rename the PR title because it is too long and mix of commit titles I think.

@klihub
Copy link
Collaborator Author

klihub commented Oct 24, 2023

It looks good to me but I have a question. I'm totally new to githooks so it might sound stupid what I ask. What's the benefit of having git hook way of running checks to catch trailing whitespaces over having a workflow step that would run a script for that?

The idea is to provide a low barrier for checking things that are either wrong (eg. accidentally committed conflict markers), or undesired and probably caught by reviewers, therefore preventing the PR from getting merged. OR to put in another way, to avoid (mis)using scarce common infra resources (shared github workers) to perform problems that can be trivially detected locally.

This goes in the same bucket as our verify-fmt, verify-godeps, 'docsetc. targets in theMakefilewhich allow you to pre-check locally some of the things our github workflows might be picking on and the idea is that you run them locally before filing a PR. We should probably add a singlepre-pr-checks` target to run all of these, so it'd be easier to remember what to run before a PR.

@klihub
Copy link
Collaborator Author

klihub commented Oct 24, 2023

It looks good to me but I have a question. I'm totally new to githooks so it might sound stupid what I ask. What's the benefit of having git hook way of running checks to catch trailing whitespaces over having a workflow step that would run a script for that?

@fmuyassarov Sorry for the inconvenience but I split out all but the whitespace fixup commit to #171.

@klihub klihub changed the title deployment, .github: fix trailing WS errors, add workflow to reject PRs with trailing WS errors. deployment: fix trailing whitespace errors. Oct 24, 2023
Copy link
Collaborator

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thx @klihub
LGTM

@klihub
Copy link
Collaborator Author

klihub commented Oct 24, 2023

Also, it would be good to rename the PR title because it is too long and mix of commit titles I think.

Rewrote the title.

Copy link
Collaborator

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

LGTM

@fmuyassarov fmuyassarov merged commit 5990178 into containers:main Oct 24, 2023
3 checks passed
@klihub klihub deleted the fixes/trailing-ws-errors branch October 24, 2023 07:58
@marquiz marquiz mentioned this pull request Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants