Skip to content

Conversation

michalChrobot
Copy link
Collaborator

@michalChrobot michalChrobot commented Aug 5, 2025

This PR aims to address the issue of "overdoing" the CI tests which due to distribution times often lead to very long wait times.

First thing is that I failed to notice that targets and drafts conditions are configured as separate items in a list (see PR job trigger changes). In our CI, basic triggers in a list are combined with an OR operator, meaning the job will run if any of the conditions are met. This lead to test being executed on draft PRs.

What I'm changing is

  1. Tests will correctly not run on draft PRs and if PR is not targeting one of specified branches
  2. PR trigger tests will execute only if there are changes in package or project. For for example DOCS only changes no tests will run (in the future we can improve that if for example we would have a test that verifies typos etc)

This change should improve our workflow with CI as well as save some resources for others

NOTE THAT
By default the PR trigger it's triggered if

  1. PR targets develop or release branches
  2. PR is not a draft
  3. PR changes files in package or TestProjects folders (doesn't run on for example DOCS only changes)

Note that in other cases you can trigger it by writing a comment /ci ngo in the PR thread (if for example you want to test it on draft PR)

Additional stuff

I also used that occasion to remove disable-burst file. We are not using it and I included more advanced version in #3557 so if we ever need it we can reuse that one. Because of that I will remove it to avoid any confusion

Steps after approval

I will remove the mandatory PR trigger job from branch settings since now it will not always run (eg. only DOCS changes) and would block PRs otherwise

Backports

#3581

Testing & QA

I verified that

  1. PR trigger gets executed correctly when we have package or project changes
  2. I verified that the fact of tests running blocks PR from merging

Documentation

I added explanation in jobs comments

Jira ticket

MTT-12903

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@EmandM EmandM left a comment

Choose a reason for hiding this comment

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

I know I'm a bit late to the conversation, but I think I'd prefer to have everything run by default, and the /ci ignore can ignore all the checks, and then /ci ngo can re-enable the checks. Having to remember to make an extra comment on every PR sounds like it'll frustrate me over time.

@NoelStephensUnity
Copy link
Collaborator

I know I'm a bit late to the conversation, but I think I'd prefer to have everything run by default, and the /ci ignore can ignore all the checks, and then /ci ngo can re-enable the checks. Having to remember to make an extra comment on every PR sounds like it'll frustrate me over time.

@michalChrobot
This is a good point. Can we do this?

@michalChrobot
Copy link
Collaborator Author

hmm, ok, let me see what I can do

@michalChrobot
Copy link
Collaborator Author

FYI I corrected the trigger to run ONLY when package or testproject code gets changed. If we change for example a github action then there is also no reason to run CI tests but PR description (Testing section) should ensure we do some validation on those (which should anyway differ from usual CI run)

@michalChrobot
Copy link
Collaborator Author

michalChrobot commented Sep 1, 2025

At the end I would argue for keeping the comment trigger flow because

  1. It will be the same across packages so unification of the flow
  2. I cannot require "PR trigger" for PRs and then not to run it for some cases since it will block the PR if this check won't run. I would need to either don't require this check to pass (which will mean that people can potentially merge their PRs without all checks being green) or keep with PR trigger flow

What do you think? Maybe we can try with the comments and see how annoying it will be, if it will be too much on annoyance then we can look into disabling the required check @EmandM @NoelStephensUnity

Edit: actually I think (not 100% sure though) that the PR will be blocked from merging if any tests are still running but correct me here

@michalChrobot michalChrobot requested a review from a team as a code owner September 2, 2025 13:35
@michalChrobot
Copy link
Collaborator Author

michalChrobot commented Sep 2, 2025

Ok @EmandM @NoelStephensUnity at the end I had some more difficulty with correctly guarding PR comment triggers (public repo) so since PRs are actually blocked from merging if some tests are running I can be fine with this version being without comment triggers and just automatic as before (so exactly as in @EmandM comment)

In the future let's see but for now I'm ok with just merging this version, let me know (I modified PR description)

Copy link
Collaborator

@EmandM EmandM left a comment

Choose a reason for hiding this comment

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

To clarify, this change will turn the tests on if we comment ci/ n-g-o (without dashes) anywhere in the comments?

@NoelStephensUnity
Copy link
Collaborator

/ci ngo

michalChrobot added a commit that referenced this pull request Sep 3, 2025
… trigger (#3581)

This PR is a backport of
#3580,
see the description there

## Testing & QA
I verified that

1. PR trigger gets executed correctly when we have package or project
changes
2. I verified that the fact of tests running blocks PR from merging

## Documentation
I added explanation in jobs comments

## Jira ticket
MTT-12903

## Backports
This is a backport of
#3580
@michalChrobot
Copy link
Collaborator Author

To clarify, this change will turn the tests on if we comment /ci n-g-o (without dashes) anywhere in the comments?

I believe it should be singular comment like Noel did above but generally /ci will trigger looking for keywords in the comment so it can be that you can have more content in such comment as long as it contains ngo keyword (not 100% sure though, we could validate on the way)

@michalChrobot michalChrobot merged commit 3ef5539 into develop-2.0.0 Sep 3, 2025
30 checks passed
@michalChrobot michalChrobot deleted the conditional-ci-2.x branch September 3, 2025 08:06
@michalChrobot
Copy link
Collaborator Author

@NoelStephensUnity @EmandM
Note that I also removed PR trigger from branch protection rules (requirement for PR to be merged) since if we would have only DOCs changes then no tests would run but PR would be blocked without it

Since PR should be blocked either way if tests are running, it should work correctly but let me know if you will notice some unusual behavior

NoelStephensUnity pushed a commit that referenced this pull request Sep 23, 2025
…m merging when tests are running (#3682)

## Purpose of this PR
This PR aims to address 3 problems that we currently have 

1. Quite often if no checks are required it's easy to undertest a PR
which leads to simple whitespace errors and such. Because of that I
created `pr_minimal_required_checks` which consists of PVP checks and
standard check which I will require on all PRs as minimum
2. Emma noticed that PRs are allowed to be merged when jobs are running
but none yet failed. This is an issue created by
#3580
and the fact that we want to run CI conditionally (for example we don't
want to run it when we only have DOCS changes) so we had to remove PR
trigger as required job in branch protection rules. This creates a
problem that without required check PR is allowed to be merged until a
test fails
3. Another problem that I spotted is that Documentation~ folder is
actually located inside package folder so this check implemented there
won't work correctly either way

The solution that this PR proposes is implementation of 2 independent
checks (triggered by expression trigger) where

1. `pr_minimal_required_checks` will trigger on all PRs targetting
develop or release branches. It consist of simplest PVP and standards
checks
2. `pr_code_changes_checks` will trigger on PRs that are modifying files
under relevant package or project related paths (see expression trigger)

Those jobs WON'T be required by the branch protection rules but I
introduced new GitHub action of Yamato PR Supervisor which WILL be
required and how it works is that it monitors checks running on PRs and
will fail if any of them fails or pass if all checks are green. In this
way we can have a workflow that both runs only necessary tests but also
gates PRs from merging too early.

Note that you can still use `/ci ngo` comment trigger to run the check
on draft branch or branches not targeting develop nor release branches

After this is approved and merged I will add this check as required on
PRs in branch protection rules

### Jira ticket
N/A

## Documentation
Comments were added to the jobs (soon I also plan to create doc
describing our CI practices/learnings)

## Testing & QA (How your changes can be verified during release
Playtest)
I tested scenarios with code changes and without code changes and the
workflow works as expected

## Backports
Will do
michalChrobot added a commit that referenced this pull request Sep 23, 2025
…m merging when tests are running (#3682)

This PR aims to address 3 problems that we currently have

1. Quite often if no checks are required it's easy to undertest a PR
which leads to simple whitespace errors and such. Because of that I
created `pr_minimal_required_checks` which consists of PVP checks and
standard check which I will require on all PRs as minimum
2. Emma noticed that PRs are allowed to be merged when jobs are running
but none yet failed. This is an issue created by
#3580
and the fact that we want to run CI conditionally (for example we don't
want to run it when we only have DOCS changes) so we had to remove PR
trigger as required job in branch protection rules. This creates a
problem that without required check PR is allowed to be merged until a
test fails
3. Another problem that I spotted is that Documentation~ folder is
actually located inside package folder so this check implemented there
won't work correctly either way

The solution that this PR proposes is implementation of 2 independent
checks (triggered by expression trigger) where

1. `pr_minimal_required_checks` will trigger on all PRs targetting
develop or release branches. It consist of simplest PVP and standards
checks
2. `pr_code_changes_checks` will trigger on PRs that are modifying files
under relevant package or project related paths (see expression trigger)

Those jobs WON'T be required by the branch protection rules but I
introduced new GitHub action of Yamato PR Supervisor which WILL be
required and how it works is that it monitors checks running on PRs and
will fail if any of them fails or pass if all checks are green. In this
way we can have a workflow that both runs only necessary tests but also
gates PRs from merging too early.

Note that you can still use `/ci ngo` comment trigger to run the check
on draft branch or branches not targeting develop nor release branches

After this is approved and merged I will add this check as required on
PRs in branch protection rules

N/A

Comments were added to the jobs (soon I also plan to create doc
describing our CI practices/learnings)

Playtest)
I tested scenarios with code changes and without code changes and the
workflow works as expected

Will do
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.

3 participants