Skip to content

Migrate Gradle samples to use new DV API #1119

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
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Apr 5, 2024

The samples were previously intentionally verbose. Given the new defaults for always publishing scans and always capturing input files, I think that we can simplify the configuration and reduce verbosity. Open to having a discussion about this.

@runningcode runningcode requested review from jprinet and clayburn April 5, 2024 08:45
server = 'https://develocity-samples.gradle.com' // adjust to your Develocity server
allowUntrustedServer = false // ensure a trusted certificate is configured

buildScan {
capture { taskInputFiles = true }
Copy link
Member

Choose a reason for hiding this comment

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

I understand that those flags are not necessary because set to the default value.

Do we want to apply the same rule to allowUntrustedServer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good point. I think the reason behind having allowUntrustedServer here is that it may have been set to true during a trial period and therefore we want to ensure that it is set to false for production. This is a good discussion though, should we be more explicit about the other fields?

Copy link
Member

Choose a reason for hiding this comment

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

I think sharing a streamlined version with only mandatory fields make sense

Copy link
Member

Choose a reason for hiding this comment

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

I think sharing a streamlined version with only mandatory fields make sense

I would agree with making this particular sample streamlined (i.e. don't explicitly declaring defaults). We have other material that can help a user determine whether they need allowUntrustedServer or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So following this logic, we should also remove the buildCache.local.isEnabled=true logic. Do we agree on that?

Copy link
Member

Choose a reason for hiding this comment

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

I would agree with that. I like the idea of this being the minimum viable recommended configuration. The less configuration there is the less chance for mistake.

Copy link
Member

Choose a reason for hiding this comment

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

So following this logic, we should also remove the buildCache.local.isEnabled=true logic. Do we agree on that?

I could go either way. On one hand, removing it does match the criteria we apply to the develocity configuration. On the other hand, I find it somewhat common that users don't understand that org.gradle.caching=true enables the local build cache, so I don't mind leaving it here to be explicit. But then we're not being consistent 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok here's my proposal: let's discuss the buildCache.local.isEnabled=true and allowUntrustedServer = false changes separately and merge this PR as is.

Copy link
Member

@jprinet jprinet left a comment

Choose a reason for hiding this comment

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

LGTM, one minor comment, but the change is ok for me anyway

Copy link
Member

@clayburn clayburn left a comment

Choose a reason for hiding this comment

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

LGTM, same feedback as @jprinet

server = 'https://develocity-samples.gradle.com' // adjust to your Develocity server
allowUntrustedServer = false // ensure a trusted certificate is configured

buildScan {
capture { taskInputFiles = true }
Copy link
Member

Choose a reason for hiding this comment

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

I think sharing a streamlined version with only mandatory fields make sense

I would agree with making this particular sample streamlined (i.e. don't explicitly declaring defaults). We have other material that can help a user determine whether they need allowUntrustedServer or not.

id 'com.gradle.common-custom-user-data-gradle-plugin' version '2'
}

def isCI = System.getenv('CI') != null // adjust to your CI provider

gradleEnterprise {
develocity {
server = 'https://develocity-samples.gradle.com' // adjust to your Develocity server
allowUntrustedServer = false // ensure a trusted certificate is configured

buildScan {
Copy link
Member

Choose a reason for hiding this comment

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

I suspect there is no hope in convincing you all of replacing:

buildScan {
    uploadInBackground = !isCI
}

With:

buildScan.uploadInBackground = !isCI

🙃

@runningcode runningcode merged commit 3d824b6 into main Apr 8, 2024
20 checks passed
@runningcode runningcode deleted the no/gradle-samples branch April 8, 2024 13:17
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

4 participants