Skip to content

Skip ci build on documentation changes #4099

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

Merged

Conversation

StephenFlavin
Copy link
Contributor

@StephenFlavin StephenFlavin commented Jun 13, 2023

Motivation and Context

Changes that only include documentation or scripts shouldn't cause/require a code build
e.g. allcontributors pulls only modify .all-contributorsrc and README.md

Modifications

Configures paths-ignore in .github/workflows/codebuild-ci.yml to skip useless builds

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@StephenFlavin StephenFlavin requested a review from a team as a code owner June 13, 2023 13:17
@StephenFlavin StephenFlavin force-pushed the skip-ci-build-for-documentation-changes branch from 0b38fd0 to 8d54cff Compare June 13, 2023 13:37
@StephenFlavin StephenFlavin changed the title Skip ci build on documentation changes Skip ci build on documentation and scripts changes Jun 13, 2023
@debora-ito debora-ito added the needs-review This issue or PR needs review from the team. label Jun 13, 2023
@debora-ito
Copy link
Member

Successful builds are required for the merge, so I don't think we can skip the build even in those cases.
The change is just to skip the builds, right? What happens if the builds are required?

@StephenFlavin StephenFlavin force-pushed the skip-ci-build-for-documentation-changes branch from 8d54cff to 1acd2d2 Compare June 14, 2023 08:37
@StephenFlavin StephenFlavin force-pushed the skip-ci-build-for-documentation-changes branch from 1acd2d2 to 0b93f82 Compare June 14, 2023 08:41
@StephenFlavin
Copy link
Contributor Author

StephenFlavin commented Jun 14, 2023

Hi @debora-ito,

With this change the builds won't be required just the Code owner review.
Screenshot 2023-06-14 at 09 39 57

Building when these files are edited should be no different than the last master build.
Rational being no code changes should expect no test failures so it's just a waste of time and compute.

I've put together a demo repo with an action that configures

  pull_request:
    paths-ignore:
      - '**.md'
      - '.i-am-a-hidden-file'
      - 'docs/**'

Result:
Screenshot 2023-06-14 at 09 44 24
so the only edit that caused a build wasn't in paths-ignore the ones without still need approval before merging.

@StephenFlavin StephenFlavin changed the title Skip ci build on documentation and scripts changes Skip ci build on documentation changes Jun 14, 2023
@StephenFlavin
Copy link
Contributor Author

StephenFlavin commented Jun 14, 2023

p.s. I removed scripts/** from the PR because there could be scripts used to run builds like https://github.com/aws/aws-sdk-java-v2/blob/master/scripts/run-integ-test

@StephenFlavin
Copy link
Contributor Author

StephenFlavin commented Jun 14, 2023

I haven't added a changelog entry as it's not really any of feature, bugfix, deprecation, removal, documentation
more of a 🚧 "maintenance" 🚧 change

@debora-ito debora-ito removed the needs-review This issue or PR needs review from the team. label Jul 12, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@cenedhryn cenedhryn merged commit db68a5c into aws:master Jul 17, 2023
L-Applin pushed a commit that referenced this pull request Jul 24, 2023
@debora-ito
Copy link
Member

@StephenFlavin just a quick update: looks like it didn't work, successful codebuilds are still required - example: #4276

Maybe there's some sort of precedence in the rules? Let me know if you have any thoughts.

@StephenFlavin
Copy link
Contributor Author

StephenFlavin commented Aug 11, 2023

Hi Debora,
Yeah I'm not sure, afaict it should be skipped.
One thing I don't understand is if you look at the build for this pr there seems to be two sets of runners, the native GitHub ones and special Amazon ones
Screenshot_20230811-223147
Could this be something in a PR template or something?

@StephenFlavin
Copy link
Contributor Author

It's possible that it's a branch protection rule from doing some reading but only repo admins will have access to check

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