github-pr-resource icon indicating copy to clipboard operation
github-pr-resource copied to clipboard

feat: ability to filter on status context existence

Open jmccann opened this issue 4 years ago • 21 comments

Taking a stab at fixing #26, which basically is resulting in commits being missed on check in certain conditions.

The core problem seems to stem from the fact that we are using the commit date to filter out "old" versions. But under certain conditions we may miss some commits on an initial check. Subsequent check will continue to miss the commit as we are now filtering it out based on the date/time of the "latest version".

So instead of using a datetime filter I've added a feature to allow filtering "old commits" based on if they have a status check associated with the SHA. The status check to look for is configured by a new status_check param to the source configuration.

I've been quickly testing this locally and it seems to be working! PR/commit that missed the provided status check are reported on. PR/commit that already have the status check are filtered out.

I left in the commit datetime filtering logic. But if status_check is provided the feature is disabled in favor of using status checks to filter out old commits.

Looking forwards to comments/questions/suggestions!

fixes #26

jmccann avatar Feb 26 '20 18:02 jmccann

We've been using this code for about a month now and it's been working great. Would love some feedback when anyone has time to permit. Thanks!

jmccann avatar Mar 31 '20 13:03 jmccann

@itsdalmo Do you think we can get this merged? I would like to prevent us from needing to fork the resource to be able to get passed this issue.

YorickH avatar Sep 04 '20 10:09 YorickH

@YorickH @jmccann Terribly sorry for the unresponsiveness, if you could resolve the conflicts - I'd love to get this integrated for you guys.

rickardl avatar Oct 20 '20 17:10 rickardl

I can probably get it cleaned up sometime later this week or next week.

jmccann avatar Oct 21 '20 12:10 jmccann

@rickardl I rebased from master and fixed conflicts.

I'll work to update our internal fork and verify it continues to work as expected.

jmccann avatar Oct 27 '20 18:10 jmccann

@rickardl So trying it out and initial look is that it's still working. But I'll do some more verifying.

I did run into an issue of checks taking much longer. I think it's related to #233

jmccann avatar Oct 27 '20 20:10 jmccann

Hello, is there a chance we could have a new release with this fixed?

marcin-lulek-cint avatar Jan 20 '21 16:01 marcin-lulek-cint

Someone fix the conflict, please!!

ngautha1-ford avatar Feb 16 '21 21:02 ngautha1-ford

Working to update with latest code from master now that #233 is hopefully addressed

jmccann avatar Feb 22 '21 13:02 jmccann

@jmccann Excellent, thank you so much for your help.

marcin-lulek-cint avatar Feb 22 '21 13:02 marcin-lulek-cint

Looks like my updates conflict with latest code ... I tried to add them but stuff broke ... need to spend more time on this 😢

jmccann avatar Feb 22 '21 14:02 jmccann

Hi @jmccann, which test is failing for you? I rebased onto master with one conflict, and everything is working for me.

jhosteny avatar Feb 22 '21 14:02 jhosteny

@jhosteny The issue I am having is it's not working as expected when I use it in my test environment. The states filter is not being respected so my code seems to be breaking it. It it returning for all states (or maybe just all PRs). Without my code the states is respected and resource runs quickly and returns what I'd expect. So I'm breaking something now. 😢

Are you using it and it seems to be working as expected? 🤔

jmccann avatar Feb 22 '21 15:02 jmccann

Think I found the issue ... I didn't rebase and tried to patch in manually and undid some other recent changes ... think I'll have this updated soon

jmccann avatar Feb 22 '21 16:02 jmccann

It's looking good so far. 👍

jmccann avatar Feb 22 '21 18:02 jmccann

Been using this for several days now and haven't seen any issues. So it's up to a reviewer now on this getting merged. 😄

jmccann avatar Mar 02 '21 21:03 jmccann

Been using this for several days now and haven't seen any issues. So it's up to a reviewer now on this getting merged. smile

If it helps, we've also been using this in a private build of the resource for months without issue (along with the submodule fix, #200). We definitely have some repositories whose workflow tends to exercise the issue, and this change fixed it.

jhosteny avatar Mar 02 '21 21:03 jhosteny

Hello, any news if this can be merged? I love the resource - it is very useful but we did get hit by that bug multiple times.

marcin-lulek-cint avatar Mar 31 '21 08:03 marcin-lulek-cint

Evening? Is there a chance this PR gets merged? Every week once or twice our team gets hit by the problem of PR's not being picked up.

ergo avatar Apr 27 '21 20:04 ergo

@rickardl any chance this can get integrated into master?

marcin-lulek-cint avatar May 11 '21 13:05 marcin-lulek-cint

Asking for any update if this can be merged.?

ayushsaxena27 avatar Apr 05 '24 10:04 ayushsaxena27