KubeArmor icon indicating copy to clipboard operation
KubeArmor copied to clipboard

Add Github action to check if each commit is compiling

Open h3llix opened this issue 3 years ago • 8 comments

Feature Request

A PR could be made up of multiple commits. We expect every commit to be self-sufficient i.e., solves a problem and is compilable/testable/revertable. We want the ability to check/ensure that every commit within a PR is compilable (and later testable). This way if needed we can revert individual commits. Further we want the ability to handle git-bisect to figure out which commit might have broken the tests.

Thus the requirement is that if a PR contains multiple commits, the make has to be done at every individual commit level.

@Ankurk99 had handled the same for cilium repo in https://github.com/cilium/cilium/pull/15659 (for ref). (We already have PR-level make and tests for Kubearmor)

Tasks

  • [ ] Compile/handle ci-go workflow for every commit
  • [ ] Handle basic tests for every commit (We can discuss what basic tests would mean here)

Here is the reference GH workflow from cilium.

h3llix avatar Feb 11 '22 05:02 h3llix

Hey @h3llix, I'd like to proceed with working on this issue. Thanks!

zeborg avatar Feb 12 '22 15:02 zeborg

  • [ ] Handle basic tests for every commit (We can discuss what basic tests would mean here)

Hey @nyrahul, I'd like to know about the tests that we're supposed to handle within the CI.

zeborg avatar Feb 13 '22 07:02 zeborg

@h3llix we already check if the new code is compilable during ci-test. can you check if the ci-test contains what you think?

nam-jaehyun avatar Feb 13 '22 10:02 nam-jaehyun

@nam-jaehyun https://github.com/kubearmor/KubeArmor/blob/main/tests/test-scenarios-github.sh#L155 We run the test here. But I don't think we run and test it for individual commits.

h3llix avatar Feb 13 '22 10:02 h3llix

Just curiosity. Does the GitHub Action work per commit? or... Does it work per PR? I mean the point of view of KubeArmor repo (not a personal repo for development)

nam-jaehyun avatar Feb 16 '22 04:02 nam-jaehyun

Just curiosity. Does the GitHub Action work per commit? or... Does it work per PR? I mean the point of view of KubeArmor repo (not a personal repo for development)

The GH action is fired at PR level push event. But inside the event, we can iterate through the commits and build/test for each commit.

nyrahul avatar Feb 16 '22 04:02 nyrahul

i think i have a solution working over here could someone make a PR and try it out?

s1ntaxe770r avatar Jul 10 '22 00:07 s1ntaxe770r

Hey there! I'd like to take up this issue since it's unassigned

AllMight2099 avatar Aug 12 '22 13:08 AllMight2099