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

Ref: Skip CI for commits without code changes #3545

Merged
merged 78 commits into from Feb 14, 2024
Merged

Conversation

lucas-zimerman
Copy link
Collaborator

@lucas-zimerman lucas-zimerman commented Jan 23, 2024

#3419

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Goal is to make CI faster when a PR only alters files such as changelog, readme,...
This was done with a reusable job that allows different group of jobs to know if they need to run or not.

💡 Motivation and Context

It frees resources to Sentry (mostly the Mac Virtual machines) when small changes are made and also allow tests to pass faster when code-less changes are made.

💚 How did you test it?

The last PRs have a comment TEST:... that checks specific scenarios, for example, only changing the changelog to not trigger the build to run, altering some source file to check if the build and tests will run, breaking the Branch check (worst case) to validate that even if the job fails, the remain jobs will continue working.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes (no permanent tests but tested by simulating commits to test specific cases)
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • All tests passing
  • No breaking changes

🔮 Next steps

#skip-changelog

Copy link
Contributor

github-actions bot commented Jan 31, 2024

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 377.33 ms 440.94 ms 63.61 ms
Size 7.15 MiB 8.18 MiB 1.03 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
abb7058+dirty 320.78 ms 324.08 ms 3.30 ms
8900e1a+dirty 371.40 ms 377.70 ms 6.31 ms
e5c9b8b+dirty 335.40 ms 360.06 ms 24.67 ms
575f9da+dirty 337.15 ms 370.47 ms 33.32 ms
e73f4ed+dirty 262.98 ms 311.02 ms 48.04 ms
acadc0f+dirty 259.04 ms 304.67 ms 45.63 ms
dadc233+dirty 363.19 ms 370.37 ms 7.18 ms
34aba08+dirty 331.79 ms 376.69 ms 44.91 ms
12427f4+dirty 379.48 ms 400.92 ms 21.44 ms
457e29f+dirty 591.49 ms 612.96 ms 21.47 ms

App size

Revision Plain With Sentry Diff
abb7058+dirty 7.15 MiB 8.10 MiB 980.40 KiB
8900e1a+dirty 7.15 MiB 8.03 MiB 901.79 KiB
e5c9b8b+dirty 7.15 MiB 8.10 MiB 980.41 KiB
575f9da+dirty 7.15 MiB 8.10 MiB 979.68 KiB
e73f4ed+dirty 7.15 MiB 8.09 MiB 965.94 KiB
acadc0f+dirty 7.15 MiB 8.03 MiB 903.20 KiB
dadc233+dirty 7.15 MiB 8.04 MiB 910.84 KiB
34aba08+dirty 7.15 MiB 8.07 MiB 946.13 KiB
12427f4+dirty 7.15 MiB 8.12 MiB 997.78 KiB
457e29f+dirty 7.15 MiB 8.10 MiB 981.29 KiB

@lucas-zimerman
Copy link
Collaborator Author

Possible I've missed some benefits of the job, but could we use https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore?

Yeah we can, the idea was to reuse the list across the jobs, instead of having to place it on each workflow/trigger

we can place the following snippet on each file, but it seems like the build and test jobs are stucked forever, despite falling on Tte path-ignore list ( could be a github bug)

    paths-ignore:
      - '.prettierignore'
      - 'CHANGELOG.md'
      - 'README.md'
      - '.github/CODEOWNERS'
      - '.github/pull_request_template.md'
      - '.github/ISSUE_TEMPLATE/BUG_REPORT.md'
      - '.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md'

But the main difference is with paths ignore we'll have to place this snippet on each workflow and the end result will look like this
image
Where with the reusable workflow, we'll have to add an additional job to run it but the end result will not hide the jobs but mark as skipped.
image

For the time being, I applied the requested change, too bad github doesn't have more reusable options for this use case.

@krystofwoldrich
Copy link
Member

@lucas-zimerman Looks good, thank you for all the tests and screenshots.

I will check with @kahest the required jobs settings and then we can merge it.

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

I approve this to see if GH allows the merge or if it will be blocked by the required jobs.

Result the jobs are forever hanging and only auto-merge is enabled. So the PR can't be ever merged.

@krystofwoldrich
Copy link
Member

This can be merged after we remove the required Test and Build jobs.

@krystofwoldrich
Copy link
Member

I reverted the PR back to skip-ci action as it's compatible with the required jobs. The ignore-paths are not working for the repository as they don't allow us to require certain jobs like Test and Build.

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

@krystofwoldrich krystofwoldrich enabled auto-merge (squash) February 14, 2024 13:58
@krystofwoldrich krystofwoldrich merged commit 7194f13 into main Feb 14, 2024
46 of 48 checks passed
@krystofwoldrich krystofwoldrich deleted the ref/skip-ci branch February 14, 2024 13:58
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.

None yet

2 participants