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

add if statement for pr & push event #476

Merged

Conversation

alonyb
Copy link
Contributor

@alonyb alonyb commented Feb 5, 2020

This should fix #462 and #475 (force-pushed cases) logs

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 5, 2020
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 5, 2020
@ahmetb
Copy link
Member

ahmetb commented Feb 5, 2020

Thanks. I am currently -1 for this duplication.
I am ~80% sure there’s a better way to do this, if not, I am questioning capabilities of Github Workflows system. Do you mind asking on their community forums if there’s a way to do this cleanly?

@@ -44,11 +44,23 @@ jobs:
export GOBIN=$HOME/bin
go get sigs.k8s.io/krew/cmd/validate-krew-manifest@${KREW_VERSION}

- name: Validate updated plugin manifests
- name: Validate updated plugin manifests PUSH case
if: github.event_name == 'push'
Copy link
Member

Choose a reason for hiding this comment

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

We need plugin validation to run only in PRs in all honesty.

Once merged, it’s too late to check manifests as we can’t act on it. Am i right @corneliusweig ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I am currently -1 for this duplication.
I am ~80% sure there’s a better way to do this, if not, I am questioning capabilities of Github Workflows system. Do you mind asking on their community forums if there’s a way to do this cleanly?

Sure, that was a quick solution. For those cases. But there are better options.

Copy link
Contributor

@corneliusweig corneliusweig Feb 5, 2020

Choose a reason for hiding this comment

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

I agree. The tests should only run on PR and pushes to pull requests.

The duplication between the steps does not make sense to me. I still don't understand why we don't just do

git diff --name-only --diff-filter=AM origin/master ${{ github.sha }} -- plugins/

This would work fine with force push AND it would always run the checks for everything that is about to be merged into master. Doesn't that sound right?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. And travis was gracious enough to provide the right value as env vars.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. The tests should only run on PR and pushes to pull requests.

The duplication between the steps does not make sense to me. I still don't understand why we don't just do

git diff --name-only --diff-filter=AM origin/master ${{ github.sha }} -- plugins/

This would work fine with force push AND it would always run the checks for everything that is about to be merged into master. Doesn't that sound right?

In PR event it is the better option. But for push event, I needed a hash to compare. Now that it's just PR it's simple.

@ahmetb
Copy link
Member

ahmetb commented Feb 7, 2020

@alonyb can you update with the suggested changes? I think we don't need to build on "push" (I'm assuming it means pushing to master). We still need to rebuild on pushes to PR branches.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 7, 2020
@alonyb
Copy link
Contributor Author

alonyb commented Feb 7, 2020

can you update with the suggested changes? I think we don't need to build on "push" (I'm assuming it means pushing to master). We still need to rebuild on pushes to PR branches.

I just deleted the push event, however, I could only be able to push on the master branch. Or only in PR, depending on what is needed now.

@alonyb alonyb requested a review from ahmetb February 7, 2020 12:48
@ahmetb
Copy link
Member

ahmetb commented Feb 7, 2020

Thanks! Let's give this a shot.
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 7, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, alonyb

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 7, 2020
@k8s-ci-robot k8s-ci-robot merged commit b2d588a into kubernetes-sigs:master Feb 7, 2020
@corneliusweig
Copy link
Contributor

corneliusweig commented Feb 8, 2020

@alonyb Looks like we have a problem, see #485

Screenshot from 2020-02-08 23-19-08

@corneliusweig
Copy link
Contributor

PR #486 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants