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

build: experimental PR speed improvement: filter PR change folder #3477

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

dave-gray101
Copy link
Collaborator

@dave-gray101 dave-gray101 commented Sep 3, 2024

There's no need to run tests or build images when the changes are docs-only or exclusive to the examples/** directories

In particular I expect this to speed up the numerous dependabot PRs to python dependencies down in examples.

Netlify should probably be configured in a similar way, but I am not sure how to do that so one thing at a time.

In the future, it may be possible to take this farther and only run extras tests when grpc / core/backend code changes... but that is also out of scope for now.

…h we run tests and image builds. No need to do so for docs / example only changes

Signed-off-by: Dave Lee <[email protected]>
Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 171c55d
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/66fbb6e747e33c0008a029d5
😎 Deploy Preview https://deploy-preview-3477--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dave-gray101 dave-gray101 enabled auto-merge (squash) September 3, 2024 21:43
@dave-gray101
Copy link
Collaborator Author

dave-gray101 commented Sep 3, 2024

@mudler This one will probably need a manual approval / merge on your part: I think there's github repo-side changes you'll need to make as the project admin to support this - let me know how I can help figure out what we need to allow conditionally-required checks.

I may be wrong here - I'm also seeing some info that indicates a skipped check may automatically count as passed, so I think the true test here is to see what happens upon approval, and then fix or revert quickly based on that result.

It's just somewhat weird to see "14 expected" down there 😆

@mudler
Copy link
Owner

mudler commented Sep 4, 2024

@mudler This one will probably need a manual approval / merge on your part: I think there's github repo-side changes you'll need to make as the project admin to support this - let me know how I can help figure out what we need to allow conditionally-required checks.

I'd really like to move in this direction, however to my knowledge there is no way for GitHub to set 'conditionally' required checks unless I'm missing something.. afaik GitHub just let you select required status checks, and the only way around it would be to mark them to pass as part of the test itself by conditionally returning 'success' even if no real tests are being run; ignoring workflow would impede the PR to be merged as status checks can be just set as 'required'

@dave-gray101
Copy link
Collaborator Author

dave-gray101 commented Sep 4, 2024

Given that this branch is actually reporting green now - I think that my 2nd theory (skipped checks count as passed) may be true.

Do you mind tossing a review on it to see if it just auto-merges? I think that's the best experiment.

image

@dave-gray101
Copy link
Collaborator Author

@mudler I missed this while reading docs yesterday - it's absolutely the case that skipped checks count as passed:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks

Note: A job that is skipped will report its status as "Success". It will not prevent a pull request from merging, even if it is a required check.

mudler
mudler previously approved these changes Sep 10, 2024
Copy link
Owner

@mudler mudler left a comment

Choose a reason for hiding this comment

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

👍 💯

@dave-gray101
Copy link
Collaborator Author

dave-gray101 commented Sep 11, 2024

Interesting. It has not auto-merged.

It seems that based on https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-jobs-in-a-workflow#defining-prerequisite-jobs we'll need to add a "report status" stage at the very end with needs: and if: always().

Given that I'm not sure exactly what you've set up in the project settings, would it be more helpful to "rename" our current checks, and use the existing names for the "required status reporting" stage? Or would you prefer I create simpler "status-check-result" stages for each workflow and leave the existing ones as-is? The latter is probably a bit cleaner and simpler to maintain, but will require some changes on your side to update what checks are and are not required.

@mudler
Copy link
Owner

mudler commented Sep 13, 2024

Interesting. It has not auto-merged.

It seems that based on https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-jobs-in-a-workflow#defining-prerequisite-jobs we'll need to add a "report status" stage at the very end with needs: and if: always().

huh, that's very annoying :( also because if we start to do changes in the workflow we have to keep an eye on updating that step, that's really annoying that GHA doesn't have native support for such a common problem.

Given that I'm not sure exactly what you've set up in the project settings, would it be more helpful to "rename" our current checks, and use the existing names for the "required status reporting" stage? Or would you prefer I create simpler "status-check-result" stages for each workflow and leave the existing ones as-is?

The latter is probably a bit cleaner and simpler to maintain, but will require some changes on your side to update what checks are and are not required.

No problem with that 👍 we can force merge at that point and I'll update the settings

@dave-gray101
Copy link
Collaborator Author

Looks like another draft is in order. I'll update this soon.

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.

2 participants