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

Extract init-script contents out of 'develocity-gradle.yml' #40

Merged
merged 4 commits into from
May 14, 2024

Conversation

bigdaz
Copy link
Member

@bigdaz bigdaz commented May 13, 2024

Previously, init-script content was inlined directly into 'develocity-gradle.yml'

To facilitate sharing and ease maintenance, these contents have been extracted into separate files.

  • Raw init-script content in src/gradle/init-scripts
  • Template for yml file in `src/gradle/develocity-gradle.template.yml'
  • Build script to regenerate final yml is build.sh
  • The build-verification workflow verifies that the develocity-gradle.yml file in the repo is up-to-date with respect to source inputs

bigdaz added 3 commits May 13, 2024 09:37
To make it easier to maintain, the develocity-gradle.yml file is now constructed
out of a template and 2 init-scripts, which are inlined in the output result.

Added a top-level 'build' script which composes the final output from the constituents.
To make these easier to maintain, indentation is now added by the build process.
Copy link
Member

@alextu alextu left a comment

Choose a reason for hiding this comment

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

Nice ! So if understood correctly, the dev flow should look like this:

  • make change to an init script locally
  • run build.sh locally
  • push
  • the workflow will run build.sh as well, compare the commited develocity-gradle.yml with the generated one and fail if different (right ?)

build.sh Outdated Show resolved Hide resolved
@bigdaz
Copy link
Member Author

bigdaz commented May 14, 2024

Nice ! So if understood correctly, the dev flow should look like this:

  • make change to an init script locally
  • run build.sh locally
  • push
  • the workflow will run build.sh as well, compare the commited develocity-gradle.yml with the generated one and fail if different (right ?)

Yes, this is what I've implemented. It requires a manual process to update develocity-gradle.yml, with a workflow that will ensure this has been done. Since we don't expect frequent updates to the reference init-script, this seemed suitable.

Another option is to have a workflow that runs build.sh and auto-commits any change. We do this now in gradle/actions to generate the output, but it has some drawbacks:

  • Tests would need to be updated so that we run build.sh locally before testing: otherwise for any PRs you could be testing the old develocity-gradle.yml file.
  • It's not possible to trigger another workflow from an auto-generated commit

Co-authored-by: Alexis Tual <[email protected]>
Signed-off-by: Daz DeBoer <[email protected]>
@alextu
Copy link
Member

alextu commented May 14, 2024

Nice ! So if understood correctly, the dev flow should look like this:

  • make change to an init script locally
  • run build.sh locally
  • push
  • the workflow will run build.sh as well, compare the commited develocity-gradle.yml with the generated one and fail if different (right ?)

Yes, this is what I've implemented. It requires a manual process to update develocity-gradle.yml, with a workflow that will ensure this has been done. Since we don't expect frequent updates to the reference init-script, this seemed suitable.

Another option is to have a workflow that runs build.sh and auto-commits any change. We do this now in gradle/actions to generate the output, but it has some drawbacks:

  • Tests would need to be updated so that we run build.sh locally before testing: otherwise for any PRs you could be testing the old develocity-gradle.yml file.
  • It's not possible to trigger another workflow from an auto-generated commit

I think the current "manual" approach is best

@alextu alextu merged commit e5a7007 into gradle:main May 14, 2024
2 of 3 checks passed
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