-
Notifications
You must be signed in to change notification settings - Fork 96
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
chore: exclude version.yaml from functional tests #6975
Conversation
d7d15b7
to
f28c39d
Compare
Hi @lechnerc77 - thanks for trying to address this. I'm wondering if this is going to have the desired effect. There are two "check runs" associated with functional tests for each PR:
The latter one of these ( This is relevant because after your fix We can't allow contributors to directly run I am admittedly not an expert on this and so I don't know what the solution is, I just know all of the things we've tried that don't work. GitHub doesn't have great features for projects that both require access to credentials to run tests, and support a wide group of untrusted contributes. |
@rynowak Thanks for the aditional input. I missed that the functional tests step is a required step. A bit of a more sophisticated solution is needed then - I will work on it and update this PR accordingly so that the current flow is not interrupted but the functional tests are not executed if the only updated file in the PR is the |
@lechnerc77 thanks for looking into. Just be forewarned that the solution might be more complicated than is worth pursuing. I'm not sure the 'good first issue' is right for this issue. We have a use Actions in a pretty complex way to be able to run the functional tests without risk of exposing our credentials to malicious actors. Unfortunately we haven't found a way to simplify this. |
Rewriting of GH Actions for functional tests based on feedback by @rynowak . The changes reflect the main point that the functional tests workflow is a required workflow (branch protection rule) but also is skipped in case that only the functional-tests-approval.yamlThe workflow contains a second job that:
After the analysis of the changes in the PR the job creates a new dispatch event of type Open question: to create the event a GH token with the scope repository is required. I used the functional-test.yamlI made the following:
In addition, the following cleanup happened:
|
@lechnerc77 - sorry for the delay in getting to this, I was traveling for work. @vinayada1 - can you take a look at this? |
@lechnerc77 - Thanks for your contribution. I am wondering if there is a simpler approach to this. Your current approach seems to add a lot of trigger checks in the workflow which might be a bit hard to maintain if we want to make changes in the future. I was thinking that one way to simplify this would be that:-
I came across this article that follows this approach: https://codersee.com/how-to-pass-data-between-workflows-in-github-actions/ Let me know your thoughts. Like Ryan mentioned, we are no experts on this! |
@vinayada1 thanks for your feedback. Your workflows and their interplay are indeed already quite sophisticated (and show some points GitHub might need to address as features or in best practices). Concerning the passing of data between the workflows: in general, you have two options:
Both things have their advantages and their tradeoffs. I prefer option 2 when it comes to scenarios like the one, we have here, namely a chaining of workflows with a very limited amount of data that needs to be transferred. I do not think that the complexity will be decrease with either option because the chaining of workflows and the propagation of data makes things complex, but you need this setup as far as I have seen. Long story short: I personally would use custom events with the corresponding event payload in scenarios like the one we have here. I would also pass the PR number as payload and not as an uploaded artifact. But (and this is a big but) I am not maintainer of the repository, so the decision should be based on what you feel most comfortable with as maintainer team. So just let me know in which direction the fix should go. |
Thanks for your inputs and comparing the two options clearly. I was trying to see if we can simplify this further. Let's continue discussion on the approach first and agree upon one before you proceed to make code changes for it. Another way to do this could be:-
Also, this is another way to get the number of changed files:
What are your thoughts on this? |
here some comments on the flow: ad 1: This works, but as you said, we then need an additional workflow to handle. ad 2: Second workflow would need to be implemented like you describe:
General questions:
Overall, I would say that is a valid solution. I think the advantage is that the single workflows stay simple (or at least do not get more complex), the downside is that the connection between the workflows is not fully transparent for a new contributor. As written above, I think this requirement isn’t an easy one, so the solution will be complex, the question is which is the tradeoff that you want to choose. |
@lechnerc77 - Thanks for the detailed analysis.
Let me know if this clarifies things for you to move ahead. |
@vinayada1 Thanks for the answers and the clarification with the team. I know what to do now and I will adjust this PR accordingly. Might take a bit, so the updated PR will probably be available next week |
Thanks. I have also created actions/starter-workflows#2283 to request the github feature. |
Signed-off-by: Christian Lechner <[email protected]>
d7eea07
to
096cf1f
Compare
Signed-off-by: Christian Lechner <[email protected]>
abc2c78
to
4795408
Compare
@vinayada1 I changed the setup as discussed. However, I cannot really test it in a simplified setup and I do not have experience with the If not I would close the PR tbh, as reproducing the setup outside of the repo is (at least from my perspective) not straightforward for an external contributor. |
Thanks for making these changes. I agree that it is not very easy to test these changes on your own. As you suggested, I will close this PR for now and use this code to test with my private repo. I will cc you on the new PR that I create. |
@vinayada1 Makes perfect sense. Very interested to see how the solution looks like in the end! |
Description
This PR contains a proposal on how to avoid unecessary runs of the functional tests if the
versions.yaml
is updated.Due to the triggers of the functional tests an exclusion of this file is possible if it is triggered by the completion of the workflow
Approve Functional Tests
. The exclusion of the file path is therefore implemented in the workflow definitionfunctional-tests-approval.yaml
.The regular scheduling of the functional tests as well as the external trigger are not impacted by the change
Type of change
Fixes: #6261
Auto-generated summary
copilot:all